Extension tests

This page tests the extensions that are part of this theme.

Versioning

This extension is always used if releases are passed to the Sphinx build.

Deeply nested test page versioned links work properly.

Default resolution

This extension can be enabled by adding "nengo_sphinx_theme.ext.resolvedefaults" to the extensions list in conf.py.

Autodoc with default resolution:

class nengo_sphinx_theme.ext.resolvedefaults.TestClass(self, int_param=Default<1>, str_param=Default<'hello'>)[source]

For testing that defaults are properly rendered in docs.

AutoAutoSummary

This extension automatically generates AutoSummaries for modules/classes.

This extension can be enabled by adding "nengo_sphinx_theme.ext.autoautosummary" to the extensions list in conf.py.

nengo_sphinx_theme.ext.renamed_autoautosummary.a_test_function()

This is a test function.

nengo_sphinx_theme.ext.renamed_autoautosummary.TestClass()

This is a test class.

nengo_sphinx_theme.ext.autoautosummary.AutoAutoSummary(…)

Automatically generates a summary for a class or module.

nengo_sphinx_theme.ext.autoautosummary.patch_autosummary_import_by_name()

Monkeypatch a function in autosummary to disallow module cycles

nengo_sphinx_theme.ext.autoautosummary.RenameMixin

Mixin for adding renaming functionality to autodocumenters.

nengo_sphinx_theme.ext.autoautosummary.RenameClassDocumenter(*args)

Class autodocumenter with optional renaming.

nengo_sphinx_theme.ext.autoautosummary.RenameFunctionDocumenter(…)

Function autodocumenter with optional renaming.

nengo_sphinx_theme.ext.autoautosummary.RenameExceptionDocumenter(*args)

Exception autodocumenter with optional renaming.

nengo_sphinx_theme.ext.autoautosummary.RenameDecoratorDocumenter(…)

Decorator autodocumenter with optional renaming.

nengo_sphinx_theme.ext.autoautosummary.RenameMethodDocumenter(…)

Method autodocumenter with optional renaming.

nengo_sphinx_theme.ext.renamed_autoautosummary.a_test_function()

This is a test function.

class nengo_sphinx_theme.ext.autoautosummary.AutoAutoSummary(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Automatically generates a summary for a class or module.

For classes this adds a summary for all methods.

For modules this adds a summary for all classes/functions.

nengo_sphinx_theme.ext.autoautosummary.patch_autosummary_import_by_name()[source]

Monkeypatch a function in autosummary to disallow module cycles

class nengo_sphinx_theme.ext.autoautosummary.RenameMixin[source]

Mixin for adding renaming functionality to autodocumenters.

add_directive_header(self, sig)[source]

Change the modname so that :module: renamed_module is added in the header.

class nengo_sphinx_theme.ext.autoautosummary.RenameClassDocumenter(*args)[source]

Class autodocumenter with optional renaming.

class nengo_sphinx_theme.ext.autoautosummary.RenameFunctionDocumenter(directive, name, indent='')[source]

Function autodocumenter with optional renaming.

class nengo_sphinx_theme.ext.autoautosummary.RenameExceptionDocumenter(*args)[source]

Exception autodocumenter with optional renaming.

class nengo_sphinx_theme.ext.autoautosummary.RenameDecoratorDocumenter(directive, name, indent='')[source]

Decorator autodocumenter with optional renaming.

class nengo_sphinx_theme.ext.autoautosummary.RenameMethodDocumenter(directive, name, indent='')[source]

Method autodocumenter with optional renaming.

class nengo_sphinx_theme.ext.renamed_autoautosummary.TestClass

This is a test class.

This is the init method.

nengo_sphinx_theme.ext.renamed_autoautosummary.TestClass._another_private_method

This method will be manually added.

nengo_sphinx_theme.ext.renamed_autoautosummary.TestClass.a_method

This is a method.

nengo_sphinx_theme.ext.renamed_autoautosummary.TestClass.a_static_method

This is a static method.

a_method(self)

This is a method.

static a_static_method()

This is a static method.

_a_private_method(self)

A private method.

_another_private_method(self)

This method will be manually added.

Redirects

This extension generates pages to redirect a URL from an old location to a new one. These pages will only be generated when building with the HTML builder.

This extension can be enabled by adding "nengo_sphinx_theme.ext.redirects" to the extensions list in conf.py.

This extension adds a new configuration option to conf.py called html_redirects. html_redirects is a list of tuples, where each tuple has two elements: the original location and the new location. Locations are usually strings pointing to HTML files, but the new location can also be an anchor link or some other valid URL.

As an example, suppose we rename a file from user_guide.rst to user-guide.rst, and move the content on dev_guide.rst to a section in user-guide.rst. The redirects might look like this:

html_redirects = [
    ("user_guide.html", "user-guide.html"),
    ("dev_guide.html", "user-guide.html#developers")
]

The following page should redirect to the deeply nested testing page.

Backoff

Monkeypatches the Sphinx HTTP request functions to add exponential backoff.

The main use case for this is to avoid server-side rejections caused by too many requests when running the linkchecker.