Sphinx-Gallery
0.8.2
Versions v: stable
Versions
dev
stable

Using Sphinx Gallery

  • Getting Started with Sphinx-Gallery
  • How to structure your Python scripts for Sphinx-Gallery
  • Configuration
  • Who uses Sphinx-Gallery

Advanced usage and information

  • Advanced usage
  • Frequently Asked Questions
  • Sphinx-Gallery Utilities

Example galleries

  • Gallery of Examples
  • Notebook style example
  • Gallery of Examples using Mayavi

API and developer reference

  • Sphinx-Gallery API Reference
    • Sphinx Gallery
    • sphinx_gallery.gen_gallery
      • Sphinx-Gallery Generator
        • Functions
        • Classes
    • sphinx_gallery.backreferences
    • sphinx_gallery.gen_rst
    • sphinx_gallery.scrapers
    • sphinx_gallery.py_source_parser
    • sphinx_gallery.docs_resolv
    • sphinx_gallery.notebook
    • sphinx_gallery.downloads
    • sphinx_gallery.sorting
    • sphinx_gallery.binder
    • sphinx_gallery.directives
    • Utilities
    • sphinx_gallery.utils.optipng
  • Change Log
  • Fork Sphinx-Gallery on Github
Sphinx-Gallery
  • Docs »
  • Sphinx-Gallery API Reference »
  • sphinx_gallery.gen_gallery

sphinx_gallery.gen_gallery¶

Sphinx-Gallery Generator¶

Attaches Sphinx-Gallery to Sphinx in order to generate the galleries when building the documentation.

Functions¶

sphinx_gallery.gen_gallery.check_duplicate_filenames(files)[source]¶

Check for duplicate filenames across gallery directories.

Examples using sphinx_gallery.gen_gallery.check_duplicate_filenames¶

sphinx_gallery.gen_gallery.check_spaces_in_filenames(files)[source]¶

Check for spaces in filenames across example directories.

Examples using sphinx_gallery.gen_gallery.check_spaces_in_filenames¶

sphinx_gallery.gen_gallery.collect_gallery_files(examples_dirs, gallery_conf)[source]¶

Collect python files from the gallery example directories.

Examples using sphinx_gallery.gen_gallery.collect_gallery_files¶

sphinx_gallery.gen_gallery.cost_name_key(cost_name)[source]¶

Examples using sphinx_gallery.gen_gallery.cost_name_key¶

sphinx_gallery.gen_gallery.generate_gallery_rst(app)[source]¶

Generate the Main examples gallery reStructuredText

Start the Sphinx-Gallery configuration and recursively scan the examples directories in order to populate the examples gallery

Examples using sphinx_gallery.gen_gallery.generate_gallery_rst¶

sphinx_gallery.gen_gallery.get_default_config_value(key)[source]¶

Examples using sphinx_gallery.gen_gallery.get_default_config_value¶

sphinx_gallery.gen_gallery.get_subsections(srcdir, examples_dir, gallery_conf)[source]¶

Return the list of subsections of a gallery.

Parameters
  • srcdir (str) – absolute path to directory containing conf.py

  • examples_dir (str) – path to the examples directory relative to conf.py

  • gallery_conf (dict) – The gallery configuration.

Returns

out – sorted list of gallery subsection folder names

Return type

list

Examples using sphinx_gallery.gen_gallery.get_subsections¶

sphinx_gallery.gen_gallery.parse_config(app)[source]¶

Process the Sphinx Gallery configuration.

Examples using sphinx_gallery.gen_gallery.parse_config¶

sphinx_gallery.gen_gallery.setup(app)[source]¶

Setup Sphinx-Gallery sphinx extension

Examples using sphinx_gallery.gen_gallery.setup¶

sphinx_gallery.gen_gallery.setup_module()[source]¶

Examples using sphinx_gallery.gen_gallery.setup_module¶

sphinx_gallery.gen_gallery.summarize_failing_examples(app, exception)[source]¶

Collects the list of falling examples and prints them with a traceback.

Raises ValueError if there where failing examples.

Examples using sphinx_gallery.gen_gallery.summarize_failing_examples¶

sphinx_gallery.gen_gallery.touch_empty_backreferences(app, what, name, obj, options, lines)[source]¶

Generate empty back-reference example files.

This avoids inclusion errors/warnings if there are no gallery examples for a class / module that is being parsed by autodoc

Examples using sphinx_gallery.gen_gallery.touch_empty_backreferences¶

sphinx_gallery.gen_gallery.write_computation_times(gallery_conf, target_dir, costs)[source]¶

Examples using sphinx_gallery.gen_gallery.write_computation_times¶

sphinx_gallery.gen_gallery.write_junit_xml(gallery_conf, target_dir, costs)[source]¶

Examples using sphinx_gallery.gen_gallery.write_junit_xml¶

Classes¶

class sphinx_gallery.gen_gallery.DefaultResetArgv[source]¶

Examples using sphinx_gallery.gen_gallery.DefaultResetArgv¶

Next Previous

© Copyright 2014-2020, Sphinx-gallery developers

Built with Sphinx using a theme provided by Read the Docs.