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.
Headings¶This is a first level heading (h1
).
This is a second level heading (h2
).
This is a third level heading (h3
).
The Sphinx Bootstrap Theme uses Bootstrap styling for inline code text
and
Here’s an included example with line numbers.
1"""Sphinx bootstrap theme.""" 2import os 3 4__version__ = "0.8.1" 5 6 7def get_html_theme_path(): 8 """Return list of HTML theme paths.""" 9 theme_path = os.path.abspath(os.path.dirname(__file__)) 10 return [theme_path] 11 12 13def setup(app): 14 """Setup.""" 15 # add_html_theme is new in Sphinx 1.6+ 16 if hasattr(app, 'add_html_theme'): 17 theme_path = get_html_theme_path()[0] 18 app.add_html_theme('bootstrap', os.path.join(theme_path, 'bootstrap'))
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"; }Admonitions¶
The Sphinx Bootstrap Theme uses the Bootstrap alert
classes for Sphinx admonitions.
Warning
This is a warning.
Danger¶Danger
This is danger-ous.
Icons¶Icons are different in Bootstrap 2 and 3, so you will only see an icon below for the version of Bootstrap that we used to build these docs.
Bootstrap 2¶The following template HTML:
<span class="icon-star-empty"></span>
translates to a neat star:
Bootstrap 3¶The following template HTML:
<span class="glyphicon glyphicon-star-empty"></span>
translates to a neat star:
Tables¶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-borderedSimple¶
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-hoverCode Documentation¶
An example Python function.
Format the exception with a traceback.
An example C++ function.
use_random – Whether or not to return a random number.
42
if use_random == false
, a random number otherwise.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4