sphinx_gallery.gen_gallery — Python documentation

# 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)

  Check for duplicate filenames across gallery directories.

`sphinx_gallery.gen_gallery.` `check_spaces_in_filenames`(files)

  Check for spaces in filenames across example directories.

`sphinx_gallery.gen_gallery.` `collect_gallery_files`(examples_dirs, gallery_conf)

  Collect python files from the gallery example directories.

`sphinx_gallery.gen_gallery.` `cost_name_key`(cost_name)

`sphinx_gallery.gen_gallery.` `generate_gallery_rst`(app)

  Generate the Main examples gallery reStructuredText

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

`sphinx_gallery.gen_gallery.` `get_default_config_value`(key)

`sphinx_gallery.gen_gallery.` `get_subsections`(srcdir, examples_dir, gallery_conf)

  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

`sphinx_gallery.gen_gallery.` `parse_config`(app)

  Process the Sphinx Gallery configuration

`sphinx_gallery.gen_gallery.` `setup`(app)

  Setup sphinx-gallery sphinx extension

`sphinx_gallery.gen_gallery.` `setup_module`()

`sphinx_gallery.gen_gallery.` `summarize_failing_examples`(app, exception)

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

  Raises ValueError if there where failing examples.

`sphinx_gallery.gen_gallery.` `touch_empty_backreferences`(app, what, name, obj, options, lines)

  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

`sphinx_gallery.gen_gallery.` `write_computation_times`(gallery_conf, target_dir, costs)

`sphinx_gallery.gen_gallery.` `write_junit_xml`(gallery_conf, target_dir, costs)