Hey, passing quickly to drop this useful tip.
I just found this comfortable way of converting and working with Markdown files, and thought of sharing these two tips.
Converting from AsciiDoc to Markdown
- Install asciidoc and pandoc:
$ brew install asciidoc pandoc
2. Using asciidoc, generate an xml from your adoc file:
$ asciidoc -b docbook yourfile.adoc
On the directory now you have yourfile.adoc and yourfile.xml.
3. Using these files, generate the markdown file:
○ → pandoc -f docbook -t markdown_strict yourfile.xml yourfile.adoc -o yourfile.md
If you are getting line breaks after each 80 chars on the generated md file, then, use this command instead. It worked well for me:
iconv -t utf-8 yourfile.xml | pandoc -f docbook -t markdown_strict --wrap=none | iconv -f utf-8 > yourfile.md
Congrats your doc is now in markdown style. Let’s validate the work.
A recent tool I started using and I enjoy a lot, is Typora. I’m using it for editing lots of Markdown files (i.e. GitHub readme files). It’s available for OS X, Linux and Windows. The editor is easy to use and enables writing in markdown super quick without having to memorize all the sintax.
Finally… Once you migrated your adoc file, just open the folder using Typora to double check the work and adjust details.