{% set permalink = ("Link" if sphinx_version >= (7, 2) else 'Permalink') -%} {% set heading = ("heading" if sphinx_version >= (5, 0) else 'headline') -%} {% set sig_prename_tag=("span" if sphinx_version >= (4, 0) else 'code') -%} {% set sig_object_class_std=(' class="sig sig-object std"' if sphinx_version >= (4, 0) else '') -%} {% set sig_object_class_py=(' class="sig sig-object py"' if sphinx_version >= (4, 0) else '') -%} = (7, 2) %} data-content_root="./"{% endif %}{% if sphinx_version >= (5, 0) %} lang="en"{% endif %}> {% if docutils_version[1] == 18 %} {% elif docutils_version[1] == 17 %} {% elif docutils_version[1] == 19 %} {% elif docutils_version[1] >= 20 %} {% endif %} sphinx-toolbox Demo - :sourcelink: — Python documentation {% if sphinx_version >= (7, 2) %} {% if sphinx_version < (6, 0) %} {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} {% if sphinx_version >= (5, 2) %} {% endif %}

sphinx-toolbox Demo - :sourcelink: ¶

Source code: autotypeddict_demo.py


Demo of .. autotypeddict::

typeddict <{{ sig_prename_tag }} class="sig-prename descclassname"> autotypeddict_demo. <{{ sig_prename_tag }} class="sig-name descname"> Animal [source]

Optional keys common to all animals.

Required Keys{% if docutils_version >= (0, 18) %} : {% endif %}
  • name ( str ) – The name of the animal

Optional Keys{% if docutils_version >= (0, 18) %} : {% endif %}
  • voice ( str ) – The animal’s voice.

typeddict <{{ sig_prename_tag }} class="sig-prename descclassname"> autotypeddict_demo. <{{ sig_prename_tag }} class="sig-name descname"> Bird [source]

A bird.

Required Keys{% if docutils_version >= (0, 18) %} : {% endif %}
  • egg_size ( float ) – The size of the bird’s egg, in mm.

  • name ( str ) – The name of the animal

Optional Keys{% if docutils_version >= (0, 18) %} : {% endif %}
  • voice ( str ) – The animal’s voice.

typeddict <{{ sig_prename_tag }} class="sig-prename descclassname"> autotypeddict_demo. <{{ sig_prename_tag }} class="sig-name descname"> Cat [source]

A cat.

Required Keys{% if docutils_version >= (0, 18) %} : {% endif %}
  • fur_color ( str ) – The colour of the cat’s fur.

  • name ( str ) – The name of the animal

Optional Keys{% if docutils_version >= (0, 18) %} : {% endif %}
  • voice ( str ) – The animal’s voice.

typeddict <{{ sig_prename_tag }} class="sig-prename descclassname"> autotypeddict_demo. <{{ sig_prename_tag }} class="sig-name descname"> Movie [source]

Represents a movie.

Required Keys{% if docutils_version >= (0, 18) %} : {% endif %}
  • name ( str ) – The name of the animal

  • year ( int ) – The movie’s release year.

  • based_on ( str )

{% if sphinx_version >= (7, 2) %}

{% else %}

{% endif %} Source code: sphinx_toolbox/more_autosummary/__init__.py


Extensions to sphinx.ext.autosummary .

Provides an enhanced version of https://autodocsumm.readthedocs.io/ which respects the autodoc member-order option. This can be given for an individual directive, in the autodoc_member_order configuration value, or via autodocsumm_member_order .

Also patches sphinx.ext.autosummary.Autosummary to fix an issue where the module name is sometimes duplicated. I.e. foo.bar.baz() became foo.bar.foo.bar.baz() , which of course doesn’t exist and created a broken link.

{% if sphinx_version >= (7, 3) %}Added{% else %}New{% endif %} in version 0.7.0.

Changed in version 1.3.0: Autosummary now selects the appropriate documenter for attributes rather than falling back to DataDocumenter .

Changed in version 2.13.0: Also patches sphinx.ext.autodoc.ModuleDocumenter to fix an issue where __all__ is not respected for autosummary tables.

Configuration ¶

<{{ sig_prename_tag }} class="sig-name descname"> autodocsumm_member_order ¶
Type: str
Default: 'alphabetical'

Determines the sort order of members in autodocsumm summary tables. Valid values are 'alphabetical' and 'bysource' .

Note that for 'bysource' the module must be a Python module with the source code available.

The member order can also be set on a per-directive basis using the :member-order: [order] option. This applies not only to automodule etc. directives, but also to automodulesumm etc. directives.

<{{ sig_prename_tag }} class="sig-name descname"> autosummary_col_type ¶
Type: str
Default: '\X'

The LaTeX column type to use for autosummary tables.

Custom columns can be defined in the LaTeX preamble for use with this option.

For example:

latex_elements["preamble"] = r'''
    \makeatletter
    \newcolumntype{\Xx}[2]{>{\raggedright\arraybackslash}p{\dimexpr
        (\linewidth-\arrayrulewidth)*#1/#2-\tw@\tabcolsep-\arrayrulewidth\relax}}
    \makeatother
    '''

autosummary_col_type = "\\Xx"

{% if sphinx_version >= (7, 3) %}Added{% else %}New{% endif %} in version 2.13.0.

API Reference ¶