1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
|
==========
Examples
==========
Various examples of Bootstrap styling applied to Sphinx constructs. You can
view the `source <./_sources/examples.txt>`_ of this page to see the specific
reStructuredText used to create these examples.
Headings
========
This is a first level heading (``h1``).
Sub-Heading
-----------
This is a second level heading (``h2``).
Sub-Sub-Heading
~~~~~~~~~~~~~~~
This is a third level heading (``h3``).
Code
====
The Sphinx Bootstrap Theme uses Bootstrap styling for ``inline code text`` and
::
multiline
code text
Here's an included example with line numbers.
.. literalinclude:: ../../samples/helloworld.py
:linenos:
It also works with existing Sphinx highlighting:
.. code-block:: html
<html>
<body>Hello World</body>
</html>
.. code-block:: python
def hello():
"""Greet."""
return "Hello World"
.. code-block:: javascript
/**
* Greet.
*/
function hello(): {
return "Hello World";
}
Admonitions
===========
The Sphinx Bootstrap Theme uses the Bootstrap ``alert`` classes for Sphinx
admonitions.
Note
----
.. note:: This is a **note**.
Todo
----
.. todo:: This is a **todo**.
Warning
-------
.. warning:: This is a **warning**.
Danger
------
.. danger:: This is **danger**-ous.
Footnotes
=========
I have footnoted a first item [#f1]_ and second item [#f2]_.
.. rubric:: Footnotes
.. [#f1] My first footnote.
.. [#f2] My second footnote.
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:
.. code-block:: html
<span class="icon-star-empty"></span>
translates to a neat star:
.. raw:: html
<span class="icon-star-empty"></span>
Bootstrap 3
-----------
The following template HTML:
.. code-block:: html
<span class="glyphicon glyphicon-star-empty"></span>
translates to a neat star:
.. raw:: html
<span class="glyphicon glyphicon-star-empty"></span>
Tables
======
Here are some examples of Sphinx
`tables <http://sphinx-doc.org/rest.html#rst-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.
Grid
----
A "**bordered**" grid table:
.. cssclass:: table-bordered
+------------------------+------------+----------+----------+
| Header1 | Header2 | Header3 | Header4 |
+========================+============+==========+==========+
| row1, cell1 | cell2 | cell3 | cell4 |
+------------------------+------------+----------+----------+
| row2 ... | ... | ... | |
+------------------------+------------+----------+----------+
| ... | ... | ... | |
+------------------------+------------+----------+----------+
which uses the directive::
.. cssclass:: table-bordered
Simple
------
A simple "**striped**" table:
.. cssclass:: table-striped
===== ===== =======
H1 H2 H3
===== ===== =======
cell1 cell2 cell3
... ... ...
... ... ...
===== ===== =======
which uses the directive::
.. cssclass:: table-striped
And a "**hoverable**" table:
.. cssclass:: table-hover
===== ===== =======
H1 H2 H3
===== ===== =======
cell1 cell2 cell3
... ... ...
... ... ...
===== ===== =======
which uses the directive::
.. cssclass:: table-hover
Code Documentation
==================
An example Python function.
.. py:function:: format_exception(etype, value, tb[, limit=None])
Format the exception with a traceback.
:param etype: exception type
:param value: exception value
:param tb: traceback object
:param limit: maximum number of stack frames to show
:type limit: integer or None
:rtype: list of strings
An example JavaScript function.
.. js:class:: MyAnimal(name[, age])
:param string name: The name of the animal
:param number age: an optional age for the animal
|