From 975864ddf0a8f2cc3163414e17b5c63c0d253c7d Mon Sep 17 00:00:00 2001 From: Dom Hallan Date: Thu, 4 Aug 2022 17:31:43 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20correct=20email=20in=20readme=20?= =?UTF-8?q?and=20add=20proper=20python=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 23 ++-- package.json | 334 +++++++++++++++++++++++++-------------------------- src/utils.js | 37 +++--- 3 files changed, 200 insertions(+), 194 deletions(-) diff --git a/README.md b/README.md index 9e4e421..05f6d1f 100644 --- a/README.md +++ b/README.md @@ -4,22 +4,25 @@ Run code snippet in markdown language for multiple languages: **bash,python, gol ## Contact -github: https://github.com/JeepShen/vscode-markdown-code-runner -email: jianpushen@gamil.com +[github repo](https://github.com/JeepShen/vscode-markdown-code-runner) + +[Contact me](mailto:jianpushen@gmail.com) ## Features -* Run current active .md code block -* Stop code running -* View output in Output Window -* Support running code in Integrated Terminal +- Run current active .md code block +- Stop code running +- View output in Output Window +- Support running code in Integrated Terminal ## Usages -* To run code: - * Edit code blocks in markdown file (.md). - * Click `Run` button at bottom of the active code block. +- To run code: + - Edit code blocks in markdown file (.md). + - Click `Run` button at bottom of the active code block. ![demo.gif](https://github.com/JeepShen/vscode-markdown-code-runner/blob/master/images/demo.gif) + ## Change Log -- 2020.06.14 release 0.1.0 \ No newline at end of file + +- 2020.06.14: [release 0.1.0](https://github.com/JeepShen/vscode-markdown-code-runner/releases/tag/0.1.0) diff --git a/package.json b/package.json index 5e7d546..7d457e2 100644 --- a/package.json +++ b/package.json @@ -1,169 +1,169 @@ { - "name": "vscode-markdown-code-runner", - "displayName": "Markdown Code Runner", - "description": "Run markdown code snippets.", - "publisher": "jeepshen", - "icon": "images/logo.png", - "version": "0.1.1", - "engines": { - "vscode": "^1.45.1" - }, - "categories": [ - "Other", - "Snippets" - ], - "keywords": [ - "markdown", - "code runner" - ], - "bugs": { - "url": "https://github.com/JeepShen/vscode-markdown-code-runner/issues", - "email": "jianpushen@gmail.com" - }, - "homepage": "https://github.com/JeepShen/vscode-markdown-code-runner", - "repository": { - "type": "git", - "url": "https://github.com/JeepShen/vscode-markdown-code-runner" - }, - "activationEvents": [ - "onLanguage:markdown" - ], - "main": "./src/extension.js", - "contributes": { - "commands": [ - { - "command": "markdown-code-runner.run", - "title": "Run Snippet" - }, - { - "command": "markdown-code-runner.save", - "title": "Save Snippet" - } - ], - "configuration": [ - { - "title": "Markdown Code Runner", - "properties": { - "markdown-code-runner.workspaceFolder": { - "type": "string", - "scope": "application", - "description": "The path of the workspace folder to store the problem files.", - "default": "" - }, - "markdown-code-runner.runInTerminal": { - "type": "boolean", - "scope": "application", - "description": "Run in terminal otherwise output channel.", - "default": true - }, - "markdown-code-runner.showExecutionMessage": { - "type": "boolean", - "scope": "application", - "description": "show execution detail message.", - "default": true - }, - "markdown-code-runner.terminalRoot": { - "type": "boolean", - "scope": "application", - "description": "terminal root in win32.", - "default": true - }, - "markdown-code-runner.executorMap": { - "type": "object", - "default": { - "javascript": "node", - "java": "cd $dir && javac $fileName && java $fileNameWithoutExt", - "c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", - "cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", - "objective-c": "cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", - "php": "php", - "python": "python2 -u", - "python3": "python3 -u", - "bash": "bash -x", - "perl": "perl", - "perl6": "perl6", - "ruby": "ruby", - "golang": "go run", - "lua": "lua", - "groovy": "groovy", - "powershell": "powershell -ExecutionPolicy ByPass -File", - "bat": "cmd /c", - "shellscript": "bash", - "fsharp": "fsi", - "csharp": "scriptcs", - "vbscript": "cscript //Nologo", - "typescript": "ts-node", - "coffeescript": "coffee", - "scala": "scala", - "swift": "swift", - "julia": "julia", - "crystal": "crystal", - "ocaml": "ocaml", - "r": "Rscript", - "applescript": "osascript", - "clojure": "lein exec", - "haxe": "haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt", - "rust": "cd $dir && rustc $fileName && $dir$fileNameWithoutExt", - "racket": "racket", - "scheme": "csi -script", - "ahk": "autohotkey", - "autoit": "autoit3", - "dart": "dart", - "pascal": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt", - "d": "cd $dir && dmd $fileName && $dir$fileNameWithoutExt", - "haskell": "runhaskell", - "nim": "nim compile --verbosity:0 --hints:off --run", - "lisp": "sbcl --script", - "kit": "kitc --run", - "v": "v run", - "sass": "sass --style expanded", - "scss": "scss --style expanded", - "less": "cd $dir && lessc $fileName $fileNameWithoutExt.css" - }, - "description": "Set the executor of each language.", - "scope": "resource" - }, - "markdown-code-runner.editor.shortcuts": { - "type": "array", - "default": [ - "run" - ], - "scope": "application", - "items": { - "type": "string", - "enum": [ - "run", - "save" - ] - }, - "description": "Customize the shorcuts in editors." - } - } - } - ] - }, - "scripts": { - "vscode:prepublish": "npm run compile", - "compile": "tsc -p ./", - "lint": "eslint src --ext ts", - "watch": "tsc -watch -p ./", - "pretest": "npm run compile && npm run lint", - "test": "node ./out/test/runTest.js" - }, - "devDependencies": { - "@types/glob": "^7.1.1", - "@types/mocha": "^7.0.2", - "@types/node": "^13.11.0", - "@types/vscode": "^1.45.1", - "@typescript-eslint/eslint-plugin": "^2.30.0", - "@typescript-eslint/parser": "^2.30.0", - "eslint": "^6.8.0", - "glob": "^7.1.6", - "micromatch": "^4.0.2", - "mocha": "^7.1.2", - "tree-kill": "^1.2.2", - "typescript": "^3.8.3", - "vscode-test": "^1.3.0" - }, - "dependencies": {} + "name": "vscode-markdown-code-runner", + "displayName": "Markdown Code Runner", + "description": "Run markdown code snippets.", + "publisher": "jeepshen", + "icon": "images/logo.png", + "version": "0.1.1", + "engines": { + "vscode": "^1.45.1" + }, + "categories": [ + "Other", + "Snippets" + ], + "keywords": [ + "markdown", + "code runner" + ], + "bugs": { + "url": "https://github.com/JeepShen/vscode-markdown-code-runner/issues", + "email": "jianpushen@gmail.com" + }, + "homepage": "https://github.com/JeepShen/vscode-markdown-code-runner", + "repository": { + "type": "git", + "url": "https://github.com/JeepShen/vscode-markdown-code-runner" + }, + "activationEvents": [ + "onLanguage:markdown" + ], + "main": "./src/extension.js", + "contributes": { + "commands": [ + { + "command": "markdown-code-runner.run", + "title": "Run Snippet" + }, + { + "command": "markdown-code-runner.save", + "title": "Save Snippet" + } + ], + "configuration": [ + { + "title": "Markdown Code Runner", + "properties": { + "markdown-code-runner.workspaceFolder": { + "type": "string", + "scope": "application", + "description": "The path of the workspace folder to store the problem files.", + "default": "" + }, + "markdown-code-runner.runInTerminal": { + "type": "boolean", + "scope": "application", + "description": "Run in terminal otherwise output channel.", + "default": true + }, + "markdown-code-runner.showExecutionMessage": { + "type": "boolean", + "scope": "application", + "description": "show execution detail message.", + "default": true + }, + "markdown-code-runner.terminalRoot": { + "type": "boolean", + "scope": "application", + "description": "terminal root in win32.", + "default": true + }, + "markdown-code-runner.executorMap": { + "type": "object", + "default": { + "javascript": "node", + "java": "cd $dir && javac $fileName && java $fileNameWithoutExt", + "c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", + "cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", + "objective-c": "cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", + "php": "php", + "python": "python -u", + "python3": "python3 -u", + "bash": "bash -x", + "perl": "perl", + "perl6": "perl6", + "ruby": "ruby", + "golang": "go run", + "lua": "lua", + "groovy": "groovy", + "powershell": "powershell -ExecutionPolicy ByPass -File", + "bat": "cmd /c", + "shellscript": "bash", + "fsharp": "fsi", + "csharp": "scriptcs", + "vbscript": "cscript //Nologo", + "typescript": "ts-node", + "coffeescript": "coffee", + "scala": "scala", + "swift": "swift", + "julia": "julia", + "crystal": "crystal", + "ocaml": "ocaml", + "r": "Rscript", + "applescript": "osascript", + "clojure": "lein exec", + "haxe": "haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt", + "rust": "cd $dir && rustc $fileName && $dir$fileNameWithoutExt", + "racket": "racket", + "scheme": "csi -script", + "ahk": "autohotkey", + "autoit": "autoit3", + "dart": "dart", + "pascal": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt", + "d": "cd $dir && dmd $fileName && $dir$fileNameWithoutExt", + "haskell": "runhaskell", + "nim": "nim compile --verbosity:0 --hints:off --run", + "lisp": "sbcl --script", + "kit": "kitc --run", + "v": "v run", + "sass": "sass --style expanded", + "scss": "scss --style expanded", + "less": "cd $dir && lessc $fileName $fileNameWithoutExt.css" + }, + "description": "Set the executor of each language.", + "scope": "resource" + }, + "markdown-code-runner.editor.shortcuts": { + "type": "array", + "default": [ + "run" + ], + "scope": "application", + "items": { + "type": "string", + "enum": [ + "run", + "save" + ] + }, + "description": "Customize the shorcuts in editors." + } + } + } + ] + }, + "scripts": { + "vscode:prepublish": "npm run compile", + "compile": "tsc -p ./", + "lint": "eslint src --ext ts", + "watch": "tsc -watch -p ./", + "pretest": "npm run compile && npm run lint", + "test": "node ./out/test/runTest.js" + }, + "devDependencies": { + "@types/glob": "^7.1.1", + "@types/mocha": "^7.0.2", + "@types/node": "^13.11.0", + "@types/vscode": "^1.45.1", + "@typescript-eslint/eslint-plugin": "^2.30.0", + "@typescript-eslint/parser": "^2.30.0", + "eslint": "^6.8.0", + "glob": "^7.1.6", + "micromatch": "^4.0.2", + "mocha": "^7.1.2", + "tree-kill": "^1.2.2", + "typescript": "^3.8.3", + "vscode-test": "^1.3.0" + }, + "dependencies": {} } diff --git a/src/utils.js b/src/utils.js index f6d27b3..da3fa32 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,26 +1,29 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.fetchfileExtension = exports.fetchLangExecutor = exports.getEditorShortcuts = exports.getWorkspaceConfiguration = void 0; -const vscode = require("vscode"); -const share_1 = require("./share"); +'use strict' +Object.defineProperty(exports, '__esModule', { value: true }) +exports.fetchfileExtension = exports.fetchLangExecutor = exports.getEditorShortcuts = exports.getWorkspaceConfiguration = void 0 +const vscode = require('vscode') +const share_1 = require('./share') function getWorkspaceConfiguration() { - return vscode.workspace.getConfiguration("markdown-code-runner"); + return vscode.workspace.getConfiguration('markdown-code-runner') } -exports.getWorkspaceConfiguration = getWorkspaceConfiguration; +exports.getWorkspaceConfiguration = getWorkspaceConfiguration function getEditorShortcuts() { - return getWorkspaceConfiguration().get("editor.shortcuts", ["run"]); + return getWorkspaceConfiguration().get('editor.shortcuts', ['run']) } -exports.getEditorShortcuts = getEditorShortcuts; +exports.getEditorShortcuts = getEditorShortcuts /* -* @param {string} lang -*/ + * @param {string} lang + */ function fetchLangExecutor(lang) { - const maps = getWorkspaceConfiguration().get("executorMap", { "sh": "bash", "python": "python3" }); - return maps[lang]; + const maps = getWorkspaceConfiguration().get('executorMap', { + sh: 'bash', + python: 'python' + }) + return maps[lang] } -exports.fetchLangExecutor = fetchLangExecutor; +exports.fetchLangExecutor = fetchLangExecutor function fetchfileExtension(lang) { - return share_1.langExt.get(lang) || ""; + return share_1.langExt.get(lang) || '' } -exports.fetchfileExtension = fetchfileExtension; -//# sourceMappingURL=utils.js.map \ No newline at end of file +exports.fetchfileExtension = fetchfileExtension +//# sourceMappingURL=utils.js.map