sphinx-tabs

sphinx-tab is an extension maintained by Executable Books. This extension can create tabbed content.

Install

pip install sphinx-tabs

Then, add the extension to your conf.py:

conf.py
extensions = [
    # ...
    "sphinx_tabs.tabs",
]

Markup syntax

.. tabs::

  .. tab:: Apples

      Apples are green, or sometimes red.

  .. tab:: Pears

      Pears are green.

  .. tab:: Oranges

      Oranges are orange.

.. tabs::

  .. group-tab:: Linux

      Linux Line 1

  .. group-tab:: Mac OSX

      Mac OSX Line 1

  .. group-tab:: Windows

      Windows Line 1

.. tabs::

  .. group-tab:: Linux

      Linux Line 1

  .. group-tab:: Mac OSX

      Mac OSX Line 1

  .. group-tab:: Windows

      Windows Line 1


.. tabs::

  .. code-tab:: c

        int main(const int argc, const char **argv) {
          return 0;
        }

  .. code-tab:: c++

        int main(const int argc, const char **argv) {
          return 0;
        }

  .. code-tab:: py

        def main():
            return

How it looks like

../../_images/sphinx-tabs-light.png ../../_images/sphinx-tabs-dark.png