February 24, 2020

[Tip] How to convert AsciiDoc to Markdown

I write posts on this blog using AsciiDoc, but a couple of resources I repost on support only Markdown, so to convert articles I use the following commands:

asciidoctor -b docbook index.adoc
pandoc -f docbook -t markdown_strict -o index.md index.xml

The only question that remains is how to properly convert code listings' captures.

One of the platforms I repost on is Habr. Its Markdown dialect can’t correctly process line breaks and starts a new paragraph after each line break, so I need to perform one more transformation:

pandoc -f markdown -t markdown_mmd -o habr.md ru.md --wrap=none

markdown_mmd is specified just because of its ability to create syntax highlighting that fit Habr.

Thanks to the authors of the following articles:

© Roman Kudryashov 2019-2020

Powered by Hugo & Kiss.