Batch convert Github flavored markdown files through the command-line.
Batch convert Markdown files into HTML.
Install node.js 0.6.0+ and run:
sudo npm install gh-markdown-cli -g
This will create an alias to the executable on your
if you install it without the
-g flag you won't be able use it as global
mdown --input "**/*.md" --output doc
This will convert any
.md files it can find inside the
and it's child folders and output them into the
If you want to convert only files inside the directory itself but ignore child
folders change the
--input glob to
mdown -i "src/*.md" -o doc
And to convert just a single file and output it into the current folder:
mdown -i "foo.md" -o .
You can specify HTML files to be used as header and footer of all the pages:
mdown -i "*.md" -o dist --header "assets/header.html" --footer "assets/header.html"
It also works with
stdout, so you can pipe other command-line
cat foo.md | mdown > foo.htmlecho "# foo" | mdowncurl https://raw.github.com/millermedeiros/gh-markdown-cli/master/README.md | mdown
If you don't specify the
--output it will echo the result to
stdout by default.
For a list of all available options run
$ mdown -hUsage: mdown [options]Options:-h, --help output usage information-V, --version output the version number-o, --output <name> Output directory or output file name
The real work was done by the creators of the open source libraries used by this project (node-glob, minimatch, wrench-js, github-flavored-markdown, commander.js), I only assembled things together to make it easier to use, the credit should go to them.