Sphinx Cheat Sheet



There are several ways to write tables. Use standard reStructuredText tables as explained here. They work fine in HTML output, however, there are some gotchas when using tables for LaTeX output.

simple table:

Simple tables can be written as follows:

which gives:

1

2

3

complex table:

gives:

Header 1

Header 2

Header 3

body row 1

column 2

column 3

body row 2

Cells may span columns.

body row 3

Cells mayspan rows.

  • Cells
  • contain
  • blocks.

body row 4

another way:

gives:

Inputs

Output

A

B

A or B

False

False

False

True

False

True

Cheat Sheet¶ If you are viewing the online version of this documentation, you can click here for our Security Onion Cheat Sheet. This was based on a cheat sheet originally created by Chris Sanders which can be found here.

  1. ReST & Sphinx cheat sheet ¶. ReST & Sphinx cheat sheet. Every reST (.rst) file should use these underlining styles. In reST, you can use different styles in any order you want. These are our conventions for TYPO3 documentation. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19. DocTitle Then use underlining only:. header1: Header 1 Header 1.1 - Header 1.1.1.
  2. Sphinx cheat sheet¶ Here is a quick and dirty cheat sheet for some common stuff you want to do in sphinx and ReST. You can see the literal source for this sheet here This file. More basic documentation can be found at this resources: Documentation guide; ReST syntax; More advanced topics are.

Note

Sphinx

table and latex documents are not yet compatible in sphinx, and you should therefore precede them with the a special directive (. htmlonly::)

The previous examples work fine in HTML output, however there are some gotchas when using tables in LaTeX: the column width is hard to determine correctly automatically. For this reason, the following directive exists:

This directive gives a “column spec” for the next table occurring in the source file. It can have values like:

which means three left-adjusted (LaTeX syntax). By default, Sphinx uses a table layout with L for every column. This code:

Aol desktop for mac mojave. gives

Sphinx Cheat Sheet
title
simple text23

The rst Cheatsheet covers a wide range ofrst markup. It and its contents are CC licensed .

Cheat

Inline Markup ¶

Inline markup allows words and phrases within text to have character styles (like italics and boldface) and functionality (like hyperlinks).

emphasis

strong emphasis

The rendering and meaning of interpreted textis domain- or application-dependent.

inline literal

inline internal target

The result is substituted in from thesubstitution definition.

footnote reference 1

citation reference [CIT2002]

Escaping with Backslashes ¶

