平时写文档,更倾向于使用asciidoc来写文档,因为他有更加丰富的功能。有的时候想发博客出去,但是一般网站的博客都是支持markdown的,所要有需求要将adoc转换为markdown的形式发送到网站上去。
sudo apt install pandoc asciidoc
asciidoc -b docbook foo.adoc
foo.xml will be output into the same directory as foo.adoc
pandoc -f docbook -t markdown_strict foo.xml -o foo.md
iconv -t utf-8 foo.xml | pandoc -f docbook -t markdown_strict | iconv -f utf-8 > foo.md
iconv -t utf-8 foo.xml | pandoc -f docbook -t markdown_strict --wrap=none | iconv -f utf-8 > foo.md