Sphinx Inline Tabs

2025.12.21.14 · active · verified Thu Apr 16

Sphinx Inline Tabs is a Sphinx extension that allows you to add inline tabbed content to your documentation. This is useful for showing different command-line flags, code examples, or other content based on user preferences. The current version is `2025.12.21.14` and it follows a non-strict release cadence, often aligned with Sphinx releases or bug fixes.

Common errors

Warnings

Install

Imports

Quickstart

To quickly use `sphinx-inline-tabs`, first create a basic Sphinx project (`sphinx-quickstart`). Then, add `sphinx_inline_tabs` to the `extensions` list in your `conf.py` file. Finally, define tabbed content using the `.. tabs::` directive and `.. group-tab::` (or `.. tab::`) sub-directives in your reStructuredText files, ensuring correct indentation. The provided code snippet shows the `conf.py` modification and an example RST structure.

# conf.py
extensions = [
    'sphinx_inline_tabs',
]

# index.rst (or any other .rst file where you want tabs)
# .. tabs::
#
#    .. group-tab:: Python
#
#       .. code-block:: python
#
#          print("Hello from Python")
#
#    .. group-tab:: Go
#
#       .. code-block:: go
#
#          package main
#          import "fmt"
#          func main() {
#              fmt.Println("Hello from Go")
#          }

view raw JSON →