3. Examples of Common Formatting¶
Todo
Examples need to be removed from your class
Hint
To remove this page:
- Edit the
index.rst
file and remove theexamples
line - Delete the
examples.rst
file
This page has examples of many different types of formatting that can be achieved using reStructuredText. Complete documentation is available at:
http://www.sphinx-doc.org/en/stable/rest.html
3.1. Text Markup¶
3.1.2. Code Samples¶
code sample
This is one example of a code block:
import math
print 'import done'
Code block without syntax highlighting:
$ ls -l
total 96
-rw-r--r-- 1 user staff 610 Jun 22 17:51 Makefile
drwxr-xr-x 4 user staff 136 Jun 22 21:14 _build
drwxr-xr-x 3 user staff 102 Jun 22 21:16 _static
drwxr-xr-x 3 user staff 102 Jun 22 17:55 _templates
drwxr-xr-x 5 user staff 170 Jun 22 21:00 class1
-rw-r--r-- 1 user staff 6764 Jun 22 21:26 conf.py
-rw-r--r--@ 1 user staff 733 Jun 22 21:41 examples.rst
-rw-r--r-- 1 user staff 152 Jun 22 21:32 index.rst
-rw-r--r-- 1 user staff 995 Jun 22 20:55 intro.rst
-rw-r--r-- 1 user staff 817 Jun 22 17:51 make.bat
$
Code block with syntax highlighting:
Note
A list of supported languages can be found at here
import math
a = 1
b = 2
sum = a + b
print 'Sum: %s' % sum
Code block with highlighting and line numbers:
1 2 3 4 5 | import math
a = 1
b = 2
sum = a + b
print 'Sum: %s' % sum
|
Code block with highlighting, line numbers, and line highlighting:
1 2 3 4 5 | import math
a = 1
b = 2
sum = a + b
print 'Sum: %s' % sum
|
3.2. Substitutions¶
rST:
.. |name| replace:: replacement *text*
|name|
Result:
replacement text
3.2.1. Pre-configured Substitutions¶
A number of common substitutions are pre-configured for convenience:
Name | Value |
---|---|
|classname| |
Getting Started with F5 BIG-IP |
|classbold| |
Getting Started with F5 BIG-IP |
|classitalic| |
Getting Started with F5 BIG-IP |
|ltm| |
Local Traffic Manager |
|adc| |
Application Delivery Controller |
|gtm| |
Global Traffic Manager |
|dns| |
DNS |
|asm| |
Application Security Manager |
|afm| |
Advanced Firewall Manager |
|apm| |
Access Policy Manager |
|ipi| |
IP Intelligence |
|iwf| |
iWorkflow |
|biq| |
BIG-IQ |
|bip| |
BIG-IP |
|f5| |
F5 Networks |
|f5i| |
F5 Networks, Inc. |
|year| |
2021 |
3.3. Hyperlinks¶
3.3.1. External¶
- Bare URL: https://www.f5.com
- Named Link: Click here to goto F5’s website
3.3.2. Internal¶
- Reference section headers in this document: Hyperlinks
- Reference other pages: Welcome
3.4. Lists¶
3.4.1. Unordered Lists¶
- This
- Is
- A
- List
3.4.2. Ordered Lists¶
- One
- Two
- Three
- Four
3.4.3. Nested Lists¶
- This
- One
- Two
- Alpha
- Bravo
- Charlie
- Is
- 1
- 2
- A
- Nested
- List
3.5. Tables¶
3.5.1. List Tables¶
3.5.1.1. With Stub Column¶
Column 1 (Stub) | Column 2 | Column 3 |
---|---|---|
Row 1 | Value 1 | Value 2 |
Row 2 | Value 1 | Value 2 |
3.5.1.2. Without Stub Column¶
Column 1 | Column 2 | Column 3 |
---|---|---|
Row 1 | Value 1 | Value 2 |
Row 2 | Value 1 | Value 2 |
3.5.2. Grid Tables¶
Header row, column 1 (header rows optional) | Header 2 | Header 3 | Header 4 |
---|---|---|---|
body row 1, column 1 | column 2 | column 3 | column 4 |
body row 2 | Cells may span columns. | ||
body row 3 | Cells may span rows. |
|
|
body row 4 | |||
body row 5 | Cells may also be
empty: --> |
3.5.2.1. Giant Tables¶
Header 1 | Header 2 | Header 3 | Header 1 | Header 2 | Header 3 | Header 1 | Header 2 | Header 3 | Header 1 | Header 2 | Header 3 |
---|---|---|---|---|---|---|---|---|---|---|---|
body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 |
body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 |
body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 |
body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 |
3.5.3. Simple Tables¶
A | B | A and B |
---|---|---|
False | False | False |
True | False | False |
False | True | False |
True | True | True |
3.6. Admonitions¶
Admonitions (a.k.a Callouts) can be used to make important information stand out. Examples of different admonitions are shown below.
When including TMSH commands please use the TMSH admonition
3.6.1. TMSH¶
TMSH
tmsh show sys hardware
3.6.2. Hint¶
Hint
This is a HINT admonition
3.6.3. Important¶
Important
This is a IMPORTANT admonition
3.6.4. Tip¶
Tip
This is a TIP admonition
3.6.5. Note¶
Note
This is a NOTE admonition
3.6.6. Attention¶
Attention
This is a ATTENTION admonition
3.6.7. Caution¶
Caution
This is a CAUTION admonition
3.6.8. Warning¶
Warning
This is a WARNING admonition
3.6.9. Error¶
Error
This is a ERROR admonition
3.6.10. Danger¶
Danger
This is a DANGER admonition
3.7. TODO’s¶
TODO items can be marked in your docs. By default the item will be included in the generated docs and a build warning will be printed.
To change the defaults edit conf.py
and look modify
todo_emit_warnings = True
todo_include_todos = True
Here is the rST code for a TODO:
.. TODO:: This is my example todo. Please ignore me.
.. TODO:: This is my second example todo. Please ignore me.
And the TODO themselves:
Todo
This is my first example todo. Please ignore me.
Todo
This is my second example todo. Please ignore me.
You can also get a list of TODO’s:
rST:
.. TODOLIST::
Todo
Need class description
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/class1/class1.rst, line 33.)
Todo
Needs lab description
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/class1/module1/lab1.rst, line 33.)
Todo
Needs task description
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/class1/module1/lab1.rst, line 40.)
Todo
Needs task description
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/class1/module1/lab1.rst, line 60.)
Todo
Needs lab description
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/class1/module1/lab2.rst, line 33.)
Todo
Needs task description
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/class1/module1/lab2.rst, line 41.)
Todo
Needs task description
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/class1/module1/lab2.rst, line 59.)
Todo
Needs module description
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/class1/module1/module1.rst, line 33.)
Todo
Needs lab description
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/class1/module2/lab1.rst, line 33.)
Todo
Needs task description
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/class1/module2/lab1.rst, line 41.)
Todo
Needs task description
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/class1/module2/lab1.rst, line 59.)
Todo
Needs lab description
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/class1/module2/lab2.rst, line 33.)
Todo
Needs task description
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/class1/module2/lab2.rst, line 40.)
Todo
Needs task description
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/class1/module2/lab2.rst, line 55.)
Todo
Needs module description
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/class1/module2/module2.rst, line 33.)
Todo
Examples need to be removed from your class
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/examples.rst, line 33.)
Todo
This is my first example todo. Please ignore me.
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/examples.rst, line 425.)
Todo
This is my second example todo. Please ignore me.
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/examples.rst, line 427.)
Todo
Complete getting started instructions
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/intro.rst, line 33.)
Todo
Complete lab topology
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/intro.rst, line 46.)
Todo
Complete lab components table
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/f5-agility-lab-template1/checkouts/latest/docs/intro.rst, line 58.)
3.8. Font-Awesome Icons¶
The f5-sphinx-theme
can use icons from the Font Awesome:
For example:
* :fonticon:`fa fa-home`
* :fonticon:`fa fa-home fa-lg`
* :fonticon:`fa fa-home fa-border`
* :fonticon:`fa fa-home fa-2x`
* :fonticon:`fa fa-home fa-3x`
* :fonticon:`fa fa-home fa-4x`
* :fonticon:`fa fa-gear fa-spin fa-4x`
* :fonticon:`fa fa-gear fa-spin fa-4x text-success`