Custom Sphinx directives


class sphinx_gallery.directives.MiniGallery(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Custom directive to insert a mini-gallery

The required argument is one or more fully qualified names of objects, separated by spaces. The mini-gallery will be the subset of gallery examples that make use of that object (from that specific namespace).


  • add-heading adds a heading to the mini-gallery. If an argument is provided, it uses that text for the heading. Otherwise, it uses default text.

  • heading-level specifies the heading level of the heading as a single character. If omitted, the default heading level is ‘^’.