Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Convert asciidoc to Github Flavored Markdown
# Adapted from
# Using asciidoctor and pandoc
# Install pandoc and asciidoctor
$ sudo apt install asciidoctor
$ sudo wget
$ sudo dpkg -i pandoc-
# Convert asciidoc to docbook using asciidoctor
$ asciidoctor -b docbook foo.adoc
# foo.xml will be output into the same directory as foo.adoc
# Convert docbook to markdown
$ pandoc -f docbook -t gfm foo.xml -o
# Unicode symbols were mangled in Quick workaround:
$ iconv -t utf-8 foo.xml | pandoc -f docbook -t gfm | iconv -f utf-8 >
# Pandoc inserted hard line breaks at 72 characters. Removed like so:
$ pandoc -f docbook -t gfm --wrap=none # don't wrap lines at all
$ pandoc -f docbook -t gfm --columns=120 # extend line breaks to 120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.