Markdown to HTML conversion on entire directories using marked
npm install marked-directory --save-dev
npm install -g marked-directory
const md = require('marked-directory');
// returns a promise
md([
'./test/docs/**/*.md',
'./test/docsBuild',
'./test/docs/',
'./'
]).then(() => console.log('done'));
md(
[
'./test/docs/**/*.md', // Glob pattern to find files
'./test/docsBuild', // Path to output rendered files
'./test/docs/', // (optional) SearchValue to find in destination paths
'./' // (optional) Replacement value if the above SearchValue is found
], {
logger, // default logging is console.log
markedOptions // override marked options
}
);
marked-directory './test/docs/**/*.md' './test/docsBuild' './test/docs/' './'
marked-directory [glob to markdown files] [output directory] [path searchValue to replace] [path newValue if found by previous arg]