0.1.2 • Published 7 years ago
markdown-it-markeval v0.1.2
markeval
Install
yarn add markdown-it markdown-it-markeval
Usage
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')
Example
Input:
This is your pokemon:
```js
// @markeval
module.exports = require('pokemon').random()
```
Output:
This is your pokemon:
Pikacho
Syntax
- Add
// @markeval
comment into the code block - Or three backticks +
markeval
: ```markeval
The code blocks that match the syntax with be replaced by the exported content.
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
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