Last active
February 3, 2020 16:43
-
-
Save elowy01/e20f86e7912c29179a04b5f8b543fbd8 to your computer and use it in GitHub Desktop.
reStructuredText cheat sheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reStructuredText (RST, ReST, or reST) is a file format for textual data used primarily in the Python programming language community for technical documentation. | |
// | |
#inline code block | |
This is an inline code block ``hello``. Yes | |
// | |
# Literal blocks | |
# The literal blocks need a blank line just before the literal block, also it needs to be indented. It requires another | |
# blank line after the literal block | |
This is a normal text paragraph. The next paragraph is a code sample:: | |
It is not processed in any way, except | |
that the indentation is removed. | |
It can span multiple lines. | |
This is a normal text paragraph again. | |
// | |
#strong emphasis (boldface) | |
**text** | |
// | |
#Link to a external resource (note the _ at the end) | |
`Link text <https://domain.invalid/>`_ | |
// | |
Sections | |
(quickref) | |
To break longer text up into sections, you use section headers. These are a single line of text (one or more words) with adornment: an underline alone, or an underline and an overline together, in dashes "-----", equals "======", tildes "~~~~~~" or any of the non-alphanumeric characters = - ` : ' " ~ ^ _ * + # < > that you feel comfortable with. An underline-only adornment is distinct from an overline-and-underline adornment using the same character. The underline/overline must be at least as long as the title text. Be consistent, since all sections marked with the same adornment style are deemed to be at the same level: | |
Chapter 1 Title | |
=============== | |
Section 1.1 Title | |
----------------- | |
Subsection 1.1.1 Title | |
~~~~~~~~~~~~~~~~~~~~~~ | |
Section 1.2 Title | |
----------------- | |
Chapter 2 Title | |
=============== | |
// | |
# Introducing a new line (notice the whitespace after "|"): | |
| Lend us a couple of bob till Thursday. | |
| I'm absolutely skint. | |
| But I'm expecting a postal order and I can pay you back | |
as soon as it comes. | |
| Love, Ewan. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment