Install pandoc and asciidoc
sudo apt install pandoc asciidoc
Convert asciidoc to docbook
asciidoc -b docbook foo.adoc
foo.xml will be output into the same directory as foo.adoc
Convert docbook to markdown
pandoc -f docbook -t markdown_strict foo.xml -o foo.md
Unicode symbols were mangled in foo.md. Quick workaround:
iconv -t utf-8 foo.xml | pandoc -f docbook -t markdown_strict | iconv -f utf-8 > foo.md
Pandoc inserted hard line breaks at 80 characters. Removed like so:
iconv -t utf-8 foo.xml | pandoc -f docbook -t markdown_strict --wrap=none | iconv -f utf-8 > foo.md
/nix | Jan 24, 2017