Sphinx Panels

0.6.0 · active · verified Fri Apr 17

sphinx-panels is a Sphinx extension that enables creating responsive panel layouts in reStructuredText or MyST Markdown. It allows arranging content into cards, grids, and more, leveraging Bootstrap-like CSS. The current version is 0.6.0, with releases occurring intermittently based on feature development and bug fixes.

Common errors

Warnings

Install

Imports

Quickstart

To use sphinx-panels, first enable it in your Sphinx project's `conf.py` file by adding 'sphinx_panels' to the `extensions` list. Then, you can use directives like `.. grid::` or `.. panel::` in your reStructuredText or MyST Markdown files.

# conf.py
project = 'My Panel Project'
copyright = '2024, Your Name'

extensions = [
    'sphinx.ext.autodoc',
    'sphinx_panels' # Enable the extension
]

html_theme = 'alabaster'

# example.rst (or .md if using MyST)
# .. grid:: 1 2 2 3
#    :gutter: 2
#
#    .. grid-item-card:: Card Title 1
#       :shadow: sm
#
#       This is the content for the first card.
#
#    .. grid-item-card:: Card Title 2
#       :shadow: sm
#
#       This is the content for the second card.
#
#    .. grid-item-card:: Card Title 3
#       :shadow: sm
#
#       This is the content for the third card.

view raw JSON →