Skip to main content

A sphinx extension for creating panels in a grid layout.

Project description

sphinx-panels

Doc Status Code style: black PyPI

A sphinx extension for creating document components optimised for HTML+CSS.

  • The panels directive creates panels of content in a grid layout, utilising both the Bootstrap 4 grid system, and cards layout.

  • The link-button directive creates a click-able button, linking to a URL or reference, and can also be used to make an entire panel click-able.

  • The dropdown directive creates toggle-able content.

  • The tabbed directive creates tabbed content.

  • opticon and fa (fontawesome) roles allow for inline icons to be added.

.. panels::

    Content of the top-left panel

    ---

    Content of the top-right panel

    ---

    Content of the bottom-left panel

    ---

    Content of the bottom-right panel

The link-button directive can be used to create buttons, which link to a URL (default) or reference. They can be styled by Bootstrap button classes:

.. panels::

    .. link-button:: https://example.com
        :type: url
        :tooltip: hallo
        :classes: btn-success

    ---

    This entire panel is clickable.

    +++

    .. link-button:: panels/usage
        :type: ref
        :text: Go To Reference
        :classes: btn-outline-primary btn-block stretched-link

The dropdown directive combines a Bootstrap card with the HTML details tag to create a collapsible drop-down panel.

.. dropdown:: Click on me to see my content!

    I'm the content which can be anything:

    .. link-button:: https://example.com
        :text: Like a Button
        :classes: btn-primary

Development

To run the tests:

pip install tox
tox -e py37-sphinx3

To test building the docs:

tox -e docs-clean html
tox -e docs-rebuild html

For live builds of the docs:

tox -e docs-live html

You can also build the docs in different themes, by setting HTML_THEME to one of alabaster, sphinx_rtd_theme, pydata_sphinx_theme, sphinx_book_theme:

export HTML_THEME=sphinx_book_theme
tox -e docs-live

For code style and SCSS -> CSS updating:

pip install pre-commit
pre-commit run --all

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx-panels-0.5.2.tar.gz (84.1 kB view details)

Uploaded Source

Built Distribution

sphinx_panels-0.5.2-py3-none-any.whl (87.8 kB view details)

Uploaded Python 3

File details

Details for the file sphinx-panels-0.5.2.tar.gz.

File metadata

  • Download URL: sphinx-panels-0.5.2.tar.gz
  • Upload date:
  • Size: 84.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for sphinx-panels-0.5.2.tar.gz
Algorithm Hash digest
SHA256 b7b3faa05f37b7318fd14cd85c4effa1ab905dfc8bed236a63978565ea461ae4
MD5 d44fbb7c8ec3659fc34b4276580e769c
BLAKE2b-256 41d80710660dfcf4fc6b178dd0fa749e72ca34b747d3b43c12eb9745d4b0074f

See more details on using hashes here.

File details

Details for the file sphinx_panels-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: sphinx_panels-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 87.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for sphinx_panels-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2b2e18448b0494e7a232d6c7dfb9aa3982e7aeb92aeea7d1b146e34e9261d2f1
MD5 c611c8172caa4c26a6ab2c39d7123013
BLAKE2b-256 6b2ed1c2f2095bffe0830017a07c7047db357cc0ae31d770e70c4ec6802fd4e1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page