reStructuredText (RST, ReST, or reST) is a file format for textual data used primarily in the
Python programming language
Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation.
Python is dynamically-typed and garbage-collected. It supports multiple programming par ...
community for
technical documentation
Technical documentation is a generic term for the classes of information created to describe (in technical language) the use, functionality or architecture of a product, system or service.
Classes of technical documentation
Classes of technical do ...
.
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
Javadoc (originally cased JavaDoc) is a documentation generator created by Sun Microsystems for the Java language (now owned by Oracle Corporation) for generating API documentation in HTML format from Java source code. The HTML format is used ...
for
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
or
Plain Old Documentation
Plain Old Documentation (pod) is a lightweight markup language used to document the Perl programming language as well as Perl modules and programs.
Design
Pod is designed to be a simple, clean language with just enough syntax to be useful. It pu ...
(POD) for
Perl
Perl is a family of two High-level programming language, high-level, General-purpose programming language, general-purpose, Interpreter (computing), interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it ...
. Docutils can extract comments and information from Python programs, and format them into various forms of program documentation.
In this sense, reStructuredText is a
lightweight markup language
A lightweight markup language (LML), also termed a simple or humane markup language, is a markup language with simple, unobtrusive syntax. It is designed to be easy to write using any generic text editor and easy to read in its raw form. Lightwei ...
designed to be both (a) processable by documentation-processing software such as Docutils, and (b) easily readable by human programmers who are reading and writing Python
source code
In computing, source code, or simply code, is any collection of code, with or without comment (computer programming), comments, written using a human-readable programming language, usually as plain text. The source code of a Computer program, p ...
.
History
reStructuredText evolved from an earlier lightweight markup language called StructuredText (developed by
Zope). There were a number of problems with StructuredText, and reST was developed to address them.
The name reStructuredText was chosen to indicate that reST is a "revised, reworked, and reinterpreted StructuredText."
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
Javadoc (originally cased JavaDoc) is a documentation generator created by Sun Microsystems for the Java language (now owned by Oracle Corporation) for generating API documentation in HTML format from Java source code. The HTML format is used ...
formats were also considered for inclusion in the design.
reST began to see significant use in the Python community in 2002.
Reference implementation
The reference implementation of the reST
parser
Parsing, syntax analysis, or syntactic analysis is the process of analyzing a string of symbols, either in natural language, computer languages or data structures, conforming to the rules of a formal grammar. The term ''parsing'' comes from Lati ...
is a component of the Docutils text processing framework in the
Python programming language
Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation.
Python is dynamically-typed and garbage-collected. It supports multiple programming par ...
, but other parsers are available.
There is no official
MIME type
A media type (also known as a MIME type) is a two-part identifier for file formats and format contents transmitted on the Internet. The Internet Assigned Numbers Authority (IANA) is the official authority for the standardization and publication o ...
registered for reStructuredText, but the unofficial one is
text/x-rst
.
Applications
reStructuredText is commonly used for technical documentation, for example, in documentation of Python libraries. However, it is suitable for a wide range of texts.
Since 2008, reST has been a core component of Python's
Sphinx
A sphinx ( , grc, σφίγξ , Boeotian: , plural sphinxes or sphinges) is a mythical creature with the head of a human, the body of a lion, and the wings of a falcon.
In Greek tradition, the sphinx has the head of a woman, the haunches o ...
document generation system.
Trac also supports reStructuredText, as do
GitHub
GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, co ...
and
Bitbucket
Bitbucket is a Git-based source code repository hosting service owned by Atlassian. Bitbucket offers both commercial plans and free accounts with an unlimited number of private repositories.
Services Bitbucket Cloud
Bitbucket Cloud (previo ...
.
In 2011,
Distributed Proofreaders
Distributed Proofreaders (commonly abbreviated as DP or PGDP) is a web-based project that supports the development of e-texts for Project Gutenberg by allowing many people to work together in proofreading drafts of e-texts for errors. As of Marc ...
, which prepared texts for
Project Gutenberg
Project Gutenberg (PG) is a volunteer effort to digitize and archive cultural works, as well as to "encourage the creation and distribution of eBooks."
It was founded in 1971 by American writer Michael S. Hart and is the oldest digital li ...
, was considering adoption of reST as a basic format from which other ebook formats could be generated.
In July 2016 the
Linux kernel
The Linux kernel is a free and open-source, monolithic, modular, multitasking, Unix-like operating system kernel. It was originally authored in 1991 by Linus Torvalds for his i386-based PC, and it was soon adopted as the kernel for the GNU ...
project decided to transition from
DocBook
DocBook is a semantic markup language for technical documentation. It was originally intended for writing technical documents related to computer hardware and software, but it can be used for any other sort of documentation.
As a semantic languag ...
based documentation to reStructuredText and the
Sphinx
A sphinx ( , grc, σφίγξ , Boeotian: , plural sphinxes or sphinges) is a mythical creature with the head of a human, the body of a lion, and the wings of a falcon.
In Greek tradition, the sphinx has the head of a woman, the haunches o ...
toolchain.
The software build tool
CMake
In software development, CMake is cross-platform free and open-source software for build automation, testing, packaging and installation of software by using a compiler-independent method. CMake is not a build system itself; it generates ano ...
switched from a custom markup language to reStructuredText in version 3.0 for its documentation.
Examples
See also
*
Comparison of document-markup languages The following tables compare general and technical information for a number of document markup languages. Please see the individual markup languages' articles for further information.
General information
Basic general information about the marku ...
*
Comparison of documentation generators
The following tables compare general and technical information for a number of documentation generators. Please see the individual products' articles for further information. Unless otherwise specified in footnotes, comparisons are based on the ...
*
Comparison of note-taking software
The tables below compare features of notable note-taking software.
General information
Basic features
Advanced formatting and content
See also
* Comparison of text editors
* Comparison of web annotation systems
* Comparison of wiki soft ...
References
External links
Official reStructuredText website with reference pages
{{Document markup languages
Lightweight markup languages