1001Ferramentas
📰 Converters

Markdown → reStructuredText

Basic Markdown to RST converter: underlined headings (=== ---), lists, links and inline code. Useful for Sphinx.

reStructuredText:

Markdown to reStructuredText

reStructuredText is the format of Python documentation: Sphinx, Read the Docs and much of the language ecosystem expect .rst files. Anyone writing Markdown day to day who needs to contribute to one of those projects ends up translating the markup — and the differences start right at the headings, which in RST use no hash marks but a line of symbols underneath the text.

Paste the Markdown and the page returns the RST equivalent. The three heading levels get underlined with equals, hyphen and tilde, sized to the length of the title; list items swap the hyphen for an asterisk; strong emphasis becomes a double asterisk, which is the same on both sides; and a fenced code block becomes the double-colon marker followed by an indented block, which is how RST represents literal code.

The conversion works line by line and covers what appears in most of a README. What it leaves out is anything requiring an understanding of the whole document — tables, footnotes, cross-references, Sphinx directives. For a large file the result serves as a first pass; for a full project migration, the usual tool is Pandoc, which builds the document tree before writing.

Frequently asked questions

Why must the underline match the title length?
Because RST requires the adornment line to be at least as long as the text above it. A shorter one makes Sphinx emit a warning and sometimes stop recognising the heading. The conversion generates the exact length, so remember to adjust the line below whenever you edit a title later.
Which symbol maps to which level?
RST does not fix that: the level comes from the order of first appearance in the document. The most common convention, used here, is equals for the first level, hyphen for the second and tilde for the third. What matters is staying consistent within the file — switching the order midway confuses the generator.
What about MyST, which allows Markdown in Sphinx?
It is a real alternative: MyST extends Markdown with RST's directive syntax, and new projects often adopt it so contributors need not learn RST. If the destination project already uses MyST, converting may be unnecessary.

Related Tools