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 = {};