Skip to main content

A Sphinx extension that builds galleries of examples from any set of myst-style markdown/notebook or rst files.

Project description

MyST Sphinx Gallery is a Sphinx extension that builds a Sphinx Gallery from MyST Markdown/Notebook or RST files.

docs/source/_static/gallery_example.png

Documentation

The detailed documentation is available at: https://myst-sphinx-gallery.readthedocs.io/en/latest/

Quick Start

Installation

MyST Sphinx Gallery is a Python package, and requires Python >= 3.8. You can install the latest release using pip from the PyPI:

pip install myst_sphinx_gallery

Configure and usages

To use MyST Sphinx Gallery, you need to add the following code to the Sphinx conf.py file:

from pathlib import Path

from myst_sphinx_gallery import GalleryConfig, generate_gallery

myst_sphinx_gallery_config = GalleryConfig(
    examples_dirs="../../examples",
    gallery_dirs="auto_examples",
    root_dir=Path(__file__).parent,
    notebook_thumbnail_strategy="code",
)
generate_gallery(myst_sphinx_gallery_config)

Construct the examples folder

To generate the gallery, you need to create a well-structured examples folder. The detailed documentation of structuring files for gallery is available at: Structuring files for Gallery.

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

myst_sphinx_gallery-0.1.1.tar.gz (18.8 kB view hashes)

Uploaded Source

Built Distribution

myst_sphinx_gallery-0.1.1-py3-none-any.whl (17.3 kB view hashes)

Uploaded Python 3

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