Document tools

Markdown to reStructuredText

Convert markdown to rst with pandoc. Runs entirely on your device.

Runs on your device. The file is never uploaded.

Markdown to reStructuredText turns Markdown headings into underlined sections and fenced code into code blocks, with the underline lengths, directive indentation and blank lines RST insists on. The result is saved as .rst. What you get is plain RST: toctree, ref and doc belong to Sphinx, and none of them are invented.

Input

Questions

Does it get reStructuredText indentation and headings right?

Yes, that is the main reason to use it rather than reformatting by hand. RST is stricter than Markdown about underlined section headers, directive indentation and blank lines, and pandoc's RST writer handles all of that. Headings become underlined sections, code fences become code blocks, and lists get the indentation RST needs.

What happens to raw HTML in my Markdown?

It has no reStructuredText equivalent, so expect it to come out as a raw block or to disappear entirely. Read the output before you commit it. The same caution applies to anything else that is Markdown-flavoured rather than structural, like HTML entities or inline style attributes.

Is the output ready for Sphinx?

It is plain reStructuredText, not Sphinx-flavoured. Sphinx-only directives such as toctree, and roles such as ref and doc, are not invented by pandoc; you add those yourself. What pandoc gives you is a correct .rst body that Sphinx will happily parse once you drop it into your source tree.

What is the file called?

Your file name with the extension replaced by .rst, so guide.md becomes guide.rst. The converted text is also shown on the page so you can read it before downloading, and copying takes the whole thing even when the preview is truncated.

How do I convert reStructuredText to Markdown?

Use reStructuredText to Markdown, the same pandoc engine in reverse. Round trips lose things in both directions: RST directives with no Markdown equivalent going one way, raw HTML going the other. Nothing is uploaded in either direction; pandoc runs as WebAssembly in this tab.

Related Document tools