| 1 |
.. index:: cloud; feature test |
| 2 |
|
| 3 |
============ |
| 4 |
Feature Test |
| 5 |
============ |
| 6 |
|
| 7 |
This page contains examples of various features of the Cloud theme. |
| 8 |
It's mainly useful internally, to make sure everything is displaying correctly. |
| 9 |
|
| 10 |
Inline Text |
| 11 |
============= |
| 12 |
|
| 13 |
Inline literal: ``literal text``. |
| 14 |
|
| 15 |
Samp literal: :samp:`this is a {variable}, these are literal \\{ and \\}`. |
| 16 |
|
| 17 |
External links are prefixed with an arrow: `<http://www.google.com>`_. |
| 18 |
|
| 19 |
But email links are not prefixed: [email protected]. |
| 20 |
|
| 21 |
Issue tracker link: :issue:`5`. |
| 22 |
|
| 23 |
.. role:: strike |
| 24 |
:class: strike |
| 25 |
|
| 26 |
This text should be :strike:`crossed out` |
| 27 |
|
| 28 |
.. rst-class:: hidden |
| 29 |
|
| 30 |
This text should not be visible. |
| 31 |
|
| 32 |
Admonition Styles |
| 33 |
================= |
| 34 |
.. note:: |
| 35 |
This is a note. |
| 36 |
|
| 37 |
.. caution:: |
| 38 |
|
| 39 |
This is a slightly dangerous. |
| 40 |
|
| 41 |
.. warning:: |
| 42 |
|
| 43 |
This is a warning. |
| 44 |
|
| 45 |
.. danger:: |
| 46 |
|
| 47 |
This is dangerous. |
| 48 |
|
| 49 |
.. seealso:: |
| 50 |
|
| 51 |
This is a "see also" message. |
| 52 |
|
| 53 |
.. todo:: |
| 54 |
|
| 55 |
This is a todo message. |
| 56 |
|
| 57 |
With some additional next on another line. |
| 58 |
|
| 59 |
.. deprecated:: XXX This is a deprecation warning. |
| 60 |
|
| 61 |
.. versionadded:: XXX This was added |
| 62 |
|
| 63 |
.. versionchanged:: XXX This was changed |
| 64 |
|
| 65 |
.. rst-class:: float-right |
| 66 |
|
| 67 |
.. note:: |
| 68 |
|
| 69 |
This is note using the ``float-right`` class. |
| 70 |
|
| 71 |
.. rst-class:: float-center |
| 72 |
|
| 73 |
.. note:: |
| 74 |
|
| 75 |
This is note using the ``float-center`` class. |
| 76 |
|
| 77 |
.. rst-class:: without-title |
| 78 |
|
| 79 |
.. seealso:: |
| 80 |
This is a "see also" using the ``without-title`` class. |
| 81 |
|
| 82 |
Code Styles |
| 83 |
=========== |
| 84 |
Python Code Block: |
| 85 |
|
| 86 |
.. code-block:: python |
| 87 |
:linenos: |
| 88 |
|
| 89 |
>>> import os |
| 90 |
|
| 91 |
>>> os.listdir("/home") |
| 92 |
['bread', 'pudding'] |
| 93 |
|
| 94 |
>>> os.listdir("/root") |
| 95 |
Traceback (most recent call last): |
| 96 |
File "<stdin>", line 1, in <module> |
| 97 |
OSError: [Errno 13] Permission denied: '/root' |
| 98 |
|
| 99 |
INI Code Block: |
| 100 |
|
| 101 |
.. code-block:: ini |
| 102 |
:linenos: |
| 103 |
|
| 104 |
[rueben] |
| 105 |
bread = rye |
| 106 |
meat = corned beef |
| 107 |
veg = sauerkraut |
| 108 |
|
| 109 |
Long Lines (:issue:`22`): |
| 110 |
|
| 111 |
.. literalinclude:: _static/longline.txt |
| 112 |
:linenos: |
| 113 |
|
| 114 |
.. literalinclude:: _static/longline.txt |
| 115 |
|
| 116 |
|
| 117 |
Function styling: |
| 118 |
|
| 119 |
.. function:: frobfunc(foo=1, *, bar=False) |
| 120 |
:noindex: |
| 121 |
|
| 122 |
:param foo: foobinate strength |
| 123 |
:type foo: int |
| 124 |
|
| 125 |
:param bar: enabled barring. |
| 126 |
:type bar: bool |
| 127 |
|
| 128 |
:returns: frobbed return |
| 129 |
:rtype: str |
| 130 |
|
| 131 |
:raises TypeError: if *foo* is out of range |
| 132 |
|
| 133 |
Class styling: |
| 134 |
|
| 135 |
.. class:: FrobClass(foo=1, *, bar=False) |
| 136 |
:noindex: |
| 137 |
|
| 138 |
Class docstring. Saying things. |
| 139 |
|
| 140 |
.. attribute:: foo |
| 141 |
:noindex: |
| 142 |
|
| 143 |
foobinate strength |
| 144 |
|
| 145 |
.. attribute:: bar |
| 146 |
:noindex: |
| 147 |
|
| 148 |
barring enabled |
| 149 |
|
| 150 |
.. method:: run() |
| 151 |
:noindex: |
| 152 |
|
| 153 |
execute action, return result. |
| 154 |
|
| 155 |
Table Styles |
| 156 |
============ |
| 157 |
|
| 158 |
.. table:: Default Table |
| 159 |
|
| 160 |
=========== =========== =========== |
| 161 |
Header1 Header2 Header3 |
| 162 |
=========== =========== =========== |
| 163 |
Row 1 Row 1 Row 1 |
| 164 |
Row 2 Row 2 Row 2 |
| 165 |
Row 3 Row 3 Row 3 |
| 166 |
=========== =========== =========== |
| 167 |
|
| 168 |
.. rst-class:: plain |
| 169 |
|
| 170 |
.. table:: Plain Table (no row shading) |
| 171 |
|
| 172 |
=========== =========== =========== |
| 173 |
Header1 Header2 Header3 |
| 174 |
=========== =========== =========== |
| 175 |
Row 1 Row 1 Row 1 |
| 176 |
Row 2 Row 2 Row 2 |
| 177 |
Row 3 Row 3 Row 3 |
| 178 |
=========== =========== =========== |
| 179 |
|
| 180 |
.. table:: Left Table |
| 181 |
:align: left |
| 182 |
|
| 183 |
=========== =========== =========== |
| 184 |
Header1 Header2 Header3 |
| 185 |
=========== =========== =========== |
| 186 |
Row 1 Row 1 Row 1 |
| 187 |
Row 2 Row 2 Row 2 |
| 188 |
Row 3 Row 3 Row 3 |
| 189 |
=========== =========== =========== |
| 190 |
|
| 191 |
.. table:: Center Table |
| 192 |
:align: center |
| 193 |
|
| 194 |
=========== =========== =========== |
| 195 |
Header1 Header2 Header3 |
| 196 |
=========== =========== =========== |
| 197 |
Row 1 Row 1 Row 1 |
| 198 |
Row 2 Row 2 Row 2 |
| 199 |
Row 3 Row 3 Row 3 |
| 200 |
=========== =========== =========== |
| 201 |
|
| 202 |
.. table:: Right Table |
| 203 |
:align: right |
| 204 |
|
| 205 |
=========== =========== =========== |
| 206 |
Header1 Header2 Header3 |
| 207 |
=========== =========== =========== |
| 208 |
Row 1 Row 1 Row 1 |
| 209 |
Row 2 Row 2 Row 2 |
| 210 |
Row 3 Row 3 Row 3 |
| 211 |
=========== =========== =========== |
| 212 |
|
| 213 |
.. rst-class:: fullwidth |
| 214 |
|
| 215 |
.. table:: Full Width Table |
| 216 |
|
| 217 |
=========== =========== =========== |
| 218 |
Header1 Header2 Header3 |
| 219 |
=========== =========== =========== |
| 220 |
Row 1 Row 1 Row 1 |
| 221 |
Row 2 Row 2 Row 2 |
| 222 |
Row 3 Row 3 Row 3 |
| 223 |
=========== =========== =========== |
| 224 |
|
| 225 |
:doc:`Table Styling Extension <lib/cloud_sptheme.ext.table_styling>` |
| 226 |
==================================================================== |
| 227 |
|
| 228 |
.. table:: Column Separators |
| 229 |
:widths: 1 2 3 |
| 230 |
:header-columns: 1 |
| 231 |
:column-alignment: left center right |
| 232 |
:column-dividers: none single double single |
| 233 |
:column-wrapping: nnn |
| 234 |
|
| 235 |
=========== =========== =========== |
| 236 |
Width x1 Width x2 Width x3 |
| 237 |
=========== =========== =========== |
| 238 |
Header 1 Center 1 Right 1 |
| 239 |
Header 2 Center 2 Right 2 |
| 240 |
Header 3 Center 3 Right 3 |
| 241 |
=========== =========== =========== |
| 242 |
|
| 243 |
.. table:: Header Alignment & Body Colspans |
| 244 |
:widths: 1 1 1 1 2 2 4 4 |
| 245 |
:header-alignment: lrlrlrlr |
| 246 |
:column-alignment: lccccccc |
| 247 |
:column-wrapping: tttttttt |
| 248 |
:column-dividers: 122222221 |
| 249 |
|
| 250 |
======== ======== ======== ======== ======== ======== ================= ================= |
| 251 |
Left x1 Right x1 Left x1 Right x1 Left x2 Right x2 Left x4 Right x4 |
| 252 |
======== ======== ======== ======== ======== ======== ================= ================= |
| 253 |
Left Span x1+1 Center Span x1+1+2+2 Center Span x4+4 |
| 254 |
----------------- ----------------------------------- ----------------------------------- |
| 255 |
Left Span xALL |
| 256 |
----------------------------------------------------------------------------------------- |
| 257 |
Left Span xALL |
| 258 |
========================================================================================= |
| 259 |
|
| 260 |
.. table:: Multi-Row Header & Header Colspans |
| 261 |
:widths: 1 1 1 1 2 2 4 4 |
| 262 |
:header-alignment: lrlrlrlr |
| 263 |
:column-alignment: lccccccc |
| 264 |
:column-wrapping: tttttttt |
| 265 |
:column-dividers: 122222221 |
| 266 |
:header-columns: 1 |
| 267 |
|
| 268 |
======== ======== ======== ======== ======== ======== ================= ================= |
| 269 |
Left x1 Right x1 Left x1 Right x1 Left x2 Right x2 Left x4 Right x4 |
| 270 |
-------- -------- -------- -------- -------- -------- ----------------- ----------------- |
| 271 |
Left Span x1+1 Center Span x1+1+2+2 Center Span x4+4 |
| 272 |
================= =================================== =================================== |
| 273 |
H x1 x1 Center Span x1+1 Center Span x2+2 Center Span x4+4 |
| 274 |
-------- -------- ----------------- ----------------- ----------------------------------- |
| 275 |
H x1 Center Span xALL |
| 276 |
======== ================================================================================ |
| 277 |
|
| 278 |
.. rst-class:: html-toggle |
| 279 |
|
| 280 |
.. _toggle-test-link: |
| 281 |
|
| 282 |
Toggleable Section |
| 283 |
================== |
| 284 |
This section is collapsed by default. |
| 285 |
But if a visitor follows a link to this section or something within it |
| 286 |
(such as :ref:`this <toggle-test-link>`), it will automatically be expanded. |
| 287 |
|
| 288 |
.. rst-class:: html-toggle expanded |
| 289 |
|
| 290 |
Toggleable Subsection |
| 291 |
--------------------- |
| 292 |
Subsections can also be marked as toggleable. |
| 293 |
This one should be expanded by default. |
| 294 |
|
| 295 |
Normal Section |
| 296 |
============== |
| 297 |
|
| 298 |
Child Section |
| 299 |
------------- |
| 300 |
|
| 301 |
.. rst-class:: html-toggle |
| 302 |
|
| 303 |
Toggleable Subsection |
| 304 |
--------------------- |
| 305 |
Test of emphasized + toggleable styles. Should be collapsed by default. |
| 306 |
|
| 307 |
.. rst-class:: emphasize-children |
| 308 |
|
| 309 |
Section With Emphasized Children |
| 310 |
================================ |
| 311 |
Mainly useful for sections with many long subsections, |
| 312 |
where a second level of visual dividers would be useful. |
| 313 |
|
| 314 |
Child Section |
| 315 |
---------------- |
| 316 |
Should have slightly lighter background, and be indented. |
| 317 |
|
| 318 |
.. rst-class:: html-toggle |
| 319 |
|
| 320 |
Toggleable Subsection |
| 321 |
--------------------- |
| 322 |
Test of emphasized + toggleable styles. Should be collapsed by default. |
| 323 |
|
| 324 |
:mod:`~cloud_sptheme.ext.autodoc_sections` Extension |
| 325 |
==================================================== |
| 326 |
.. autofunction:: cloud_sptheme.ext.autodoc_sections._doctestfunc |
| 327 |
:noindex: |