Navigation

  • index
  • modules |
  • next |
  • previous |
  • Sphinx-Gallery 0.2.0-git documentation »
  • Sphinx-Gallery API Reference »

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_binder_conf(binder_conf)¶

Check to make sure that the Binder configuration is correct.

sphinx_gallery.gen_gallery.check_duplicate_filenames(files)¶

Check for duplicate filenames across gallery directories.

sphinx_gallery.gen_gallery.clean_gallery_out(build_dir)¶

Deletes images under the sphx_glr namespace in the build directory

sphinx_gallery.gen_gallery.collect_gallery_files(examples_dirs)¶

Collect python files from the gallery example directories.

sphinx_gallery.gen_gallery.copy_binder_files(app, exception)¶

Copy all Binder requirements and notebooks files.

sphinx_gallery.gen_gallery.embed_code_links(app, exception)¶

Embed hyperlinks to documentation into example code

sphinx_gallery.gen_gallery.generate_dir_rst(src_dir, target_dir, gallery_conf, seen_backrefs)¶

Generate the gallery reStructuredText for an example directory

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.generate_zipfiles(gallery_dir)¶

Collects all Python source files and Jupyter notebooks in gallery_dir and makes zipfiles of them

Parameters:gallery_dir (str) – path of the gallery to collect downloadable sources
Returns:download_rst – RestructuredText to include download buttons to the generated files
Return type:str
sphinx_gallery.gen_gallery.get_default_config_value(key)¶
sphinx_gallery.gen_gallery.get_subsections(srcdir, examples_dir, sortkey)¶

Returns 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
  • sortkey (callable) – The sort key to use.
Returns:

out – sorted list of gallery subsection folder names

Return type:

list

sphinx_gallery.gen_gallery.glr_path_static()¶

Returns path to packaged static files

sphinx_gallery.gen_gallery.parse_config(app)¶

Process the Sphinx Gallery configuration

sphinx_gallery.gen_gallery.red(text)¶
sphinx_gallery.gen_gallery.setup(app)¶

Setup sphinx-gallery sphinx extension

sphinx_gallery.gen_gallery.setup_module()¶
sphinx_gallery.gen_gallery.sumarize_failing_examples(app, exception)¶

Collects the list of falling examples during build and prints them with the 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

Classes¶

class sphinx_gallery.gen_gallery.NumberOfCodeLinesSortKey(src_dir)¶

Sort examples in src_dir by the number of code lines.

Parameters:src_dir (str) – The source directory.

Exceptions¶

FileNotFoundError alias of IOError

Table Of Contents

  • sphinx_gallery.gen_gallery
    • Sphinx-Gallery Generator
      • Functions
      • Classes
      • Exceptions

Previous topic

Sphinx-Gallery API Reference

Next topic

sphinx_gallery.backreferences

This Page

  • Show Source

Quick search

Enter search terms or a module, class or function name.

Navigation

  • index
  • modules |
  • next |
  • previous |
  • Sphinx-Gallery 0.2.0-git documentation »
  • Sphinx-Gallery API Reference »
© Copyright 2014-2018, Óscar Nájera. Created using Sphinx 1.3.6.