unified

Project: unlight/remark-sources

Package: remark-sources@1.1.0

  1. Insert source code to markdown files
  1. remark 213
  2. markdown 152
  3. remark-plugin 81

remark-sources

Inject source code to markdown files.

Install

npm install --save-dev remark-sources

Usage

const remark = require('remark');
const sources = require('remark-sources');
const input = '```js (index.js)\n```'; // (path to file in round brackets)
const options = {};
const output = remark().use(sources, options).processSync(input).toString();

Output:

// this is index.js content

Options

const defaultOptions = {};