Fact-checked by Grok 2 weeks ago

reStructuredText

reStructuredText () is an easy-to-read, what-you-see-is-what-you-get markup syntax and parser system designed for creating structured documents that are both human-readable in their source form and convertible to output formats such as , , or XML. It uses simple, unobtrusive constructs to denote elements like headings, lists, and emphasis, making it suitable for inline program , standalone articles, and across various domains. Developed as part of the Docutils project, reStructuredText emphasizes principles of readability, simplicity, intuitiveness, and extensibility, ensuring unambiguous parsing with a single possible output interpretation. Originating from revisions to earlier lightweight markup systems like StructuredText (introduced in 1996 by Jim Fulton for Zope documentation) and Setext, reStructuredText was spearheaded by David Goodger in the late 1990s within the community. The first draft specification was posted in November 2000 to the Doc-SIG (Documentation ), followed by refinements in 2001 that addressed ambiguities in predecessors and incorporated feedback for docstring standards (as outlined in 256, 257, and 258). By April 2002, it was integrated into the initial release of Docutils (version 0.1), evolving into a core component of this open-source documentation processing framework. Key features of reStructuredText include support for hierarchical section structures (using underlined titles), bulleted and enumerated , definition and field lists, literal blocks for code, and interpreted text roles for semantic markup like hyperlinks or citations. Directives extend its functionality for complex elements such as tables, images, and admonitions (e.g., notes or warnings), while the parser handles inline markup for emphasis (italics), strong text (bold), and literal text (code). These elements enable scalable use from short docstrings to full-length books, with the system remaining language-neutral and adaptable to non-technical content. Widely adopted in the Python ecosystem, reStructuredText serves as the default markup for tools like Sphinx (a ) and is integral to projects such as the Python standard library documentation. Its parser, implemented in Python, processes source files into Docutils' internal Document Tree representation, facilitating transformations via writers for diverse outputs and promoting reusable, maintainable documentation workflows. Despite its origins in Python, reStructuredText's design allows broad applicability, including simple web pages and collaborative editing environments where plain text remains the primary authoring medium.

Overview

Definition and Purpose

reStructuredText (reST) is a lightweight, markup syntax designed primarily for technical , especially within the programming community. It functions as an easy-to-read, what-you-see-is-what-you-get format that uses simple and intuitive constructs to indicate document structure, making it suitable for inline program like docstrings, web pages, and standalone documents. The core purpose of reStructuredText is to enable the creation of highly readable source files that establish standard conventions for plaintext structure and can be processed into structured data formats. Through parsers such as those provided by the Docutils project, it facilitates conversion to various output formats, including , PDF, , and , allowing developers and writers to produce professional documentation from maintainable, human-focused text. reStructuredText files commonly use the .rst extension and are placed in the , which imposes no license requirements or restrictions on use. It was initiated by David Goodger, with the first draft specification posted in November 2000, later becoming a key component of the Docutils project upon its release in 2002, aimed at standardizing documentation practices in . In comparison to predecessors like , which offers no built-in structural elements, or , which often results in verbose and less source-readable code, reStructuredText achieves a balance of simplicity, readability, and expressive power for structured content.

Design Principles

reStructuredText (reST) is designed with a strong emphasis on readability, ensuring that the marked-up remains accessible and intuitive for authors without requiring specialized knowledge of the . This what-you-see-is-what-you-get () approach prioritizes minimal processing overhead, allowing documents to function as even before conversion, while unobtrusive markup elements blend seamlessly into the content for casual readers. A core principle is extensibility, achieved through directives and roles that enable users to introduce custom markup and functionality without modifying the fundamental syntax. This supports the addition of complex or domain-specific elements, such as custom interpretations or substitutions, fostering adaptability for diverse needs while maintaining a consistent core. Influenced by longstanding plain text conventions, including those from email signatures, files, and earlier systems like Setext, reST ensures backward compatibility with unstructured text by treating unmarked content as literal . This heritage allows legacy documents to be incrementally enhanced without disruption, promoting a smooth transition to structured markup. The system favors semantic markup over purely presentational elements, focusing on content structure and meaning to facilitate conversion to multiple output formats, such as , , or XML, without tying the source to a specific rendering. This output-format-neutral enables versatile processing pipelines, where the emphasis on logical and supports rich, context-aware transformations. Adopting a dedication for its specification and in the Docutils project encourages broad adoption, modification, and integration across tools and communities, eliminating licensing barriers to in workflows.

History

Origins and Influences

reStructuredText originated from StructuredText, a developed by Jim Fulton of Zope Corporation (formerly Digital Creations) and first released in 1996 as part of the Zope documentation system. StructuredText aimed to enable simple, readable plaintext markup for generating structured documents, but it suffered from significant limitations, including inconsistent parsing across implementations and a lack of extensibility that made it difficult to adapt for evolving needs. These shortcomings became evident in discussions on the Doc-SIG starting in 1996, where users highlighted the complexity of extending StructuredText without breaking existing functionality. In response to these issues, David Goodger began modifying StructuredText in late 1999 and initiated a full rewrite in 2000 as part of the Docutils project, specifically to create a more robust and extensible system for documentation. The redesign drew key influences from existing markup conventions: Setext for underline-style headings and hyperlink targets, providing a clean delimiter-based approach; RFC 822 for structured headers in field lists, offering a precedent for key-value formatting despite concerns over ambiguity; for inline documentation elements like tagged fields, emphasizing unambiguous tagging at the cost of intuitiveness. These influences were evaluated and adapted to prioritize simplicity, consistency, and extensibility while addressing StructuredText's parsing inconsistencies. The first public proposal for reStructuredText emerged in November 2000 with a draft specification posted to the Doc-SIG, followed by revisions in March 2001 based on community feedback, and a project website launch in June 2001. This early development emphasized the needs of the Python community for a standardized, plaintext-based documentation format that could handle inline and structural markup reliably. By April 2002, the project transitioned from its initial proprietary roots in Zope's ecosystem to an open, community-driven effort under the Docutils umbrella, with version 0.1 released and PEP 287 proposing reStructuredText as the standard for Python docstrings.

