hackmd-cli icon indicating copy to clipboard operation
hackmd-cli copied to clipboard

Direct conversion from markdown to html with hackmd-cli

Open excurice opened this issue 5 years ago • 1 comments

Hi, I am looking to integrate an auto-publishing pipeline with GitHub Actions. Our current documentation is written in HackMD-favoured markdown, is there a way to directly convert markdown to html file with a command like the following:

hackmd-cli export --import filename.md --html filename.html

Many thanks!

excurice avatar Jul 03 '20 17:07 excurice

Have a look at Pandoc, it's the holy grail in Markdown land. :wink:

You can directly feed the hackmd-cli export to pandoc:

hackmd-cli export --md [ID] | pandoc --from=markdown --to=html --output=filename.html

You probably want to customize the set of Pandoc extensions in use. Also you might wanna consider writing a custom Pandoc template for your HTML output (or re-using an existing one from someone else).

salim-b avatar Jul 08 '20 21:07 salim-b