Welcome to Sphinx Tests’s documentation!¶
Contents:
1. Extension API tests¶
Testing directives:
from function: Foofrom class: Bar4. Including in subdir¶
print("line 1")
print("line 2")
Absolute /img.png
download.

This is an include file.
6. Test file and literal inclusion¶


# Literally included file using Python highlighting
# -*- coding: utf-8 -*-
foo = "Including Unicode characters: üöä"
class Foo:
pass
class Bar:
def baz():
pass
def bar(): pass
This file is encoded in latin-1 but at first read as utf-8.
Max Strauß aß in München eine Leberkässemmel.
This file is encoded in latin-1 but at first read as utf-8.
Max Strauß aß in München eine Leberkässemmel.
7. Literalinclude options¶
class Foo:
pass
def baz():
pass
6 7 8 | class Foo:
pass
class Bar:
|
foo = "Including Unicode characters: üöä"
START CODE
# Literally included file using Python highlighting
# -*- coding: utf-8 -*-
foo = "Including Unicode characters: üöä"
class Foo:
pass
class Bar:
def baz():
pass
def bar(): pass
END CODE
foo = "Including Unicode characters: üöä"
class Foo:
pass
class Bar:
def baz():
pass
def bar(): pass
# Literally included file using Python highlighting
# -*- coding: utf-8 -*-
foo = "Including Unicode characters: üöä"
--- literal_orig.inc
+++ literal.inc
@@ -1,12 +1,12 @@
# Literally included file using Python highlighting
# -*- coding: utf-8 -*-
-foo = "Including Unicode characters: üöä" # This will be changed
+foo = "Including Unicode characters: üöä"
-class FooOrig:
+class Foo:
pass
-class BarOrig:
+class Bar:
def baz():
pass
Tabs include file test
----------------------
The next line has a tab:
-| |-
Tabs include file test
----------------------
The next line has a tab:
-| |-
6 7 | class Foo:
pass
|
6 7 | class Foo:
pass
|
3 | foo = "Including Unicode characters: üöä"
|
Test if dedenting before parsing works.
def baz():
pass
8. Docutils include with “literal”¶
While not recommended, it should work (and leave quotes alone).
Testing "quotes" in literal 'included' text.
9. Testing various markup¶
9.2. Generic reST¶
A global substitution (the definition is in rst_epilog).
some code
Option list:
-h | help |
--help | also help |
Line block:
9.2.1. Body directives¶
Title
Topic body.
Test rubric
Epigraph title
Epigraph body.
—Author
Highlights
Highlights body.
Pull-quote
Pull quote body.
a
b
with some markup inside
9.2.2. Admonitions¶
My Admonition
Admonition text.
Note
Note text.
Warning
Warning text.
Tip
Tip text.
Indirect hyperlink targets
9.3. Inline markup¶
Generic inline markup
Adding n to test unescaping.
- command\n
- dfn\n
- guilabel with accelerator and \n
kbd\n
- mailheader\n
- makevar\n
- manpage\n
- mimetype\n
- newsgroup\n
- program\n
regexp\n
a/varpart/b\n
print i\n
Linking inline markup
- PEP 8
- Python Enhancement Proposal #8
- RFC 1
- Request for Comments #1
HOME
with
try statement
- Admonitions
- here
- there
- My caption of the figure
- My caption of the figure
- my table
- my table
- my ruby code
- my ruby code
- Fig. 9.1
- Fig. 9.1
- Table 9.1
- Table 9.1
- Listing 9.1
- Listing 9.1
- Including in subdir
:download:
is tested in includes.txtPython -c option
- This used to crash:
&option
Test abbr and another abbr.
Testing the index role, also available with explicit title.
9.5. Tables¶
1 |
|
x |
2 | Empty cells: |
1 | 2 |
3 | 4 |
Tables with multirow and multicol:
9.6. Figures¶

