Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to convert markdown to asciidoc (or be able to produce the same HTML output)?

Tags:

Here is my problem, normally I convert asciidoc documents to HTML (or more precisely asciidoc --> docbook --> html) but here I've been given a markdown document.

I would like to be able to produce an HTML document from that markdown document that would look the same as if it was coming from an asciidoc OR be able to convert this markdown to asciidoc somehow?

like image 365
Laurent T Avatar asked Sep 06 '11 17:09

Laurent T


People also ask

How do I convert Markdown to HTML?

To convert Markdown to HTML using Typora, click File —> Export —> HTML.

Can Pandoc convert HTML to markdown?

Pandoc can convert between numerous markup and word processing formats, including, but not limited to, various flavors of Markdown, HTML, LaTeX and Word docx.


2 Answers

To echo @akosma comment, pandoc does indeed have AsciiDoc support:

# Convert to AsciiDoc from Markdown:
$ pandoc -t asciidoc -f markdown file1.md > file1.txt

You can also go directly from Markdown to HTML:

$ pandoc -S -t html -f markdown file1.md > file1.html

(The -S just to produce nice curly quotes and other Smart typographical changes)

like image 194
Richard Dallaway Avatar answered Oct 08 '22 20:10

Richard Dallaway


Try to use Pandoc to convert the markdown source to docbook xml.

From there, it should be possible to convert the docbook xml to html with the same technique as you used before for the asciidoc input, e.g. use the same xslt-translations for docbook->html.

like image 20
KimCM Avatar answered Oct 08 '22 20:10

KimCM