Sphinx build configuration#

This file contains configuration needed to customize Sphinx input and output behavior.

class sage_docbuild.conf.SagecodeTransform(document, startnode=None)#

Bases: SphinxTransform

Transform a code block to a live code block enabled by jupyter-sphinx.

Effectively a code block like:

EXAMPLE::

    sage: 1 + 1
    2

is transformed into:

EXAMPLE::

    sage: 1 + 1
    2

.. ONLY:: html

    .. JUPYTER-EXECUTE::
        :hide-code:
        :hide-output:
        :raises:
        :stderr:

        1 + 1

enabling live execution of the code.

apply()#
default_priority = 170#

Numerical priority of this transform, 0 through 999 (override).

class sage_docbuild.conf.Tags#

Bases: set

has(*args, **kwds)#

x.__contains__(y) <==> y in x.

sage_docbuild.conf.add_page_context(app, pagename, templatename, context, doctree)#
sage_docbuild.conf.call_intersphinx(app, env, node, contnode)#

Call intersphinx and make links between Sage manuals relative.

sage_docbuild.conf.check_nested_class_picklability(app, what, name, obj, skip, options)#

Print a warning if pickling is broken for nested classes.

sage_docbuild.conf.debug_inf(app, message)#

Try to find dangling link in local module imports or all.py.

sage_docbuild.conf.nitpick_patch_config(app)#

Patch the default config for nitpicky

Calling path_config ensure that nitpicky is not considered as a Sphinx environment variable but rather as a Sage environment variable. As a consequence, changing it doesn’t force the recompilation of the entire documentation.

sage_docbuild.conf.set_intersphinx_mappings(app, config)#

Add precompiled inventory (the objects.inv)

sage_docbuild.conf.setup(app)#
sage_docbuild.conf.skip_member(app, what, name, obj, skip, options)#

To suppress Sphinx warnings / errors, we

  • Don’t include [aliases of] builtins.

  • Don’t include the docstring for any nested class which has been inserted into its module by sage.misc.NestedClassMetaclass only for pickling. The class will be properly documented inside its surrounding class.

  • Optionally, check whether pickling is broken for nested classes.

  • Optionally, include objects whose name begins with an underscore (‘_’), i.e., “private” or “hidden” attributes, methods, etc.

Otherwise, we abide by Sphinx’s decision. Note: The object obj is excluded (included) if this handler returns True (False).