Swizec / remark-code-screenshot

Remark plugin to turn code blocks into carbon.now.sh screenshots.
MIT License
31 stars 2 forks source link
gatsby markdown remark remark-plugin remarkjs

remark-code-screenshot

Remark plugin to convert code blocks into carbon.now.sh screenshots.

Basic Usage

import remark from 'remark'
import codeScreenshot from 'remark-code-screenshot'

const markdownInput = ["```
    import remark from 'remark'
    import codeScreenshot from 'remark-code-screenshot'

    const markdownInput = \"\"

    remark().use(codeScreenshot)
    .process(markdownInput, function (err, output) {
        console.log(output)
    })
```"]

remark()
    .use(codeScreenshot)
    .process(markdownInput, function (err, output) {
        console.log(output)
    });

Outputs something like this: