Various examples of Bootstrap styling applied to Sphinx constructs. You can view the source of this page to see the specific reStructuredText used to create these examples.
This is a first level heading (h1).
The Sphinx Bootstrap Theme uses Bootstrap styling for inline code text and
multiline
code text
Here’s an included example with line numbers.
1 2 3 4 5 6 7 8 9 10 11 12 | """Sphinx bootstrap theme."""
import os
VERSION = (0, 4, 0)
__version__ = ".".join(str(v) for v in VERSION)
__version_full__ = __version__
def get_html_theme_path():
"""Return list of HTML theme paths."""
cur_dir = os.path.abspath(os.path.dirname(__file__))
return [cur_dir]
|
It also works with existing Sphinx highlighting:
<html>
<body>Hello World</body>
</html>
def hello():
"""Greet."""
return "Hello World"
/**
* Greet.
*/
function hello(): {
return "Hello World";
}
The Sphinx Bootstrap Theme uses the Bootstrap alert classes for Sphinx admonitions.
Note
This is a note.
Todo
This is a todo.
Warning
This is a warning.
Danger
This is danger-ous.
I have footnoted a first item [1] and second item [2].
Footnotes
[1] | My first footnote. |
[2] | My second footnote. |
Here are some examples of Sphinx tables. The Sphinx Bootstrap Theme removes all Sphinx docutils classes and replaces them with the default Bootstrap table class. You can add additional table classes using the Sphinx cssclass:: directive, as demonstrated in the following tables.
A “bordered” grid table:
Header1 | Header2 | Header3 | Header4 |
---|---|---|---|
row1, cell1 | cell2 | cell3 | cell4 |
row2 ... | ... | ... | |
... | ... | ... |
which uses the directive:
.. cssclass:: table-bordered
A simple “striped” table:
H1 | H2 | H3 |
---|---|---|
cell1 | cell2 | cell3 |
... | ... | ... |
... | ... | ... |
which uses the directive:
.. cssclass:: table-striped
And a “hoverable” table:
H1 | H2 | H3 |
---|---|---|
cell1 | cell2 | cell3 |
... | ... | ... |
... | ... | ... |
which uses the directive:
.. cssclass:: table-hover
An example Python function.
Format the exception with a traceback.
Parameters: |
|
---|---|
Return type: | list of strings |
An example JavaScript function.
Arguments: |
|
---|