Run snippets in your markdown document.
- Running code snippet in Markdown file
Markdown has syntax for code snippets:
```language
your_code.goes_here();
```
- Select the whole snippet (including the marker: ```).
- Run
Run Snippet in Markdown
from command palette.
This extension automatically open new untitled document. Its content is the
snippet, filetype is the one specified at just after
beginning marker (language
part of beginning marker ```language
). Inserted snippet is modified based on language-specific template from the
original (surrounded by ```) snippet.
This extension depends on the following extension:
-
Great extension to run opening code snippet. Running the extracted snippet is all done by this extension. Can be installed from MarketPlace.
-
markdown-run-snippet.mdToVscodeTypeMap
Example:
"markdown-run-snippet.mdToVscodeTypeMap": { "cpp": "C++" }
Map from language specified in Markdown to Visual Studio Code's filetype. If there is no entry, the same string is used as Visual Studio Code's filetype.
-
markdown-run-snippet.mdTypeToTemplateMap
Example:
"markdown-run-snippet.mdTypeToTemplateMap": { "rust": "fn main() {\n $snippet\n}" }
Map from language specified in Markdown to template (that will be applied to the snippet). Template feature is useful for importing common modules, including common headers, defining main() function. selected snippet will be placed at the position of
$snippet
. The leading ' '(whitespace) before$snippet
is important, because the same amount of ' ' will be prepended to all lines of selected snippet.
Configurations defined by default are very very few.
Initial release