Major Releases and Developments

The Docutils project, including an initial implementation of the reStructuredText parser, was launched on June 1, 2001. The first stable release, Docutils 0.1, occurred in April 2002, marking the formal launch of the markup specification and its reference parser. By 2002, it gained significant adoption within projects, particularly following the proposal in PEP 287 to standardize it as the format for docstrings, which facilitated its integration into documentation workflows across the community. In 2003, a vanity type, text/prs.fallenstein.rst, was registered for reStructuredText files, aiding in its recognition as a distinct document format in and contexts. Key milestones in the early development included the release of Docutils 0.5 on June 25, 2008, which provided a stable reference parser with enhanced input encoding detection and new directives, solidifying reStructuredText's reliability for production use. That same year, , a built on reStructuredText, was released (version 0.1 in 2008), establishing deep integration that extended reStructuredText's capabilities for building large-scale documentation sites with features like cross-referencing and theming. Post-2019 updates focused on modernizing compatibility and extensibility. Docutils 0.20, released on May 4, 2023, introduced support for 3.11 and improved handling through additions like localization, enhancing for global efforts. This was followed by Docutils 0.21 on April 9, 2024, which enhanced directives with features such as the "loading" attribute for images and adopted the build system for better package management, while dropping support for older versions. Alignment with Sphinx 7.0 (released April 29, 2023) and subsequent versions through 2025 improved compatibility, enabling nested markup experiments that blend reStructuredText with Markdown-like syntax without modifying the core specification. Recent developments from 2020 to 2025 reflect adaptations to the rising popularity of Markdown. The MyST-Parser extension, introduced in 2020, facilitated hybrid use by parsing an extensible flavor of Markdown into reStructuredText via Docutils, allowing seamless mixing in Sphinx projects while preserving backward compatibility with pure reStructuredText documents. Sphinx 8.3.0, released in early 2025, added the doctest_fail_fast option for quicker testing in documentation and full support for Docutils 0.22, which arrived on July 29, 2025, with features like CSS3 unit support and a new XML parser for advanced processing. Subsequent patch releases, such as Docutils 0.22.2 (September 2025) and 0.22.3 (November 2025), provided bug fixes and minor improvements. Community efforts, including those in the Docutils and Sphinx projects, have emphasized maintaining backward compatibility amid Markdown's growth, ensuring reStructuredText remains viable for precise technical authoring.

Syntax

Inline Markup

