Metadata-Version: 2.1
Name: sphinx-code-tabs
Version: 0.0.1
Summary: Sphinx extension for adding alternative code-blocks as selectable tabs
Home-page: https://github.com/coldfix/sphinx-code-tabs
Author: Thomas Gläßle
Author-email: thomas@coldfix.de
License: Unlicense
Download-URL: https://pypi.org/project/sphinx_code_tabs
Keywords: sphinx extension alternative code-block tab notebook
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Plugins
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: The Unlicense (Unlicense)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Documentation :: Sphinx
Requires-Python: >=3.5
Description-Content-Type: text/x-rst
Requires-Dist: sphinx (>=3)
Requires-Dist: importlib-resources ; python_version < "3.7"

sphinx code tabs
================

This is a Sphinx extension that adds a directive ``code-tabs`` that creates a
navbar above several alternative code blocks, allowing the user to switch
between them.


Installation
------------

.. code-block:: bash

    pip install sphinx_code_tabs

To enable the extension in sphinx, simply add the package name in your
``conf.py`` to the list of ``extensions``:

.. code-block:: python

    extensions = [
        ...
        'sphinx_code_tabs',
    ]


Usage
-----

The ``code-tabs`` directive declares a notebook of code block alternatives.
The individual tabs must be created with the ``code-tab`` directive which
derives from ``code-block`` and accepts all of its arguments.

For example:

.. code-block:: rst

    .. code-tabs::

        .. code-tab:: bash
            :title: bash

            echo "Hello, World!"

        .. code-tab:: c
            :title: C/C++
            :emphasize-lines: 2

            #include <stdio.h>
            int main() { printf("Hello, world!\n"); }

        .. code-tab:: python
            :title: python

            print("Hello, world!")


