Pre-evaluate JavaScript in your Markdown code.
MIT License
yarn add markdown-it markdown-it-markeval
const md = require('markdown-it')()
const markeval = require('markdown-it-markeval')
const html = md
.use(markeval, {
// Required if you want to require from relative path or `node_modules`
cwd: process.cwd() // default
})
.render('markdown code')
Input:
This is your pokemon:
```js
// @markeval
module.exports = require('pokemon').random()
```
Output:
This is your pokemon:
Pikacho
// @markeval
comment into the code blockmarkeval
: ```markeval
The code blocks that match the syntax with be replaced by the exported content.
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
markeval © egoist, Released under the MIT License. Authored and maintained by egoist with help from contributors (list).
egoistian.com · GitHub @egoist · Twitter @rem_rin_rin