Note
This documentation is for a development version. Click here for the latest stable release (v1.2.2).
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:
- nengo_sphinx_theme.ext.resolvedefaults.test_func(param0=numpy.random, param1=<built-in method randint of numpy.random.mtrand.RandomState object at 0x7fb4f119d340>, param2=<class 'numpy.random.mtrand.RandomState'>, param4=RandomState(MT19937) at 0x7FB4E3F74A40)[source]¶
Test that setting various different object types as args renders nicely.
- class nengo_sphinx_theme.ext.resolvedefaults.TestClass(int_param=Default<1>, str_param=Default<'hello'>, module_param=numpy.random)[source]¶
For testing that defaults are properly rendered in docs.
Init method.
Test built-in functions and classes:
- nengo_sphinx_theme.ext.resolvedefaults.test_builtin_func()¶
time() -> floating point number
Return the current time in seconds since the Epoch. Fractions of a second may be present if the system clock provides them.
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.
|
This is a test function. |
This is a test class. |
|
alias of |
|
Automatically generates a summary for a class or module. |
|
|
Monkeypatch a function in autosummary to disallow module cycles. |
Mixin for adding renaming functionality to autodocumenters. |
|
|
Class autodocumenter with optional renaming. |
|
Function autodocumenter with optional renaming. |
|
Exception autodocumenter with optional renaming. |
|
Decorator autodocumenter with optional renaming. |
|
Method autodocumenter with optional renaming. |
- nengo_sphinx_theme.ext.renamed_autoautosummary.a_test_function()¶
This is a test function.
- nengo_sphinx_theme.ext.autoautosummary.TestClassAlias[source]¶
alias of
nengo_sphinx_theme.ext.renamed_autoautosummary.TestClass
- 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.
- option_spec = {'caption': <function unchanged_required>, 'exclude-members': <function unchanged>, 'nosignatures': <function flag>, 'recursive': <function flag>, 'template': <function unchanged>, 'toctree': <function unchanged>}¶
Mapping of option names to validator functions.
- required_arguments = 1¶
Number of required directive arguments.
- 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.
- 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_methodThis method will be manually added.
nengo_sphinx_theme.ext.renamed_autoautosummary.TestClass.a_methodThis is a method.
nengo_sphinx_theme.ext.renamed_autoautosummary.TestClass.a_static_methodThis is a static method.
- a_method()¶
This is a method.
- static a_static_method()¶
This is a static method.
- _a_private_method()¶
A private method.
- _another_private_method()¶
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.
This following link should redirect to nengo.ai.