Inline markup in reStructuredText () allows for the formatting and referencing of words or phrases within paragraphs and other text blocks, enabling emphasis, literal rendering, hyperlinks, and substitutions without interrupting the flow of the surrounding text. This markup is recognized through specific pairs that are interpreted by processors like Docutils, ensuring that inline are delimited by whitespace or to avoid ambiguity. The system supports nine primary inline constructs, processed in a specific order to handle overlaps correctly, such as treating potential emphasis markers as literal text when appropriate. Emphasis is applied using single asterisks for italicized text, surrounding the phrase like emphasized text. Strong emphasis, typically rendered as bold, uses double asterisks, as in strong text. These must be bounded by whitespace or punctuation, and the content between delimiters cannot contain unescaped instances of the same delimiter to prevent misinterpretation. For inline literal text, often displayed in a monospaced font to represent or fixed-width content, double backticks are used: literal text. This prevents further markup processing within the literals, ensuring exact reproduction. Hyperlinks in reST can be explicit or implicit, facilitating both external and internal navigation. An explicit hyperlink combines display text with a URL using backticks and an underscore, such as Python website`_<https://www.python.org>`_.[](https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#explicit-hyperlink-targets) This defines both the visible phrase and the target in one inline element. Implicit hyperlinks rely on predefined targets; for instance, a phrase like Python_`` links to a prior explicit target defined as .. _Python: https://www.python.org`.[](https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#implicit-hyperlink-targets) Reference names for these targets are case-insensitive and normalized for whitespace, consisting of alphanumeric characters, isolated hyphens, underscores, periods, colons, or plus signs, or backquoted phrases for more complex identifiers. Standalone hyperlinks, like raw URLs (e.g., https://www.python.org), are automatically recognized and linked without additional markup. Substitution references enable reusable inline content through vertical bars, allowing dynamic replacement with elements like images or formatted text defined via directives. The syntax is |substitution|, where the label inside the bars corresponds to a definition such as .. |substitution| replace:: This is replaced text. These can also incorporate hyperlinks by appending an underscore, like |substitution|_, linking to a target after substitution. Only inline-compatible directives, such as image or replace, are permitted for substitutions to maintain text flow. Character-level escapes using a () allow literal rendering of markup characters within text, preventing unintended interpretation. For example, to display an without triggering emphasis, write *emphasized*. Escaping whitespace with a backslash removes both the backslash and the space from the output, enabling markup adjacent to punctuation, as in Python``list``\s to produce "Python lists" with "list" as literal. A literal itself requires doubling: \. Footnotes and citations provide inline referencing for annotations, using bracketed labels followed by an underscore. A manual footnote reference appears as , linking to a definition like .. [1] This is the footnote text.. Auto-numbered footnotes use [#], which processors assign sequential numbers starting from 1, while auto-symbolic ones employ [*], using symbols like *, †, and ‡. Citations follow a similar pattern with textual labels, such as [CIT2002], defined as .. [CIT2002] Citation details., and are rendered separately from footnotes. These share the reference namespace with hyperlinks, ensuring unique identifiers. reST enforces strict rules for inline markup interpretation and nesting to ensure predictable parsing. Markup elements cannot nest; for instance, outer inner is invalid and treated as literal. Recognition prioritizes constructs in order: inline internal targets, footnotes/citations, substitutions, and then emphasis/literals, with backslashes overriding potential markup. Delimiters require non-whitespace adjacency, and optional character-level mode (via ) allows markup without whitespace boundaries for denser text.

Block Structural Elements

reStructuredText (reST) employs block-level elements to structure documents hierarchically and semantically, enabling the organization of content into logical units such as sections, lists, and tables. These constructs form the foundational body elements, allowing authors to delineate paragraphs, impose structure on data, and embed quotations without relying on higher-level directives. Unlike inline markup, which affects individual words or phrases, block elements operate on entire lines or groups of lines to create a document's overall architecture. Paragraphs in reST are the simplest , formed implicitly by blocks of left-aligned text lines separated by one or more blank lines. Each paragraph must maintain consistent indentation, with lines wrapping naturally, and no special delimiters are required. For instance, consecutive lines of text without blanks constitute a single , while a blank line signals the start of a new one. This implicit formation promotes in sources. Line blocks, denoted by lines prefixed with a (|), preserve exact line breaks and indentation, making them suitable for or addresses where must be maintained . Continuation lines in line blocks are indented further, and the block terminates with a blank line or the end of the document. Headings establish the document's sectional hierarchy using underline styles composed of non-alphanumeric 7-bit ASCII characters, such as equals signs (=) for top-level sections or hyphens (-) for subsections. The underline must extend at least to the right edge of the heading text and can optionally include a matching for emphasis, though overline-and-underline combinations are reserved for the highest levels to avoid confusion. Hierarchy is determined by the sequence of underline styles encountered in the document, not by a rigid character assignment, allowing flexibility while enforcing consistency within a file. For example:
This is a top-level heading
============================

This is a subsection
--------------------
Blank lines before or after headings are optional, and each generates an implicit hyperlink target named after the section title. Lists provide mechanisms for enumerating or itemizing content, with bulleted lists initiated by *, +, or - followed by whitespace, and subsequent items following the same pattern at the same indentation level. Enumerated lists use auto-numbered formats like 1., (a), or #. (for automatic numbering), requiring consistent enumerator styles and sequences within the list, such as or lowercase letters. Definition lists pair one-line terms with indented classifiers or definitions, without a blank line between the term and its body, resembling dictionary entries. All list types necessitate a blank line before the first item and proper relative indentation for bodies, which may themselves contain nested lists or paragraphs. An example of a mixed list structure is:
- Bulleted item
  - Nested bullet

1. First enumerated
2. Second enumerated

Term
    Definition text.
These rules ensure lists are compact yet extensible. Tables in reST support tabular data through grid tables, which use with pipes (|) for columns, plus signs (+) for junctions, and equals signs (=) or hyphens (-) for separators, allowing row and column spans via adjusted cell borders. Simple tables offer a less rigid alternative, employing column separators aligned with equals signs for headers and hyphens for body rows, limited to two or more columns without spans. Both require blank lines before and after the table, with cells containing reST content. CSV tables, while possible via directives, are not core block elements here. A basic grid table example appears as:
+----------+----------+
| Header 1 | Header 2 |
+==========+==========+
| Cell 1   | Cell 2   |
+----------+----------+
This format facilitates precise alignment in plain text while rendering to structured outputs. Blockquotes and literal blocks handle indented or verbatim content. Blockquotes are created by indenting text relative to the surrounding paragraph, often with a leading greater-than sign (>) for explicit quoting, and may include an attribution line flush-left with -- or an em dash. They require blank lines for delimitation and can nest. Literal blocks follow a paragraph ending in double colon (::), with subsequent indented lines treated as unprocessed text, preserving whitespace and line breaks; alternatively, quoted literal blocks use :: followed by lines starting with >. These elements are ideal for citations or code snippets, as in:
An example quote::

    > "This is quoted text."
    
    -- Attributor
Blank lines are mandatory before and after to isolate the block.

Directives and Roles

Directives in reStructuredText provide an extensible mechanism for embedding specialized content and behaviors within documents, allowing authors to insert elements like images or tables that extend beyond basic markup. The syntax for a directive begins with two periods followed by the directive type, double colons, optional arguments, a field list of options, and indented content if applicable: .. directive-type:: [arguments]\n [options]\n [content]. This structure builds upon fundamental block elements, such as paragraphs, by introducing named, customizable constructs. Common directives include the image directive, which embeds an image from a URI with options for alignment, scaling, and alternate text: .. image:: picture.png\n :alt: Alternate text\n :align: [center](/page/Center). The figure directive extends this by adding a caption and around the image: .. figure:: picture.png\n :align: [center](/page/Center)\n\n This is the figure caption.. For document navigation, the contents directive generates a with customizable depth and backlinks: .. contents:: [Table of Contents](/page/Table_of_contents)\n :depth: 2\n :backlinks: top. Admonition directives, such as note or warning, create highlighted blocks for emphasis: .. [note](/page/Note):: This is a [note](/page/Note) admonition.\n\n Body content here., with predefined types including attention, caution, danger, error, hint, important, tip, and warning. The include directive incorporates external files: .. include:: external.txt\n :encoding: [utf-8](/page/UTF-8), supporting options for literal inclusion or code highlighting. Finally, the raw directive passes through verbatim content in specified formats like or : .. raw:: [html](/page/HTML)\n\n <p>Raw [HTML](/page/HTML) paragraph</p>. Roles enable inline customization of text interpretation, marking phrases with semantic meaning or formatting without disrupting paragraph flow. The syntax uses backquotes around the text, optionally prefixed by a role name: :role:textortext:role:. By default, unmarked interpreted text assumes the title-reference role for book or article titles. Common roles include :math:, which denotes mathematical expressions in notation: :math:E = mc^2``, rendering as inline math. The :pep: role (alias for pep-reference) creates hyperlinks to Python Enhancement Proposals by number: :pep:8` links to PEP 8. Substitution definitions allow reusable content via named references, defined as directives and invoked inline with vertical bars: |name|. For example, .. |logo| image:: logo.png\n :width: 100\n\n The logo image. enables substitution as |logo| anywhere in the text, supporting directives like image, replace for text substitution, unicode for symbols, and date for timestamps. Directives enforce validation rules for arguments and content to ensure parseability; required arguments, such as the for image, must be provided, while optional ones like options follow a field list format with unrecognized entries ignored. Content is parsed according to the directive's type—e.g., admonitions expect body elements like paragraphs—and invalid structures trigger system messages for errors or warnings during processing.

Implementation

Docutils Reference Parser

The Docutils project serves as the for reStructuredText (reST), providing a Python-based that processes markup into structured document representations and various output formats. It consists of components including a parser for interpreting reST syntax, writers for generating outputs such as or , and a frontend that orchestrates the overall processing. This modular design allows Docutils to function as a flexible system for documentation workflows, emphasizing extensibility through plugins and custom components. The processing pipeline in Docutils begins with parsing the input reST source into a Document Object Model (DOM)-like structure known as the doctree, represented as an (AST) of nodes. The docutils.parsers.rst.Parser module handles this initial stage, analyzing the markup to construct the node tree using classes defined in docutils.nodes, such as document, paragraph, and section. Subsequent transformations are applied via the docutils.transforms module, where visitor patterns modify the tree for tasks like resolving references or correcting structure, ensuring the doctree adheres to semantic rules before output. Finally, a selected writer traverses the transformed tree to produce the desired format, such as HTML via docutils.writers.html4css1 or LaTeX via docutils.writers.latex. Configuration of the Docutils pipeline is facilitated through command-line tools like rst2html.py, which convert reST files to , or via configuration files such as docutils.conf for specifying options like input encoding or stylesheet paths. These tools leverage the frontend in docutils.frontend to apply settings, enabling customization without code changes. As of November 2025, the latest stable release is version 0.22.3, which includes enhancements to error reporting—such as downgrading certain section title warnings from severe to error level—and improved support, including a default input encoding of for better handling of international text.

Supporting Tools and Standards

reStructuredText employs the MIME type text/x-rst for in various environments. Additionally, the IANA-registered MIME type text/prs.fallenstein.rst, established in 2003, serves as the official standard, though it is less commonly used in practice. reStructuredText aligns with , adopted in 2002, which designates it as the standard format for docstrings to ensure consistent, readable documentation across the ecosystem. The specification undergoes ongoing refinements through the Docutils project, incorporating updates to markup elements, directives, and error handling to maintain compatibility and extensibility. Auxiliary tools extend reStructuredText's utility beyond basic parsing. The rst2ansi utility converts documents to ANSI-escaped output for terminal display, facilitating inline rendering in command-line interfaces. For integration, the numpydoc Sphinx extension processes reStructuredText-formatted docstrings according to NumPy conventions, enabling specialized documentation generation for scientific computing libraries. Validators such as rstcheck analyze syntax and nested code blocks, providing error detection for document integrity during development. Interoperability is supported through editor integrations and linters. Vim features modes like vim-rst for and folding, aiding efficient editing of reStructuredText files. Emacs offers rst-mode, which includes keybindings for section management, list handling, and region manipulation to streamline authoring. Linters including restructuredtext-lint enforce style and syntax rules, integrating into workflows for automated validation. From 2020 to 2025, enhancements to in reStructuredText outputs have advanced through Sphinx extensions, aligning with WCAG 2.1 guidelines. For instance, the PyData Sphinx Theme implements color contrast adjustments for interactive elements to meet WCAG AA and AAA levels, improving compatibility and keyboard navigation in generated documentation.

Applications

Documentation Ecosystems

reStructuredText (reST) has been integral to Sphinx since its in , serving as the default plaintext markup language for generating in projects such as and . Sphinx leverages to produce rich, cross-referenced outputs like , PDF, and , enabling automatic extraction of docstrings via extensions like autodoc for . Recent developments, including the planned Sphinx 8.3.0 release in 2025, enhance compatibility with Docutils 0.22 and support hybrid workflows through the Parser extension, allowing seamless mixing of and in projects. Read the Docs, a popular open-source hosting platform, provides dedicated builders for reST-based projects using Sphinx, automating the compilation of .rst files into hosted documentation sites. It integrates directly with repositories, triggering builds on commits to generate and deploy documentation without manual intervention, which streamlines maintenance for collaborative workflows. Other documentation generators have adopted , with Pydoctor emerging as a modern static analysis tool that supports markup for API docs, primarily to replace the legacy Epydoc system used in projects like Twisted. Epydoc, while foundational, has been largely supplanted due to its outdated features, though it historically parsed for custom directives and graphs in documentation. Modern integrations extend into interactive environments, such as nbsphinx, a Sphinx extension that parses Jupyter notebooks (.ipynb files) and incorporates them into -based documentation, facilitating reproducible examples in computational workflows. reST's plaintext format makes it highly compatible with version control systems like , allowing documentation to be treated as code with diff-friendly changes and collaborative editing. Within Sphinx ecosystems, it enables automatic table-of-contents () generation via directives like .. toctree:: and robust cross-referencing with roles such as :ref: and :py:func:, reducing manual maintenance and improving navigability in large projects. Since 2019, reST adoption has expanded in and documentation, driven by the growth of open-source libraries that rely on Sphinx for structured, versioned outputs; for instance, tools like nbsphinx have enabled reST integration in Jupyter-based ML tutorials, while projects such as maintain comprehensive reST docs for algorithms and APIs. This shift supports scalable workflows in , where reST's semantic markup aids in linking code examples to theoretical explanations.

Broader Software Adoption

reStructuredText (reST) has seen adoption beyond traditional documentation workflows, integrating into core processes, platforms, and hybrid authoring tools, particularly in open-source and enterprise environments. This expansion reflects its robustness for structured content in collaborative settings, where precise markup aids in generating outputs like man pages and build artifacts. A notable example is the project, which transitioned to in July 2016, replacing with Sphinx for processing files into , PDF, and pages. This shift enabled more maintainable, plaintext-based source files under the Documentation directory, with Sphinx handling the conversion. As of 2025, this system remains in active use, supporting ongoing kernel releases and generating pages directly from sources via Sphinx extensions like kernel-doc. Similarly, adopted starting with version 3.0 in 2014, converting its to format and using Sphinx to produce pages and outputs from .rst files. This integration allows projects to embed and generate seamlessly during builds. In and systems, provides an alternative markup for enhanced readability and structure. , an open-source tool, has supported since early versions as a wiki markup option, enabling features like directives and roles alongside traditional wiki syntax. Bitbucket fully parses in README files, rendering them to HTML with support for tables, directives, and links, making it suitable for Python-centric repositories. offers partial support for README.rst files, processing basic syntax to HTML but with limitations on advanced directives compared to . integrates through its wiki and pipelines, with enhanced templates for Sphinx builds introduced in releases around 2023, facilitating automated documentation deployment in workflows. These platforms leverage for cross-project consistency, especially in ecosystems favoring Sphinx-generated outputs. Adoption extends to other languages and tools, such as crates, where parsers like rust-rst enable integration for generation, though primarily via conversions or plugins rather than native mdBook support. Expansions in projects like the and continue to drive broader use, with powering ancillary outputs in build systems. In enterprise settings, tools like rely on for their core , using Sphinx to process .rst files into comprehensive guides and references. From 2020 to 2025, faces competition from 's simplicity in lightweight documentation, particularly in web-focused and quick-start guides, leading to approaches in some tools. However, it sustains prominence in and technical domains requiring complex structures, such as directive-based content and cross-format outputs, as seen in sustained use by and projects. tools like further bolster this by supporting reST as an output format alongside Markdown and Jupyter, enabling multilingual scientific publishing with reST's precise semantics. This trend underscores reST's role in specialized, high-fidelity documentation amid Markdown's general dominance.

Examples

Basic Markup Illustrations

reStructuredText (reST) employs simple plaintext markup to structure documents, transforming them into formatted outputs like through parsers such as Docutils. This section illustrates foundational elements with self-contained examples, showing the source syntax alongside its typical rendered result in for clarity.

Headings and Paragraphs

Headings in reST are created by underlining text with characters, where the underline length matches or exceeds the title length; common choices include equals signs (=) for level-one headings and hyphens (-) for level-two. Paragraphs form naturally from blocks of text separated by blank lines, rendering as standard paragraphs without additional markup. Source:
My Heading
==========

This is a paragraph. It contains [plain text](/page/Plain_text) that flows
naturally, wrapping as needed.
Rendered Output:
<h1>My Heading</h1>
<p>This is a paragraph. It contains [plain text](/page/Plain_text) that flows naturally, wrapping as needed.</p>

Lists and Emphasis

Bulleted lists use markers like hyphens (-), asterisks (*), or plus signs (+) at the start of lines, with indentation for nested items; enumerated lists employ numbers or letters followed by periods. Inline emphasis includes double asterisks (text) for bold (strong), single asterisks (text) for italics (emphasis), and double backticks (text) for inline code or literals. Source:
- First item with **bold** text and `code`.
- Second item:
  - Nested with *italics*.
1. Numbered item.
Rendered Output:
<ul>
<li>First item with <strong>bold</strong> text and <code>code</code>.</li>
<li>Second item:
<ul>
<li>Nested with <em>italics</em>.</li>
</ul>
</li>
</ul>
<ol>
<li>Numbered item.</li>
</ol>
Hyperlinks are formed using inline references like text_ paired with an explicit target .. _text: URL, producing clickable anchors. Images use the .. image:: directive, specifying a path or URL, which renders as an embedded graphic with an alt attribute derived from the directive content if provided. Source:
Visit the `Docutils site`_.

.. _Docutils site: https://docutils.sourceforge.io

.. image:: https://docutils.sourceforge.io/docs/user/rst/images/title.png
   :alt: reST Title
Rendered Output:
Visit the <a href="https://docutils.sourceforge.io">Docutils site</a>.
<img src="https://docutils.sourceforge.io/docs/user/rst/images/title.png" alt="reST Title">

Footnotes

Footnotes employ inline markers like text[^label]_ followed by a definition block .. [^label]: Note content, generating superscript links to the note at the document's end. Labels can be numeric, alphabetic, or symbolic, with automatic numbering available. Source:
This sentence has a footnote.[^1]_

[^1]: This is the footnote content.
Rendered Output:
This sentence has a footnote.<sup><a href="#1" id="1">{{grok:render&&&type=render_inline_citation&&&citation_id=1&&&citation_type=wikipedia}}</a></sup>
(At bottom:) <hr>
<div class="footnote"><p>[<a href="#1">1</a>] This is the footnote content.</p></div>

Advanced Feature Demonstrations

reStructuredText's advanced features enable the creation of dynamic, modular, and -rich documents through sophisticated directives and roles, extending its utility in professional workflows. These elements allow for automated content generation, external integrations, and precise formatting control, making reST suitable for complex reports, manuals, and publications. Demonstrations here focus on practical combinations that leverage extensibility, such as automatic generation and embedded , often processed by tools like Docutils or Sphinx for output in , PDF, or formats. The contents directive automates the generation of a (TOC) based on document headings, supporting nested sections for hierarchical navigation. For instance, the syntax .. contents:: Table of Contents :depth: 2 produces a TOC limited to two levels, rendering as an indented list or structure in output formats; options like :backlinks: entry add hyperlinks from headings back to TOC entries, enhancing usability in long . In a with nested headings—such as a top-level section followed by subsections—this directive outputs a like:
  • Main Section
    • Subsection 1
    • Subsection 2
This feature is particularly extensible in Sphinx, where it integrates with global TOCs for multi-file projects. Roles and substitutions provide inline customization, with the math role enabling mathematical expressions via syntax. The markup :math:E = mc^2`` inserts an inline , rendered by MathJax for web outputs or for PDF, displaying as E = mc^2 without requiring full math blocks. Substitutions extend this by defining reusable elements, such as .. |logo| image:: /images/logo.png :width: 100px, which allows |logo| to embed the inline, supporting or raster formats for consistent branding across documents. These render seamlessly in as interactive elements or in PDF as static embeds, demonstrating reST's balance of simplicity and expressiveness. The include and raw directives facilitate modular content assembly and direct format passthrough, ideal for maintaining large-scale documents. Using .. include:: other.rst :start-after: Section Start :end-before: Section End, external content from other.rst is merged and parsed as , allowing selective inclusion of sections for versioned reports; the :literal: option treats it as code for verbatim display. Complementarily, .. raw:: html :file: snippet.html embeds HTML verbatim, bypassing parsing for custom elements like interactive widgets, resulting in merged outputs where the included reST flows naturally into the host document while raw sections appear as native HTML in web builds. This combination supports hybrid workflows, such as embedding responses or previews without markup interference. Admonitions and advanced tables add structured warnings and data presentation, with customizable options for emphasis and dynamism. The warning admonition, invoked as .. warning:: Critical Alert :class: custom-warning, creates an offset block titled "Warning!" containing the body text, rendered as a highlighted sidebar in HTML or a boxed note in PDF; the :class: option applies CSS styling for themed outputs. For tables, the csv-table directive parses comma-separated values dynamically: .. csv-table:: Product Inventory :header: "Item,Price,Stock" :widths: 30, 20, 20 "Widget A,15.99,50" "Widget B,22.50,30", generating a responsive grid with aligned columns, suitable for importing from external CSV files via :file: data.csv. This renders as a clean, bordered table in outputs, enabling data-driven documentation without manual HTML. A full document snippet combining these elements illustrates a mini-report on project metrics:
Project Metrics Report
======================

.. contents:: Report Contents
   :depth: 2
   :backlinks: top

Overview
--------

This report summarizes key findings. For details, see :math:`E = mc^2` as a placeholder equation.

|logo|

.. include:: metrics_data.rst
   :start-line: 5

.. csv-table:: Performance Data
   :header: "Metric,Value,Unit"
   :align: center

   "Speed,120,km/h"
   "Efficiency,85,%"

.. warning:: Data is preliminary; verify sources.

.. raw:: html

   <div class="chart">Embedded visualization here.</div>
In output via Sphinx, this renders with a navigable , inline , substituted image, included parsed content, centered table, styled warning block, and raw div for custom charts; PDF via shows the equation typeset, table in a , and as a framed note.

References

  1. [1]
    reStructuredText - Docutils
    Sep 13, 2025 · reStructuredText is an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax and parser system. It is useful for in-line program documentation.Quick reStructuredText · A ReStructuredText Primer · Introduction · Markup
  2. [2]
    An Introduction to reStructuredText - Docutils - SourceForge
    reStructuredText is an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax and parser system. It is useful for inline program documentation.
  3. [3]
    History of reStructuredText - Docutils
    reStructuredText is based on StructuredText and Setext. It was modified from StructuredText, with a first draft in 2000, and merged into Docutils in 2002.
  4. [4]
    reStructuredText Markup Specification - Docutils - SourceForge
    reStructuredText is plaintext using simple constructs to indicate document structure, applicable to documents of any length, and is structured into sections.
  5. [5]
    reStructuredText Directives - Docutils
    This document describes the directives implemented in the reference reStructuredText parser. Directives have the following syntax:<|control11|><|separator|>
  6. [6]
    A ReStructuredText Primer - Docutils - SourceForge
    This document is an informal introduction to reStructuredText. The What Next? section below has links to further resources, including a formal reference.
  7. [7]
    PEP 258 – Docutils Design Specification | peps.python.org
    May 31, 2001 · This PEP documents design issues and implementation details for Docutils, a Python Docstring Processing System (DPS).<|control11|><|separator|>
  8. [8]
    Copying Docutils - SourceForge
    Nov 10, 2024 · Most of the files included in this project have been placed in the public domain, and therefore have no license requirements and no restrictions ...
  9. [9]
    Docutils: Documentation Utilities
    Docutils is an open-source text processing system for processing plaintext documentation into useful formats, such as HTML, LaTeX, man-pages, OpenDocument, or ...Docutils Project... · reStructuredText · The Docutils Version RepositoryMissing: architecture pipeline modules
  10. [10]
    A Record of reStructuredText Syntax Alternatives - Docutils
    The following are ideas, alternatives, and justifications that were considered for reStructuredText syntax, which did not originate with Setext or ...
  11. [11]
    PEP 287 – reStructuredText Docstring Format | peps.python.org
    Mar 25, 2002 · This PEP proposes that the reStructuredText markup be adopted as a standard markup format for structured plaintext documentation in Python docstrings.
  12. [12]
    reStructuredText - Wikipedia
    reStructuredText (RST, ReST, or reST) is a file format for textual data used primarily in the Python programming language community for technical documentation.
  13. [13]
    Docutils History - SourceForge
    ... Docutils history, see the reStructuredText HISTORY and the DPS HISTORY files. General changes: renamed 'dps' package to 'docutils'; renamed 'restructuredtext ...
  14. [14]
    reStructuredText — Sphinx documentation
    reStructuredText (reST) is the default plaintext markup language used by both Docutils and Sphinx. Docutils provides the basic reStructuredText syntax.
  15. [15]
    Docutils Release Notes
    This document summarizes the major changes in previous and upcoming releases. For a more detailed list of changes, please see the Docutils HISTORY.
  16. [16]
    Changelog — Sphinx documentation
    Prior releases¶ · Sphinx 8.2 · Release 8.2.3 (released Mar 02, 2025) · Sphinx 8.1 · Release 8.1.3 (released Oct 13, 2024) · Sphinx 8.0 · Release 8.0.2 (released ...
  17. [17]
    reStructuredText Markup Specification
    ### Summary of Inline Markup from reStructuredText Specification
  18. [18]
  19. [19]
  20. [20]
  21. [21]
  22. [22]
  23. [23]
  24. [24]
  25. [25]
  26. [26]
    reStructuredText Markup Specification
    ### Summary of Substitution References in reStructuredText
  27. [27]
  28. [28]
  29. [29]
  30. [30]
  31. [31]
  32. [32]
  33. [33]
  34. [34]
  35. [35]
  36. [36]
  37. [37]
  38. [38]
  39. [39]
  40. [40]
  41. [41]
  42. [42]
  43. [43]
  44. [44]
  45. [45]
  46. [46]
  47. [47]
  48. [48]
  49. [49]
    reStructuredText Interpreted Text Roles - Docutils - SourceForge
    This document describes the interpreted text roles implemented in the reference reStructuredText parser. Interpreted text uses backquotes (`) around the text.
  50. [50]
  51. [51]
  52. [52]
  53. [53]
  54. [54]
  55. [55]
    Docutils Hacker's Guide
    Overview of the Docutils Architecture. To give you an understanding of the Docutils architecture, we'll dive right into the internals using a practical example.Missing: pipeline modules
  56. [56]
  57. [57]
    Docutils FAQ (Frequently Asked Questions)
    ### Summary of reStructuredText's License or Public Domain Status
  58. [58]
    https://www.iana.org/assignments/media-types/text/...
    Encoding considerations : 8bit This media type may require encoding on transports not capable of handling 8 bit text. Security considerations : ReStructuredText ...
  59. [59]
  60. [60]
    Style guide — numpydoc v1.10.0rc0.dev0 Manual - Read the Docs
    This document describes the syntax and best practices for docstrings used with the numpydoc extension for Sphinx.Missing: roman | Show results with:roman
  61. [61]
    rstcheck/rstcheck: Checks syntax of reStructuredText and ... - GitHub
    Checks syntax of reStructuredText and code blocks nested within it. See the full documentation at read-the-docs
  62. [62]
    habamax/vim-rst: vim reStructuredText syntax and some more - GitHub
    vim-rst: reStructuredText for Vim. Installation: Clone to the ~/.vim/pack/plugins/start/vim-rst where plugins is an arbitrary directory name inside /pack.Missing: mode | Show results with:mode
  63. [63]
    Emacs Support for reStructuredText - Docutils
    rst-mode automatically binds several keys for invoking special functions for editing reStructuredText. Since rst-mode contains a lot of functionality most key ...Emacs Support for ...
  64. [64]
    twolfson/restructuredtext-lint - GitHub
    Lint reStructuredText files. Returns 0 if all files pass linting, 1 for an internal error, and 2 if linting failed.
  65. [65]
    Accessibility — PyData Theme 0.16.1 documentation
    We have improved how we assign text colors to interactive elements such as buttons and dropdowns to ensure that they meet WCAG 2 AA or AAA contrast requirements ...Missing: 2020 | Show results with:2020
  66. [66]
    reStructuredText Primer — Sphinx documentation
    reStructuredText is the default plaintext markup language used by Sphinx. This section is a brief introduction to reStructuredText (reST) concepts and syntax.Missing: principles | Show results with:principles
  67. [67]
    reStructuredText markup - Python Developer's Guide
    This document describes the custom reStructuredText markup introduced by Sphinx to support Python documentation and how it should be used.<|control11|><|separator|>
  68. [68]
    Get started with MyST in Sphinx - MyST Parser - Read the Docs
    Activating the MyST parser will simply enable parsing markdown files with MyST, and the rST parser that ships with Sphinx will still work the same way.
  69. [69]
    Read the Docs tutorial
    In the tutorial we will: Import a Sphinx project from a GitHub repository (no prior experience with Sphinx is required). Tailor the project's configuration.
  70. [70]
    Introduction — pydoctor documentation
    - **reStructuredText Usage**: Pydoctor uses reStructuredText for documentation, as confirmed by its Read the Docs hosting and standard formatting.
  71. [71]
    Automatic API Documentation Generation for Python - Epydoc
    The epydoc reStructuredText reader defines several custom directives , which can be used to automatically generate a variety of graphs. The following custom ...Missing: Pydoctor legacy
  72. [72]
    Jupyter Notebook Tools for Sphinx — nbsphinx version 0.9.7-5-gb743009
    **Summary of nbsphinx Integration of reST with Jupyter Notebooks in Sphinx:**
  73. [73]
    Project documentation with reStructuredText and Sphinx
    Feb 2, 2018 · This post will show my favorite, reStructuredText with Sphinx. It will list the capabilities I usually need when documenting, and how to do it with the ...
  74. [74]
  75. [75]
    Cross-references — Sphinx documentation
    One of Sphinx's most useful features is creating automatic cross-references through semantic cross-referencing roles.Missing: workflow benefits control
  76. [76]
    Kernel development - LWN.net
    Nov 1, 2016 · The 2016 Linux Kernel Summit was held October 31 to November 2 in ... Sphinx documentation generator, which uses the reStructuredText markup ...
  77. [77]
    Using Sphinx for kernel documentation
    The Linux kernel uses Sphinx to generate pretty documentation from reStructuredText files under Documentation. To build the documentation in HTML or PDF ...
  78. [78]
    CMake 3.0.0 Release Notes - Documentation
    The CMake documentation has been converted to reStructuredText and now transforms via Sphinx (http://sphinx-doc.org) into man and html pages.
  79. [79]
    WikiRestructuredText - The Trac Project - Edgewall Software
    May 26, 2020 · This page documents the 1.4 (latest stable) release. ... The examples will only be rendered as reStructuredText if docutils is installed.
  80. [80]
    README content | Bitbucket Cloud - Atlassian Support
    Format your Readme with markup. Bitbucket can parse and display Markdown, reStructuredText, Textile, and plain text README files. With a syntax like Markdown, ...
  81. [81]
    DevDungeon/reStructuredText-Documentation-Reference - GitHub
    May 30, 2020 · There are two primary tools for converting reStructuredText in to finished products. First, there is docutils which is contains the core parser ...
  82. [82]
    flying-sheep/rust-rst: a reStructuredText parser and renderer - GitHub
    A library able to convert reStructuredText and Docutils XML to both each other and HTML5. Currently it can convert a subset of rST (eg this README) to HTML5.Missing: 2022 | Show results with:2022<|separator|>
  83. [83]
    Ansible documentation style guide
    reStructuredText guidelines . The Ansible documentation is written in reStructuredText and processed by Sphinx. We follow these technical or mechanical ...
  84. [84]
    I Prefer RST to Markdown (2024) - Hacker News
    Aug 18, 2025 · reStructuredText and Markdown both have a bad habit of clevernesses that fall down—just in different areas. Both do at least some degree of ...Missing: competition trends 2020-2025 enterprise adoption<|control11|><|separator|>
  85. [85]
    Contributing to the Ansible Documentation
    You do not have to be a programmer, since most of our documentation is written in YAML (module documentation) or reStructuredText (rST). Some collection-level ...
  86. [86]
    reStructuredText Options - Quarto
    reStructuredText is an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax and parser system. It is useful for in-line program documentation.Missing: hybrid | Show results with:hybrid
  87. [87]
    Quick reStructuredText - Docutils
    reStructuredText supports inline markup for styles, section structure, paragraphs, lists, definition lists, field lists, option lists, literal blocks, and more.
  88. [88]
  89. [89]
  90. [90]
    reStructuredText Demonstration
    ### Summary of Combined reST Features (Mini-Report Example)
  91. [91]