markdown-it-concat-code
Concatenate all or some fenced code blocks from a markdown file.
Usage
const md = ;
The opts
object can contain:
Name | Type | Description |
---|---|---|
lang |
string | Only include code blocks specifying `lang' as the language. If not specified, null or empty string then return all fenced code blocks. |
separator |
string | Append this string after each code block included in output. Defaults to '\n'. |
src
is an object whose value will be filled with the concatenated code blocks.
Example
const mdconcat = default var mds = fs;var src = {}; // all code blocks; console; // with `lang` specified; console;
Testing
npm run test
// Some C code for test case