Sphinx style demo

See sphinx-better-theme: usable documentation for the table of contents. Reproducing it here would make Sphinx mad.

Feel free to open Github issues about the specifics of the styles on this page.

Paragraph-level markup

note, warning

Note

This is a note. It can have monospaced text.

Warning

This is a note. monospaced text.

versionadded, deprecated

New in version 0.1: Some stuff added in a version.

Deprecated since version 0.1: Some stuff deprecated in a version.

seealso

See also

mrjob
Another awesome open source project
Buildy
A cool online game

rubric

A paragraph heading that is not used to create a TOC node

centered

LICENSE AGREEMENT

hlist

  • A list of
  • short items
  • that should be
  • displayed
  • horizontally

Misc

glossary

glossary
A directive that contains a definition list with terms and definitions. The definitions will then be referencable with the term role.
term
A string defined in the glossary.

Here we reference the glossary term.

productionlist

try_stmt  ::=  try1_stmt | try2_stmt
try1_stmt ::=  "try" ":" suite
               ("except" [expression ["," target]] ":" suite)+
               ["else" ":" suite]
               ["finally" ":" suite]
try2_stmt ::=  "try" ":" suite
               "finally" ":" suite

Showing code examples

Double colon

Here is some unhighlighted code:

old pond...
a frog leaps in
water’s sound

code-block

Line numbers with the second line emphasized:

1
2
if True:
    print "This is some Python"

No line numbers:

if True:
    print "This is some Python"

Tables

This is a table
1 2 3 4
5 6 7 8

Inline markup

References

A link to the above heading

A link to the index document

Download this demo (demo.rst)

ENV_VAR

token

--option <option>

Description of option.

--option, --option-without-ref

term (see Glossary for an example with a link)

Other semantic markup

abbr (hover)

command is an OS-level command.

dfn is the defining instance of a term in the text.

/a/file/path/variable/more

GUI control label

Control-x Control-f (keystroke sequence)

Content-Type (mail header)

MAKE_VAR

manpage(1)

Menu ‣ Selection

mime/type

Usenet newsgroup (wat?)

Name of an executable program (not just :command: for some reason?)

unquoted?regular*[expression]

A piece of literal text with variables

PEP 8

RFC 1072

Substitutions

Release 0.1.5, version 0.1.5, today Sep 08, 2018

Python

py_module

py_func(arg, a_long_argument=with_a_default, foo=bar, baz=qux, more=more, args=args, for=for, wrapping=wrapping)

A Python function definition.

py_func(), py_func_no_ref()

class PyClass(arg)
py_method(arg)

PyClass, PyClassNoRef, PyClass.py_method(), py_method_no_ref()