Skip to content

markdown-it plugin for creating sandboxes on the fly for your code examples. Use it with VuePress or any markdown-it based project.

License

Notifications You must be signed in to change notification settings

spatialnetworkslab/markdown-it-codesandbox-embed

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

markdown-it-codesandbox-embed

markdown-it plugin for creating sandboxes on the fly for your code examples.

Install it with: npm i markdown-it-codesandbox-embed

Use:

const mdCodesandbox = require('markdown-it-codesandbox-embed')

// ...

md.use(mdCodesandbox, { directory: 'my-examples' /* Other options */ })

And in the markdown:

# My example

@[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.

Options

Options with defaults:

{
    directory: 'examples', // directory where you store your sandboxes
    templateFn: undefined // custom template function that takes the url and return the embed markup, url => markup. By default it renders an iframe.
}

About

markdown-it plugin for creating sandboxes on the fly for your code examples. Use it with VuePress or any markdown-it based project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%