{"id":7740,"library":"sphinx-inline-tabs","title":"Sphinx Inline Tabs","description":"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.","status":"active","version":"2025.12.21.14","language":"en","source_language":"en","source_url":"https://github.com/pradyunsg/sphinx-inline-tabs","tags":["sphinx","documentation","rst","tabs","extension"],"install":[{"cmd":"pip install sphinx-inline-tabs","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"It's a Sphinx extension and requires Sphinx to run.","package":"sphinx","optional":false}],"imports":[{"note":"This library is a Sphinx extension, not typically imported as a Python module in user code. It's enabled by adding its name to the `extensions` list in your Sphinx `conf.py` file.","wrong":"from sphinx_inline_tabs import ...","symbol":"sphinx_inline_tabs","correct":"extensions = ['sphinx_inline_tabs']"}],"quickstart":{"code":"# conf.py\nextensions = [\n    'sphinx_inline_tabs',\n]\n\n# index.rst (or any other .rst file where you want tabs)\n# .. tabs::\n#\n#    .. group-tab:: Python\n#\n#       .. code-block:: python\n#\n#          print(\"Hello from Python\")\n#\n#    .. group-tab:: Go\n#\n#       .. code-block:: go\n#\n#          package main\n#          import \"fmt\"\n#          func main() {\n#              fmt.Println(\"Hello from Go\")\n#          }","lang":"python","description":"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."},"warnings":[{"fix":"Ensure `extensions = ['sphinx_inline_tabs']` (or append to existing list) is present in your `conf.py`.","message":"Forgetting to add 'sphinx_inline_tabs' to the 'extensions' list in your Sphinx 'conf.py' file. This is the most common reason for the tabs not rendering or directives being unrecognized.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Carefully follow the examples in the documentation regarding indentation. `.. group-tab::` must be indented relative to `.. tabs::`, and its content must be indented further.","message":"Incorrect reStructuredText (RST) indentation for `.. tabs::` and `.. group-tab::` directives. RST is whitespace-sensitive, and improper indentation will lead to rendering errors or unexpected output.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If tabs look broken, try switching to a standard Sphinx theme (e.g., `furo`, `alabaster`). If the issue persists, inspect browser developer tools for CSS conflicts or open an issue on the library's GitHub page.","message":"Potential visual inconsistencies with custom or older Sphinx themes. While `sphinx-inline-tabs` tries to be compatible, some themes might override default CSS/JS in a way that conflicts with the tab styling.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Add `'sphinx_inline_tabs'` to the `extensions` list in your `conf.py` file. For example: `extensions = ['sphinx.ext.autodoc', 'sphinx_inline_tabs']`.","cause":"The `sphinx-inline-tabs` extension has not been enabled in your Sphinx project's configuration.","error":"(ERROR/3) Unknown directive type \"tabs\"."},{"fix":"Review your `.rst` file. Ensure `.. group-tab::` is indented by 3 spaces relative to `.. tabs::`, and any content within `group-tab` is further indented by at least 3 spaces relative to `.. group-tab::`.","cause":"Incorrect reStructuredText (RST) indentation or structure. `group-tab` (or `tab`) must be a child directive of `tabs` and correctly indented.","error":"(ERROR/3) Malformed tabs directive: \"group-tab\" must be preceded by \"tabs\" or similar indentation errors for tab directives."}]}