Skip to content

razroo/razroo-remark-netlify

Repository files navigation

razroo-remark-netlify

Remark plugin for embedding code snippets from github permalinks.

Usage

yarn add --dev @razroo/razroo-remark-embed-code
import remark from 'remark';
import embeddedCodeSnippets from '@razroo/razroo-remark-embed-code';
import report from 'vfile-reporter';

remark()
  .use(embeddedCodeSnippets)
  .process(markdown, (err, file) => {
    console.log(String(file));
    console.error(report(err || file));
  });

Example

Input

![](https://github.com/jomaxx/remark-embedded-code-snippets/blob/78d8ec567422a9776beb2d48dd826189aed58267/prettier.config.js#L1)

Output

module.exports = require('@spotify/web-scripts/config/prettier.config.js');