ReStructuredText

reStructuredText

reStructuredText

Lightweight markup language


reStructuredText (RST, ReST, or reST) is a file format for textual data used primarily in the Python programming language community for technical documentation.

Quick Facts Filename extension, Internet media type ...

It is part of the Docutils project of the Python Doc-SIG (Documentation Special Interest Group), aimed at creating a set of tools for Python similar to Javadoc for Java or Plain Old Documentation (POD) for Perl. Docutils can extract comments and information from Python programs, and format them into various forms of program documentation.[2]

In this sense, reStructuredText is a lightweight markup language designed to be both processable by documentation-processing software such as Docutils, and be easily readable by human programmers who are reading and writing Python source code.

History

reStructuredText evolved from an earlier lightweight markup language called StructuredText[3] (developed by Zope). There were a number of problems with StructuredText, and reST was developed to address them.[4] The name reStructuredText was chosen to indicate that reST is a "revised, reworked, and reinterpreted StructuredText."[5]

Parts of the reST syntax were inspired by the Setext language from the early 1990s. Elements of the common RFC822 Internet Message Format and Javadoc formats were also considered for inclusion in the design.[6]

reStructuredText was first released in June 2001.[1] It began to see significant use in the Python community in 2002.[7]

Reference implementation

The reference implementation of the reST parser is a component of the Docutils text processing framework in the Python programming language, but other parsers are available.

There is no official MIME type registered for reStructuredText, but the unofficial one is text/x-rst.[8]

Applications

reStructuredText is commonly used for technical documentation, for example, in documentation of Python libraries.[9] However, it is suitable for a wide range of texts.

Since 2008, reST has been a core component of Python's Sphinx document generation system.

Trac also supports reStructuredText,[10] as do GitHub and Bitbucket.

In 2011, Distributed Proofreaders, which prepared texts for Project Gutenberg, was considering adoption of reST as a basic format from which other ebook formats could be generated.[11][needs update]

In July 2016 the Linux kernel project decided to transition from DocBook based documentation to reStructuredText and the Sphinx toolchain.[12][13]

The software build tool CMake switched from a custom markup language to reStructuredText in version 3.0 for its documentation.[14]

Examples

More information Text using rST syntax, Corresponding HTML produced by an rST processor ...

See also


References

  1. "Project: reStructuredText - File List". SourceForge. Archived from the original on 19 October 2001. Retrieved 5 February 2023.
  2. Mertz, David (2003-02-01). "XML Matters: reStructuredText". IBM developerWorks. Retrieved 2016-10-05.
  3. "zope.structuredtext Documentation". Read the Docs. Retrieved 2022-08-16.
  4. Goodger, David (2016-05-24). "Problems With StructuredText". Docutils Project. Retrieved 2022-08-16.
  5. Goodger, David (2016-02-26). "Docutils FAQ (Frequently Asked Questions)". Docutils Project. Retrieved 2016-10-05.
  6. Goodger, David (2022-04-02). "A Record of reStructuredText Syntax Alternatives". docutils.sourceforge.io. Docutils Project. Retrieved 2022-08-16.
  7. "Introduction to reStructuredText". Write The Docs. Retrieved 2022-06-25.
  8. Goodger, David (2002-04-02). "PEP 287 -- reStructuredText Docstring Format". Python Software Foundation. Retrieved 2016-10-05.
  9. "reStructuredText Support in Trac". Trac. 2016-09-13. Retrieved 2016-10-05.
  10. Newby, Greg (2011-01-08). "Minutes of 2010 December 11 meeting". Distributed Proofreaders. Retrieved 2011-01-08.
  11. "Kernel documentation with Sphinx, part 1: how we got here". LWN.net. 2016-07-06. Retrieved 2016-10-27.
  12. "Sphinx. Linux kernel". Wikipedia. 2024-04-02. Retrieved 2024-04-02.
  13. "CMake 3.0.0 Release Notes". Kitware, Inc. 2014-06-10. Retrieved 2016-10-05.

Share this article:

This article uses material from the Wikipedia article ReStructuredText, and is written by contributors. Text is available under a CC BY-SA 4.0 International License; additional terms may apply. Images, videos and audio are available under their respective licenses.