From ce3ba6d4d800e6cd5ce2b21ece727481671e2ff9 Mon Sep 17 00:00:00 2001 From: Ron Stone Date: Wed, 13 Sep 2023 15:03:32 +0000 Subject: [PATCH] Add tabbed output support (r8) Enable HTML tabs in output pages. This is initially for use differentiating virtual from bare-metal instructions in a consolidated Install doc. Since virtual content is currently StarlingX-only, content must be conditionalized as in: .. present tabbed content choice to StarlingX builds .. only:: virtual .. tabs:: .. tab:: Virtual Apples are green, or sometimes red. .. tab:: Bare Metal .. bare-metal-pear-begin Pears are green. .. bare-metal-pear-end .. Present bare-metal only to non-StarlingX builds as non-tabbed content .. only:: partner .. include:: this-file.rst :start-after: bare-metal-pear-begin :end-before: bare-metal-pear-end Signed-off-by: Ron Stone Change-Id: Ib65cf59f510e685a82c3d1ab046cb656d0f2fba1 --- doc/requirements.txt | 1 + doc/source/conf.py | 3 ++- tox.ini | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 307d4d3f7..f6d9b4bc3 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -2,6 +2,7 @@ sphinx==4.2.0 openstackdocstheme>=2.2.1,<=2.3.1 # Apache-2.0 docutils==0.17.1 PyYAML==6.0 +sphinx-tabs<=3.4.1 # API Reference Guide os-api-ref>=1.5.0 # Apache-2.0 diff --git a/doc/source/conf.py b/doc/source/conf.py index d9b7a4e08..dae81992c 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -36,7 +36,8 @@ author = 'StarlingX' # ones. extensions = [ # 'openstackdocstheme', - 'starlingxdocs_plus' + 'starlingxdocs_plus', + 'sphinx_tabs.tabs' ] if tags.has('use_spellext'): diff --git a/tox.ini b/tox.ini index 75128d973..6c3aa1e3f 100644 --- a/tox.ini +++ b/tox.ini @@ -35,7 +35,7 @@ deps = -r{toxinidir}/doc/requirements.txt commands = {[testenv:prebuild-docs]commands} - sphinx-build -a -E -W --keep-going -d doc/build/doctrees -t starlingx -t openstack -b html doc/source doc/build/html {posargs} + sphinx-build -a -E -W --keep-going -d doc/build/doctrees -t starlingx -t openstack -t virtual -b html doc/source doc/build/html {posargs} {[testenv:postbuild-docs]commands} # Note: The dev env for the docs team uses a version of tox that does not yet support allowlist_externals whitelist_externals = bash