Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sakryukov/vscode-markdown-calculator
Visual Studio Code extension: Markdown Calculator
https://github.com/sakryukov/vscode-markdown-calculator
extension markdown node-js visual-studio-code
Last synced: 25 days ago
JSON representation
Visual Studio Code extension: Markdown Calculator
- Host: GitHub
- URL: https://github.com/sakryukov/vscode-markdown-calculator
- Owner: SAKryukov
- License: mit
- Created: 2021-03-02T02:59:08.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-08T01:37:33.000Z (4 months ago)
- Last Synced: 2024-09-08T03:01:39.664Z (4 months ago)
- Topics: extension, markdown, node-js, visual-studio-code
- Language: JavaScript
- Homepage: https://www.SAKryukov.org
- Size: 643 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Visual Studio Code extension: Markdown Calculator
![Logo](images/logo.png)
Put the keyword (by default, "run") on the same line as the opening fence indicator.
It will force the *fenced code block* to execute instead of rendering it:````
~~~~ run
const x = 2, y = 3;
console.log(x, y, x+y);
return x * y;
~~~~
````The execution results will be rendered instead of the source code:
2 3 5
6
Likewise, for an *inline code* fragment, the result of a calculation will be rendered, if it starts with the keyword "return". For example, `return 10 ** 6` will be rendered as 1000000.
The `console` functions are supported. The keyword, syntactic decorators, and output styles are configurable.
This extension can be combined with other markdown-it extensions. In particular, the rendered HTML can be saved using [Extensible Markdown](https://github.com/SAKryukov/vscode-extensible-markdown).
Original publication: [https://www.codeproject.com/Articles/5297157/Markdown-Calculator](https://www.codeproject.com/Articles/5297157/Markdown-Calculator)