F5 Sphinx Theme¶
Setup and Configuration¶
Download or
git clonethe f5-sphinx-theme.pip install .from the f5-sphinx-theme base directory.pip install -r requirements.txtto ensure dependencies are present.Add
f5-sphinx-themeto the “import” section of your project’sconf.py(replace any existing theme import).import f5_sphinx_theme
Configure the
html_themeandhtml_theme_theme_path()as shown below.html_theme = 'f5_sphinx_theme' html_theme_path = f5_sphinx_theme.get_html_theme_path()
(Optional) Configure the
html_sidebarsoption. See the sphinx documentation for more information.html_sidebars = {'**': ['searchbox.html', 'localtoc.html', 'globaltoc.html']}
(Optional) Configure the
html_theme_options{}dictionary. Thesite_nameandnext_prev_linkoptions are supported.html_theme_options = { 'site_name': 'My Site Name', 'next_prev_link': False }
Depending on your publication/deployment process, you may have to re-build your documentation for the changes to take effect.
Customizing CSS and Assets¶
The css styling for the project uses two css files:
f5.csscontains F5’s core bootstrap customizations and fonts.custom.csscan be used for any modifications you’d like to make for your documentation to make content easier to navigate and reference. Bear in mind that all mods must still comply with the F5 Corporate Branding strategy and requirements.
After customizing the custom.css file, you’ll have to uninstall the theme and reinstall it to apply your changes.
pip uninstall f5-sphinx-theme
pip install .
Integrated Styling Tools¶
Font Awesome¶
The f5-sphinx-theme uses the Font Awesome integration provided in the sphinxjp.theme.basicstrap Sphinx theme/extension. 1
To use this extension in your project:
Add
sphinxjp.themes.basicstrapto theextensionssection of your project’sconf.py.Add
sphinxjp.themes.basicstrapto your project’srequirements.txtfile.
To add a Font Awesome icon to your docs:
:fonticon:`fa fa-<icon_name>`
- 1
sphinxjp.themes.basicstrapis licensed under the MIT license.
TMSH/TMOS code blocks¶
The f5-sphinx-theme has special CSS styling for TMSH/TMOS code blocks. To use:
.. admonition:: TMSH
tmsh show sys hardware
If you’re including a multi-line print-out, format it as code as shown below:
.. admonition:: TMSH
::
admin@(bigip)(cfg-sync Standalone)(Active)(/mesos)# tmsh show ltm virtual
------------------------------------------------------------------
Ltm::Virtual Server: basic-0_8080
------------------------------------------------------------------
Status
Availability : unknown
State : enabled
Reason : The children pool member(s) either don't have service checking enabled, or service check results are not available yet
CMP : enabled
CMP Mode : all-cpus
Destination : 10.190.25.70:8080
...