My caption of the figure
My description paragraph of the figure.
Description paragraph is wraped with legend node.

figure with align option

figure with align & figwidth option
9.7. Version markup¶
New in version 0.6: Some funny stuff.
Changed in version 0.6: Even more funny stuff.
Deprecated since version 0.6: Boring stuff.
New in version 1.2: First paragraph of versionadded.
Changed in version 1.2: First paragraph of versionchanged.
Second paragraph of versionchanged.
9.8. Code blocks¶
1 2 3 | def ruby?
false
end
|
import sys
sys.stdout.write('hello world!\n')
9.9. Misc stuff¶
Stuff [1]
Reference lookup: [Ref1] (defined in another file). Reference lookup underscore: [Ref_1]
|
|
|
|
Side note
This is a side note.
This tests role names in uppercase
.
LICENSE AGREEMENT
- Terry Pratchett
- Tolkien
- Monty Python
- änhlich
- Dinge
- boson
- Particle with integer spin.
- fermion
- Particle with half-integer spin.
- tauon
- myon
- electron
- Examples for fermions.
- über
- Gewisse
try_stmt ::=try1_stmt
|try2_stmt
try1_stmt ::= "try" ":"suite
("except" [expression
[","target
]] ":"suite
)+ ["else" ":"suite
] ["finally" ":"suite
] try2_stmt ::= "try" ":"suite
"finally" ":"suite
9.11. Ö... Some strange characters¶
Testing öäü...
10. Testing object descriptions¶
-
func_without_module
(a, b, *c[, d])¶ Does something.
-
func_without_body
()¶
-
func_with_unknown_field
()¶ : :
: empty field name:
Field_name: Field_name all lower: FIELD_NAME: FIELD_NAME ALL CAPS: Field_Name: Field_Name All Word Caps: Field_name: Field_name First word cap: FIELd_name: FIELd_name PARTial caps:
-
func_noindex
()
-
foolib.
func_with_module
()¶
Referring to func with no index
.
Referring to nothing
.
-
mod.
func_in_module
()¶
-
Cls.
meth2
()¶
-
exception
errmod.
Error
(arg1, arg2)¶
-
mod.
var
¶
-
func_without_module2
() → annotation¶
-
long(parameter, list)
-
another one
-
class
TimeInt
¶ Has only one parameter (triggers special behavior...)
Parameters: moo (Moo) – Moo
11. C items¶
-
Sphinx_DoSomething
()¶
-
SphinxStruct.member
¶
-
SPHINX_USE_PYTHON
¶
-
SphinxType
¶
-
sphinx_global
¶
12. Javascript items¶
-
foo
()¶
-
bar
¶
-
bar.
baz
(href, callback[, errback])¶ Arguments: - href (string) – The location of the resource.
- callback – Get’s called with the data returned by the resource.
Throws: InvalidHref – If the href is invalid.
Returns: undefined
-
bar.
spam
¶
13. References¶
Referencing mod.Cls
or mod.Cls
should be the same.
With target: Sphinx_DoSomething()
(parentheses are handled),
SphinxStruct.member
, SPHINX_USE_PYTHON
,
SphinxType *
(pointer is handled), sphinx_global
.
Without target: CFunction()
. malloc()
.
17. File with UTF-8 BOM¶
This file has a UTF-8 “BOM”.
18. Test math extensions E = m c^2¶
This is inline math: a^2 + b^2 = c^2.
Referencing equation (1).
19. Autodoc tests¶
Just testing a few autodoc possibilities...
19.1. Sphinx test suite utilities¶
copyright: | Copyright 2007-2016 by the Sphinx team, see AUTHORS. |
---|---|
license: | BSD, see LICENSE for details. |
19.2. test_autodoc¶
Test the autodoc extension. This tests mainly the Documenters; the auto directives are tested in a test source file translated by test_build.
copyright: | Copyright 2007-2016 by the Sphinx team, see AUTHORS. |
---|---|
license: | BSD, see LICENSE for details. |
-
class
test_autodoc.
Class
(arg)¶ Class to document.
-
attr
= 'bar'¶ should be documented – süß
-
descr
¶ Descriptor instance docstring.
-
docattr
= 'baz'¶ should likewise be documented – süß
-
excludemeth
()¶ Method that should be excluded.
-
inst_attr_comment
= None¶ a documented instance attribute
-
inst_attr_inline
= None¶ an inline documented instance attr
-
inst_attr_string
= None¶ a documented instance attribute
-
mdocattr
= <StringIO.StringIO instance>¶ should be documented as well - süß
-
meth
()¶ Function.
-
classmethod
moore
(a, e, f) → happiness¶
-
prop
¶ Property.
-
skipmeth
()¶ Method that should be skipped.
-
udocattr
= 'quux'¶ should be documented as well - süß
-
-
test_autodoc.
function
(foo, *args, **kwds)¶ Return spam.
-
class
test_autodoc.
Class
(arg) Class to document.
Additional content.
-
attr
= 'bar' should be documented – süß
-
descr
Descriptor instance docstring.
-
docattr
= 'baz' should likewise be documented – süß
-
excludemeth
() Method that should be excluded.
-
inheritedmeth
()¶ Inherited function.
-
inst_attr_comment
= None a documented instance attribute
-
inst_attr_inline
= None an inline documented instance attr
-
inst_attr_string
= None a documented instance attribute
-
mdocattr
= <StringIO.StringIO instance> should be documented as well - süß
-
meth
() Function.
-
classmethod
moore
(a, e, f) → happiness
-
prop
Property.
-
skipmeth
() Method that should be skipped.
-
udocattr
= 'quux' should be documented as well - süß
-
-
Class.
docattr
= 'baz' should likewise be documented – süß
-
class
test_autodoc.
CustomDict
¶ Bases:
dict
Docstring.
-
class
autodoc_fodder.
MarkupError
¶ Note
This is a docstring with a
small markup error which should have correct location information.
-
class
test_autodoc.
InstAttCls
¶ Class with documented class and instance attributes.
All members (5 total)
-
ca1
= 'a'¶ Doc comment for class attribute InstAttCls.ca1. It can have multiple lines.
-
ca2
= 'b'¶ Doc comment for InstAttCls.ca2. One line only.
-
ca3
= 'c'¶ Docstring for class attribute InstAttCls.ca3.
-
ia1
= None¶ Doc comment for instance attribute InstAttCls.ia1
-
ia2
= None¶ Docstring for instance attribute InstAttCls.ia2.
-
-
class
test_autodoc.
InstAttCls
Class with documented class and instance attributes.
Specific members (2 total)
-
ca1
= 'a' Doc comment for class attribute InstAttCls.ca1. It can have multiple lines.
-
ia1
= None Doc comment for instance attribute InstAttCls.ia1
-
Dedication
For Docutils users & co-developers.
Abstract
This document is a demonstration of the reStructuredText markup language, containing examples of all basic reStructuredText constructs and many advanced constructs.
21. Test for diverse extensions¶
21.1. extlinks¶
Test diverse links: issue 1000 and http://python.org/dev/, also with explicit caption.
22. Testing footnote and citation¶
22.5. footnotes in table¶
name [5] | desription |
---|---|
VIDIOC_CROPCAP | Information about VIDIOC_CROPCAP |
22.6. footenotes¶
Footnotes
[1] | numbered |
[2] | auto numbered |
[3] | named |
Citations
[bar] | cite |
[4] | footnotes in table caption |
[5] | footnotes in table |
22.7. missing target¶
[missing] citation
23. Various kinds of lists¶
23.1. nested enumerated lists¶
- one
- two
- two.1
- two.2
- three
23.4. definition lists¶
- term1
- description
- term2 (stronged partially)
- description