markdown-it-codesandbox-embed
Version:
markdown-it plugin for creating sandboxes on the fly for your code examples.
31 lines (17 loc) • 533 B
Markdown
for creating sandboxes on the fly for your code examples.
Install it with: `npm i markdown-it-codesandbox-embed`
Use:
```javascript
const mdCodesandbox = require('markdown-it-codesandbox-embed')
// ...
md.use(mdCodesandbox, { directory: 'my-examples' })
```
And in the markdown:
```md
@[codesandbox](example-1)
Also works with params:
@[codesandbox](example-1?view=split)
```
Then you should save your sandbox files in the `my-examples/example-1/` folder.
markdown-it plugin