reStructuredText uses backslashes (“') to override the special meaning given to markup characters and getthe literal characters themselves. To get a literal backslash, use an escaped backslash (“”). For example:

escape with “”

*escape* ``with`` “'

Lists ¶

  • This is item 1. A blank line before the firstand last items is required.

  • This is item 2

  • Item 3: blank lines between items are optional.

  • Item 4: Bullets are “-“, “*” or “+”.Continuing text must be aligned after the bulletand whitespace.

  • This list item contains nested items

    • Nested items must be indented to the samelevel

  1. This is the first item

  2. This is the second item

  3. Enumerators are arabic numbers,single letters, or roman numerals

  4. List items should be sequentiallynumbered, but need not start at 1(although not all formatters willhonour the first index).

  5. This item is auto-enumerated

what

Definition lists associate a term witha definition.

how

The term is a one-line phrase, and thedefinition is one or more paragraphs orbody elements, indented relative to theterm. Blank lines are not allowedbetween term and definition.

Authors

Tony J. (Tibs) Ibbs,David Goodger

Version

1.0 of 2001/08/08

Dedication

To my father.

-a

command-line option “a”

-b file

options can have argumentsand long descriptions

--long

options can be long also

--input= file

long options can also havearguments

/V

DOS/VMS-style options too

Section Structure ¶

Title

Titles are underlined (or over- and underlined) witha nonalphanumeric character at least as long as thetext.

A lone top-level section is lifted up to be thedocument’s title.

Any non-alphanumeric character can be used, butPython convention is:

  • # with overline, for parts

  • * with overline, for chapters

  • = , for sections

  • - , for subsections

  • ^ , for subsubsections

  • ' , for paragraphs

Blocks ¶

This is a paragraph.

Paragraphs line up at their leftedges, and are normally separatedby blank lines.

A paragraph containing only two colonsindicates that the following indentedor quoted text is a literal block.

You can also tack the :: at the end of aparagraph:

Per-line quoting can also be used forunindented blocks:

verse, and adornment-free lists.
Each new line begins with a
are preserved.
Continuation lines are wrappedportions of long lines; they beginwith spaces in place of vertical bars.

Block quotes are just:

Indented paragraphs,

Doctest blocks are interactivePython sessions. They begin with“ >>> ” and end with a blank line.

A transition marker is a horizontal lineof 4 or more repeated punctuationcharacters.

A transition should not begin or end asection or document, nor should twotransitions be immediately adjacent.

Sphinx Cheat Sheet Pdf

Tables ¶

There are two syntaxes for tables in reStructuredText. Grid tables are complete but cumbersome to create. Simpletables are easy to create but limited (no row spans, etc.).

Header 1

Header 2

Header 3

body row 1

column 2

column 3

body row 2

Cells may span columns.

Brand building guide. body row 3

Cells mayspan rows.

  • Cells

  • contain

  • blocks.

body row 4

Inputs

Output

A

B

A or B

False

False

False

True

False

True

False

True

True

True

True

True

Explicit Markup ¶

Explicit markup blocks are used for constructs which float (footnotes), have no direct paper-document representation(hyperlink targets, comments), or require specialized processing (directives).They all begin with two periods and whitespace, the “explicit markup start”.

Footnote references, like 5 .Note that footnotes may getrearranged, e.g., to the bottom ofthe “page”.

5

A numerical footnote. Notethere’s no colon after the ] .

Autonumbered footnotes arepossible, like using 1 and 2 .

1

This is the first one.

2

This is the second one.

They may be assigned ‘autonumberlabels’ - for instance, 4 and 3 .

3

a.k.a. third

4

a.k.a. fourth

Auto-symbol footnotes are alsopossible, like this: * and † .

*

This is the first one.

This is the second one.

Citation references, like [CIT2002] .Note that citations may getrearranged, e.g., to the bottom ofthe “page”.

CIT2002 ( 1 , 2 )

A citation(as often used in journals).

Citation labels contain alphanumerics,underlines, hyphens and fullstops.Case is not significant.

Given a citation like [this] , onecan also refer to it like this .

this

here.

External hyperlinks, like Python .

External hyperlinks, like Python .

Internal crossreferences, like example .

This is an example crossreference target.

Python is my favouriteprogramming language .

Titles are targets, too

Implict references, like Titles are targets, too .

Directives are a general-purpose extension mechanism, a way of adding support for new constructs without addingnew syntax. For a description of all standard directives, see reStructuredText Directives ( http://is.gd/2Ecqh ).

For instance:

Substitutions are like inline directives, allowing graphics and arbitrary constructs within text.

The symbol must be used on containers used todispose of medical waste.

Any text which begins with an explicit markup start but doesn’t use the syntax of any of the constructs above, is a comment.

An “empty comment” does notconsume following blocks.(An empty comment is “.” withblank lines before and after.)

So this block is not “lost”,despite its indentation.

Credits ¶

CP Font from LiquiType:

Magnetic Balls V2 image by fdecomite:

Sponsored by Net Managers

Typeset using rst2pdf

Sphinx Cheat Sheet

Riddle Of The Sphinx Cheat Sheets Printable

© 2009 Roberto Alsina <ralsina@netmanagers.com.ar> / Creative Commons Attribution-Noncommercial-Share Alike 2.5 Argentina License

Based on quickref.txt from docutils

Non-Commercial

Share Alike