Deprecate!Please use own prettier, already supports markdown. 2018-01-10
Prettier JavaScript code in markdown.
yarn global add prettier-markdown
npm install [-g] prettier-markdown
Run prettier-markdown through the CLI with this script.
prettier-markdown ./**/*.md
# Short command
pmd ./**/*.md
If has callback
argument, otherwise return a Promise object.
prettierMarkdown(markdownFile [,options] [, callback])
const prettierMarkdown = require('prettier-markdown');
prettierMarkdown('./foo.md', function(err, msg) {
console.log(msg);
});
// promise
const promise = prettierMarkdown(
'./foo.md',
{
/* options */
}
);
promise.then(msg => console.log);