- Notifications
You must be signed in to change notification settings - Fork210
Sphinx extension for automatic generation of an example gallery
License
sphinx-gallery/sphinx-gallery
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
ASphinx extension that builds anHTML gallery of examples from any set of Python scripts.Check out thedocumentation for introductions on how to use it and more...
Sphinx-Gallery can be used to generate an example gallery from.py files,for a library,as well as a stand-alone web page showcasing examples of a particularPython package, module, or class.
- Let's get started with a simple example or check out the
- documentation for introductions on howto use it and more...
You can do a direct install viapip by using:
$ pip install sphinx-gallery
Tip
Sphinx-Gallery also has support for scraping images from Matplotliband Matplotlib-based packages such as Seaborn.We recommend installing systemoptipng binaries to reducethe file sizes of the generated PNG files.
Let's assume simple scenario, you have a Python package with a directory structure like this:
├── doc│ ├── conf.py│ ├── index.rst| ├── make.bat│ └── Makefile├── my_python_module│ ├── __init__.py│ └── mod.py└── examples ├── plot_example.py └── README.txt (or .rst)
Enable Sphinx-Gallery by adding the following to yourdoc/conf.py:
extensions= [ ...'sphinx_gallery.gen_gallery',]# path to the examples scriptssphinx_gallery_conf= {'examples_dirs':'../examples',# path to your example scripts'gallery_dirs':'auto_examples',# path to where to save gallery generated output}
Finally just compile your docs as usual.Sphinx-Gallery will generate reST files, adding execution outputs, and save them inauto_examples/.Add a link toauto_examples/index.rst to include the gallery in your documentation.
An incomplete list:
- Apache TVM
- auto-sklearn
- Biotite
- Cartopy
- FURY
- pyGIMLi
- HyperSpy
- kikuchipy
- Matplotlib
- MNE-Python
- napari
- Nestle
- NetworkX
- Neuraxle
- Nilearn
- OpenML
- OpenTURNS
- Optuna
- PlasmaPy
- POT
- PyGMT
- pyRiemann
- PyStruct
- PySurfer
- PyTorch tutorials
- PyVista
- pyxem
- RADIS
- scikit-image
- scikit-learn
- SimPEG
- SKADA Scikit-adaptation
- Sphinx-Gallery
- SunPy
- Tonic
- TorchDR
- TorchIO
You can get the latest development source from ourGithub repository. You needsetuptools installed in your system to install Sphinx-Gallery. For example,you can do:
$git clone https://github.com/sphinx-gallery/sphinx-gallery$cd sphinx-gallery$conda install graphviz# if using conda, you can get graphviz this way$pip install -e .[dev]
Check that you are all set by running:
$pytest sphinx_galleryIf you would like to cite Sphinx-Gallery you can do so using ourZenododeposit.
About
Sphinx extension for automatic generation of an example gallery
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
