sphinx API reference
400 public APIs from sphinx (sphinx-doc/sphinx) — 173 classes, 91 functions, 136 methods. Signatures extracted by static analysis of the actual source.
Repository: sphinx-doc/sphinx
| Kind | Count |
|---|---|
| Classes | 173 |
| Functions | 91 |
| Methods | 136 |
API list
func
sphinx._cli.util.colour.terminal_supports_colour() -> boolReturn True if coloured terminal output is supported.
func
sphinx._cli.util.errors.format_traceback(exception:BaseException, *short_traceback:bool=False) -> strFormat the given exception's traceback.
func
sphinx._cli.util.errors.strip_escape_sequences(text:str) -> strRemove the ANSI CSI colors and "erase in line" sequences.
func
sphinx._cli.util.errors.terminal_safe(s:str) -> strSafely encode a string for printing to the terminal.
func
sphinx._cli.util.errors.write_temporary_file(content:str) -> strWrite content to a temporary file and return the filename.
class
sphinx.addnodes.acksSpecial node for "acks" lists.
class
sphinx.addnodes.centeredDeprecated.
class
sphinx.addnodes.compact_paragraphNode for a compact paragraph (which never makes a <p> node).
class
sphinx.addnodes.desc_addnameNode for additional name parts for an object.
class
sphinx.addnodes.desc_annotationNode for signature annotations (not Python 3-style annotations).
class
sphinx.addnodes.desc_contentNode for object description content.
class
sphinx.addnodes.desc_inlineNode for a signature fragment in inline text.
class
sphinx.addnodes.desc_nameNode for the main object name.
class
sphinx.addnodes.desc_optionalNode for marking optional parts of the parameter list.
class
sphinx.addnodes.desc_parameterNode for a single parameter.
class
sphinx.addnodes.desc_parameterlistNode for a general parameter list.
class
sphinx.addnodes.desc_returnsNode for a "returns" annotation (a la -> in Python).
class
sphinx.addnodes.desc_sig_elementCommon parent class of nodes for inline text of a signature.
class
sphinx.addnodes.desc_sig_keywordNode for a general keyword in a signature.
class
sphinx.addnodes.desc_sig_keyword_typeNode for a keyword which is a built-in type in a signature.
class
sphinx.addnodes.desc_sig_literal_charNode for a character literal in a signature.
class
sphinx.addnodes.desc_sig_literal_numberNode for a numeric literal in a signature.
class
sphinx.addnodes.desc_sig_literal_stringNode for a string literal in a signature.
class
sphinx.addnodes.desc_sig_nameNode for an identifier in a signature.
class
sphinx.addnodes.desc_sig_operatorNode for an operator in a signature.
class
sphinx.addnodes.desc_sig_punctuationNode for punctuation in a signature.
class
sphinx.addnodes.desc_sig_spaceNode for a space in a signature.
class
sphinx.addnodes.desc_signatureNode for a single object signature.
class
sphinx.addnodes.desc_signature_lineNode for a line in a multi-line object signature.
class
sphinx.addnodes.desc_typeNode for return types or object type names.
class
sphinx.addnodes.desc_type_parameterNode for a single type parameter.
class
sphinx.addnodes.desc_type_parameter_listNode for a general type parameter list.
class
sphinx.addnodes.download_referenceNode for download references, similar to pending_xref.
class
sphinx.addnodes.glossaryNode to insert a glossary.
class
sphinx.addnodes.hlistNode for "horizontal lists", i.e.
class
sphinx.addnodes.hlistcolNode for one column in a horizontal list.
class
sphinx.addnodes.indexNode for index entries.
class
sphinx.addnodes.manpageNode for references to manpages.
class
sphinx.addnodes.not_smartquotableA node which does not support smart-quotes.
class
sphinx.addnodes.number_referenceNode for number references, similar to pending_xref.
class
sphinx.addnodes.onlyNode for "only" directives (conditional inclusion based on tags).
class
sphinx.addnodes.productionNode for a single grammar production rule.
class
sphinx.addnodes.productionlistNode for grammar production lists.
class
sphinx.addnodes.seealsoCustom "see also" admonition.
class
sphinx.addnodes.tabular_col_specNode for specifying tabular columns, used for LaTeX output.
class
sphinx.addnodes.toctreeNode for inserting a "TOC tree".
class
sphinx.addnodes.translatableNode which supports translation.
method
sphinx.addnodes.translatable.apply_translated_message(original_message:str, translated_message:str) -> NoneApply translated message.
method
sphinx.addnodes.translatable.extract_original_messages() -> Sequence[str]Extract translation messages.
method
sphinx.addnodes.translatable.preserve_original_messages() -> NonePreserve original translatable messages.
class
sphinx.addnodes.versionmodifiedNode for version change entries.
class
sphinx.application.SphinxThe main application class and extensibility interface.
method
sphinx.application.Sphinx.add_autodocumenter(cls:type[Documenter], override:bool=False) -> NoneRegister a new documenter class for the autodoc extension.
method
sphinx.application.Sphinx.add_builder(builder:type[Builder], override:bool=False) -> NoneRegister a new builder.
method
sphinx.application.Sphinx.add_config_value(name:str, default:Any, rebuild:_ConfigRebuild, types:type | Collection[type] | ENUM=(), description:str='') -> NoneRegister a configuration value.
method
sphinx.application.Sphinx.add_crossref_type(directivename:str, rolename:str, indextemplate:str='', ref_nodeclass:type[nodes.TextElement] | None=None, objname:str='', override:bool=False) -> NoneRegister a new crossref object type.
method
sphinx.application.Sphinx.add_css_file(filename:str, priority:int=500, **kwargs:Any) -> NoneRegister a stylesheet to include in the HTML output.
method
sphinx.application.Sphinx.add_directive(name:str, cls:type[Directive], override:bool=False) -> NoneRegister a Docutils directive.
method
sphinx.application.Sphinx.add_directive_to_domain(domain:str, name:str, cls:type[Directive], override:bool=False) -> NoneRegister a Docutils directive in a domain.
method
sphinx.application.Sphinx.add_domain(domain:type[Domain], override:bool=False) -> NoneRegister a domain.
method
sphinx.application.Sphinx.add_env_collector(collector:type[EnvironmentCollector]) -> NoneRegister an environment collector class.
method
sphinx.application.Sphinx.add_event(name:str) -> NoneRegister an event called *name*.
method
sphinx.application.Sphinx.add_generic_role(name:str, nodeclass:type[Node], override:bool=False) -> NoneRegister a generic Docutils role.
method
sphinx.application.Sphinx.add_html_math_renderer(name:str, inline_renderers:_MathsInlineRenderers | None=None, block_renderers:_MathsBlockRenderers | None=None) -> NoneRegister a math renderer for HTML.
method
sphinx.application.Sphinx.add_html_theme(name:str, theme_path:str | os.PathLike[str]) -> NoneRegister a HTML Theme.
method
sphinx.application.Sphinx.add_index_to_domain(domain:str, index:type[Index], _override:bool=False) -> NoneRegister a custom index for a domain.
method
sphinx.application.Sphinx.add_latex_package(packagename:str, options:str | None=None, after_hyperref:bool=False) -> NoneRegister a package to include in the LaTeX source code.
method
sphinx.application.Sphinx.add_lexer(alias:str, lexer:type[Lexer]) -> NoneRegister a new lexer for source code.
method
sphinx.application.Sphinx.add_message_catalog(catalog:str, locale_dir:str | os.PathLike[str]) -> NoneRegister a message catalog.
method
sphinx.application.Sphinx.add_node(node:type[Element], override:bool=False, **kwargs:_NodeHandlerPair) -> NoneRegister a Docutils node class.
method
sphinx.application.Sphinx.add_post_transform(transform:type[Transform]) -> NoneRegister a Docutils transform to be applied before writing.
method
sphinx.application.Sphinx.add_role(name:str, role:Any, override:bool=False) -> NoneRegister a Docutils role.
method
sphinx.application.Sphinx.add_role_to_domain(domain:str, name:str, role:RoleFunction | XRefRole, override:bool=False) -> NoneRegister a Docutils role in a domain.
method
sphinx.application.Sphinx.add_search_language(cls:type[SearchLanguage]) -> NoneRegister a new language for the HTML search index.
method
sphinx.application.Sphinx.add_source_parser(parser:type[Parser], override:bool=False) -> NoneRegister a parser class.
method
sphinx.application.Sphinx.add_source_suffix(suffix:str, filetype:str, override:bool=False) -> NoneRegister a suffix of source files.
method
sphinx.application.Sphinx.add_static_dir(path:str | os.PathLike[str]) -> NoneRegister a static directory to include in HTML output.
method
sphinx.application.Sphinx.add_transform(transform:type[Transform]) -> NoneRegister a Docutils transform to be applied after parsing.
method
sphinx.application.Sphinx.disconnect(listener_id:int) -> NoneUnregister callback by *listener_id*.
method
sphinx.application.Sphinx.emit(event:str, *allowed_exceptions:tuple[type[Exception], ...]=(), *args:Any) -> list[Any]Emit *event* and pass *arguments* to the callback functions.
method
sphinx.application.Sphinx.is_parallel_allowed(typ:str) -> boolCheck whether parallel processing is allowed or not.
method
sphinx.application.Sphinx.require_sphinx(version:tuple[int, int] | str) -> NoneCheck the Sphinx version if requested.
method
sphinx.application.Sphinx.set_html_assets_policy(policy:Literal['always', 'per_page']) -> NoneSet the policy to include assets in HTML pages.
method
sphinx.application.Sphinx.set_translator(name:str, translator_class:type[nodes.NodeVisitor], override:bool=False) -> NoneRegister or override a Docutils translator class.
method
sphinx.application.Sphinx.setup_extension(extname:str) -> NoneImport and setup a Sphinx extension module.
class
sphinx.builders.BuilderBuilds target formats from the reST sources.
method
sphinx.builders.Builder.build_all() -> NoneBuild all source files.
method
sphinx.builders.Builder.build_specific(filenames:Sequence[Path]) -> NoneOnly rebuild as much as needed for changes in the *filenames*.
method
sphinx.builders.Builder.build_update() -> NoneOnly rebuild what was changed or added since last build.
method
sphinx.builders.Builder.cleanup() -> NoneCleanup any resources.
method
sphinx.builders.Builder.create_template_bridge() -> NoneReturn the template bridge configured.
method
sphinx.builders.Builder.create_translator(*args:Any) -> nodes.NodeVisitorReturn an instance of translator.
method
sphinx.builders.Builder.finish() -> NoneFinish the building process.
method
sphinx.builders.Builder.get_asset_paths() -> list[str]Return list of paths for assets (ex.
method
sphinx.builders.Builder.get_builder_config(option:str, default:str) -> AnyReturn a builder specific option.
method
sphinx.builders.Builder.get_relative_uri(from_:str, to:str, typ:str | None=None) -> strReturn a relative URI between two source filenames.
method
sphinx.builders.Builder.get_target_uri(docname:str, typ:str | None=None) -> strReturn the target URI for a document name.
method
sphinx.builders.Builder.get_translator_class(*args:Any) -> type[nodes.NodeVisitor]Return a class of translator.
method
sphinx.builders.Builder.init() -> NoneLoad necessary templates and perform initialization.
method
sphinx.builders.Builder.post_process_images(doctree:Node) -> NonePick the best candidate for all image URIs.
method
sphinx.builders.Builder.prepare_writing(docnames:Set[str]) -> NoneA place where you can add logic before :meth:`write_doc` is run
method
sphinx.builders.Builder.read() -> list[str](Re-)read all files new or changed since last update.
method
sphinx.builders.Builder.read_doc(docname:str, *_cache:bool=True) -> NoneParse a file and add/update inventory entries for the doctree.
method
sphinx.builders.Builder.write(build_docnames:Iterable[str] | None, updated_docnames:Iterable[str], method:Literal['all', 'specific', 'update']='update') -> NoneWrite builder specific output files.
method
sphinx.builders.Builder.write_documents(docnames:Set[str]) -> NoneWrite all documents in *docnames*.
class
sphinx.builders._epub_base.EpubBuilderBuilder that outputs epub files.
method
sphinx.builders._epub_base.EpubBuilder.add_visible_links(tree:nodes.document, show_urls:str='inline') -> NoneAdd visible link targets for external links
method
sphinx.builders._epub_base.EpubBuilder.build_container(outname:str='META-INF/container.xml') -> NoneWrite the metainfo file META-INF/container.xml.
method
sphinx.builders._epub_base.EpubBuilder.build_epub() -> NoneWrite the epub file.
method
sphinx.builders._epub_base.EpubBuilder.build_mimetype() -> NoneWrite the metainfo file mimetype.
method
sphinx.builders._epub_base.EpubBuilder.build_navpoints(nodes:list[dict[str, Any]]) -> list[NavPoint]Create the toc navigation structure.
method
sphinx.builders._epub_base.EpubBuilder.build_toc() -> NoneWrite the metainfo file toc.ncx.
method
sphinx.builders._epub_base.EpubBuilder.copy_image_files() -> NoneCopy image files to destination directory.
method
sphinx.builders._epub_base.EpubBuilder.copy_image_files_pil() -> NoneCopy images using Pillow, the Python Imaging Library.
method
sphinx.builders._epub_base.EpubBuilder.fix_fragment(prefix:str, fragment:str) -> strReturn a href/id attribute with colons replaced by hyphens.
method
sphinx.builders._epub_base.EpubBuilder.fix_genindex(tree:list[tuple[str, list[tuple[str, Any]]]]) -> NoneFix href attributes for genindex pages.
method
sphinx.builders._epub_base.EpubBuilder.fix_ids(tree:nodes.document) -> NoneReplace colons with hyphens in href and id attributes.
method
sphinx.builders._epub_base.EpubBuilder.handle_page(pagename:str, addctx:dict[str, Any], templatename:str='page.html', *outfilename:Path | None=None, *event_arg:Any=None) -> NoneCreate a rendered page.
method
sphinx.builders._epub_base.EpubBuilder.is_vector_graphics(filename:str) -> boolDoes the filename extension indicate a vector graphic format?
method
sphinx.builders._epub_base.EpubBuilder.make_id(name:str) -> strReturn a unique id for name.
method
sphinx.builders._epub_base.EpubBuilder.new_navpoint(node:dict[str, Any], level:int, incr:bool=True) -> NavPointCreate a new entry in the toc from the node at given level.
method
sphinx.builders._epub_base.EpubBuilder.toc_add_files(refnodes:list[dict[str, Any]]) -> NoneAdd the root_doc, pre and post files to a list of refnodes.
method
sphinx.builders._epub_base.EpubBuilder.write_doc(docname:str, doctree:nodes.document) -> NoneWrite one document file.
class
sphinx.builders.changes.ChangesBuilderWrite a summary with all version-related directives.
class
sphinx.builders.epub3.Epub3BuilderBuilder that outputs epub3 files.
method
sphinx.builders.epub3.Epub3Builder.build_navigation_doc() -> NoneWrite the metainfo file nav.xhtml.
method
sphinx.builders.epub3.Epub3Builder.build_navlist(navnodes:list[dict[str, Any]]) -> list[NavPoint]Create the toc navigation structure.
method
sphinx.builders.epub3.Epub3Builder.handle_finish() -> NoneCreate the metainfo files and finally the epub.
func
sphinx.builders.epub3.convert_epub_css_files(app:Sphinx, config:Config) -> NoneConvert string styled epub_css_files to tuple styled one.
class
sphinx.builders.gettext.CatalogCatalog of translatable messages.
class
sphinx.builders.gettext.I18nBuilderGeneral i18n builder.
class
sphinx.builders.gettext.I18nTagsDummy tags module for I18nBuilder.
class
sphinx.builders.gettext.MessageAn entry of translatable message.
class
sphinx.builders.gettext.MessageCatalogBuilderBuilds gettext-style message catalogs (.pot files).
class
sphinx.builders.gettext.MsgOriginOrigin holder for Catalog message origin.
class
sphinx.builders.html.StandaloneHTMLBuilderBuilds standalone HTML docs.
method
sphinx.builders.html.StandaloneHTMLBuilder.copy_extra_files() -> NoneCopy html_extra_path files.
method
sphinx.builders.html.StandaloneHTMLBuilder.copy_static_dirs() -> NoneCopy static files registered by extensions.
method
sphinx.builders.html.StandaloneHTMLBuilder.copy_stemmer_js() -> NoneCopy a JavaScript file for stemmer.
method
sphinx.builders.html.StandaloneHTMLBuilder.copy_translation_js() -> NoneCopy a JavaScript file for translations.
method
sphinx.builders.html.StandaloneHTMLBuilder.create_pygments_style_file() -> NoneCreate a style file for pygments.
method
sphinx.builders.html.StandaloneHTMLBuilder.get_doc_context(docname:str, body:str, metatags:str) -> dict[str, Any]Collect items for the template context of a page.
method
sphinx.builders.html.StandaloneHTMLBuilder.render_partial(node:Node | None) -> dict[str, str]Utility: Render a lone doctree node.
class
sphinx.builders.html._build_info.BuildInfobuildinfo file manipulator.
func
sphinx.builders.html.convert_html_css_files(app:Sphinx, config:Config) -> NoneConvert string styled html_css_files to tuple styled one.
func
sphinx.builders.html.convert_html_js_files(app:Sphinx, config:Config) -> NoneConvert string styled html_js_files to tuple styled one.
func
sphinx.builders.html.convert_locale_to_language_tag(locale:str | None) -> str | NoneConvert a locale string to a language tag (ex.
func
sphinx.builders.html.error_on_html_4(_app:Sphinx, config:Config) -> NoneError on HTML 4.
func
sphinx.builders.html.error_on_html_sidebars_string_values(app:Sphinx, config:Config) -> NoneSupport removed in Sphinx 2.
func
sphinx.builders.html.setup_resource_paths(app:Sphinx, pagename:str, templatename:str, context:dict[str, Any], doctree:Node) -> NoneSet up relative resource paths.
func
sphinx.builders.html.validate_html_extra_path(app:Sphinx, config:Config) -> NoneCheck html_extra_paths setting.
func
sphinx.builders.html.validate_html_favicon(app:Sphinx, config:Config) -> NoneCheck html_favicon setting.
func
sphinx.builders.html.validate_html_logo(app:Sphinx, config:Config) -> NoneCheck html_logo setting.
func
sphinx.builders.html.validate_html_static_path(app:Sphinx, config:Config) -> NoneCheck html_static_paths setting.
class
sphinx.builders.latex.LaTeXBuilderBuilds LaTeX output to create PDF.
method
sphinx.builders.latex.LaTeXBuilder.copy_support_files() -> NoneCopy TeX support files from texinputs.
func
sphinx.builders.latex.default_latex_docclass(config:Config) -> dict[str, str]Better default latex_docclass settings for specific languages.
func
sphinx.builders.latex.default_latex_documents(config:Config) -> list[tuple[str, str, str, str, str]]Better default latex_documents settings.
func
sphinx.builders.latex.default_latex_engine(config:Config) -> strBetter default latex_engine settings for specific languages.
func
sphinx.builders.latex.default_latex_use_xindy(config:Config) -> boolBetter default latex_use_xindy settings for specific engines.
func
sphinx.builders.latex.install_packages_for_ja(app:Sphinx) -> NoneInstall packages for Japanese.
class
sphinx.builders.latex.nodes.footnotemarkA node represents ``\footnotemark``.
class
sphinx.builders.latex.nodes.footnotetextA node represents ``\footnotetext``.
class
sphinx.builders.latex.nodes.math_referenceA node for a reference for equation.
class
sphinx.builders.latex.nodes.thebibliographyA node for wrapping bibliographies.
class
sphinx.builders.latex.theming.BuiltInThemeA built-in LaTeX theme.
class
sphinx.builders.latex.theming.ThemeA set of LaTeX configurations.
method
sphinx.builders.latex.theming.Theme.update(config:Config) -> NoneOverride theme settings by user's configuration.
class
sphinx.builders.latex.theming.ThemeFactoryA factory class for LaTeX Themes.
method
sphinx.builders.latex.theming.ThemeFactory.find_user_theme(name:str) -> Theme | NoneFind a theme named as *name* from latex_theme_path.
method
sphinx.builders.latex.theming.ThemeFactory.get(name:str) -> ThemeGet a theme for given *name*.
method
sphinx.builders.latex.theming.ThemeFactory.load_builtin_themes(config:Config) -> NoneLoad built-in themes.
class
sphinx.builders.latex.theming.UserThemeA user defined LaTeX theme.
class
sphinx.builders.latex.transforms.BibliographyTransformGather bibliography entries to tail of document.
class
sphinx.builders.latex.transforms.FootnoteDocnameUpdaterAdd docname to footnote and footnote_reference nodes.
class
sphinx.builders.latex.transforms.ShowUrlsTransformExpand references to inline text or footnotes.
class
sphinx.builders.linkcheck.AnchorCheckParserSpecialised HTML parser that looks for a specific anchor.
class
sphinx.builders.linkcheck.CheckExternalLinksBuilderChecks for broken external links.
func
sphinx.builders.linkcheck.compile_linkcheck_allowed_redirects(app:Sphinx, config:Config) -> NoneCompile patterns to the regexp objects.
func
sphinx.builders.linkcheck.contains_anchor(response:Response, anchor:str) -> boolDetermine if an anchor is contained within an HTTP response.
class
sphinx.builders.manpage.ManualPageBuilderBuilds groff output in manual page format.
func
sphinx.builders.manpage.default_man_pages(config:Config) -> list[tuple[str, str, str, list[str], int]]Better default man_pages settings.
class
sphinx.builders.singlehtml.SingleFileHTMLBuilderBuilds the whole document tree as a single HTML page.
class
sphinx.builders.texinfo.TexinfoBuilderBuilds Texinfo output to create Info documentation.
func
sphinx.builders.texinfo.default_texinfo_documents(config:Config) -> list[tuple[str, str, str, str, str, str, str]]Better default texinfo_documents settings.
class
sphinx.builders.xml.PseudoXMLBuilderBuilds pseudo-XML for display purposes.
class
sphinx.builders.xml.XMLBuilderBuilds Docutils-native XML.
func
sphinx.cmd.build.build_main(argv:Sequence[str]) -> intSphinx build "main" command-line entry.
func
sphinx.cmd.build.jobs_argument(value:str) -> intParse the ``--jobs`` flag.
func
sphinx.cmd.build.make_main(argv:Sequence[str]) -> intSphinx build "make mode" entry.
class
sphinx.cmd.quickstart.ValidationErrorRaised for validation errors.
func
sphinx.cmd.quickstart.ask_user(d:dict[str, Any]) -> NoneAsk the user for quickstart values missing from *d*.
func
sphinx.cmd.quickstart.generate(d:dict[str, Any], overwrite:bool=True, silent:bool=False, templatedir:str | None=None) -> NoneGenerate project based on values in *d*.
class
sphinx.config.ConfigConfiguration file abstraction.
method
sphinx.config.Config.read(confdir:str | os.PathLike[str], *overrides:dict[str, Any], *tags:Tags) -> ConfigCreate a Config object from configuration file.
class
sphinx.config.ENUMRepresents the candidates which a config value should be one of.
func
sphinx.config.convert_highlight_options(app:Sphinx, config:Config) -> NoneConvert old styled highlight_options to new styled one.
func
sphinx.config.convert_source_suffix(app:Sphinx, config:Config) -> NoneConvert old styled source_suffix to new styled one.
func
sphinx.config.deprecate_source_encoding(_app:Sphinx, config:Config) -> NoneWarn on non-UTF 8 source_encoding.
func
sphinx.config.eval_config_file(filename:Path, tags:Tags) -> dict[str, Any]Evaluate a config file.
func
sphinx.config.evaluate_copyright_placeholders(_app:Sphinx, config:Config) -> NoneReplace copyright year placeholders (%Y) with the current year.
func
sphinx.config.init_numfig_format(app:Sphinx, config:Config) -> NoneInitialize :confval:`numfig_format`.
func
sphinx.config.is_serializable(obj:object, *_seen:frozenset[int]=frozenset()) -> boolCheck if an object is serializable or not.
class
sphinx.directives.DefaultRoleSet the default interpreted text role.
class
sphinx.directives.ObjectDescriptionDirective to describe a class, function or similar object.
method
sphinx.directives.ObjectDescription.after_content() -> NoneCalled after parsing content.
method
sphinx.directives.ObjectDescription.before_content() -> NoneCalled before parsing content.
method
sphinx.directives.ObjectDescription.handle_signature(sig:str, signode:desc_signature) -> ObjDescTParse the signature *sig*.
method
sphinx.directives.ObjectDescription.transform_content(content_node:addnodes.desc_content) -> NoneCan be used to manipulate the content.
class
sphinx.directives.admonitions.SeeAlsoAn admonition mentioning things to look at as reference.
class
sphinx.directives.code.LiteralIncludeLike ``..
class
sphinx.directives.other.AcksDirective for a list of names.
class
sphinx.directives.other.CenteredDirective to create a centered line of bold text.
class
sphinx.directives.other.HListDirective for a list that gets compacted horizontally.
class
sphinx.directives.patches.CodeParse and mark up content of a code block.
method
sphinx.domains.Domain.add_object_type(name:str, objtype:ObjType) -> NoneAdd an object type.
method
sphinx.domains.Domain.check_consistency() -> NoneDo consistency checks (**experimental**).
method
sphinx.domains.Domain.clear_doc(docname:str) -> NoneRemove traces of a document in the domain-specific inventories.
method
sphinx.domains.Domain.get_enumerable_node_type(node:Node) -> str | NoneGet type of enumerable nodes (experimental).
method
sphinx.domains.Domain.get_full_qualified_name(node:Element) -> str | NoneReturn full qualified name for given node.
method
sphinx.domains.Domain.get_objects() -> Iterable[tuple[str, str, str, str, str, int]]Return an iterable of "object descriptions".
method
sphinx.domains.Domain.get_type_name(type:ObjType, primary:bool=False) -> strReturn full name for given ObjType.
method
sphinx.domains.Domain.process_doc(env:BuildEnvironment, docname:str, document:nodes.document) -> NoneProcess a document after it is read by the environment.
method
sphinx.domains.Domain.process_field_xref(pnode:pending_xref) -> NoneProcess a pending xref created in a doc field.
class
sphinx.domains._index.IndexAn Index is the description for a domain-specific index.
method
sphinx.domains._index.Index.generate(docnames:Iterable[str] | None=None) -> tuple[list[tuple[str, list[IndexEntry]]], bool]Get entries for the index.
class
sphinx.domains._index.IndexEntryAn index entry.
class
sphinx.domains.c.CDomainC language domain.
class
sphinx.domains.c.CObjectDescription of a C language object.
class
sphinx.domains.changeset.ChangeSetDomainDomain for changesets.
class
sphinx.domains.citation.CitationDefinitionTransformMark citation definition labels as not smartquoted.
class
sphinx.domains.citation.CitationDomainDomain for citations.
class
sphinx.domains.cpp.CPPDomainC++ language domain.
class
sphinx.domains.cpp.CPPObjectDescription of a C++ language object.
class
sphinx.domains.index.IndexDirectiveDirective to add entries to the index.
class
sphinx.domains.index.IndexDomainIndex domain.
method
sphinx.domains.index.IndexDomain.process_doc(env:BuildEnvironment, docname:str, document:Node) -> NoneProcess a document after it is read by the environment.
class
sphinx.domains.javascript.JSCallableDescription of a JavaScript function, method or constructor.
class
sphinx.domains.javascript.JSConstructorLike a callable but with a different prefix.
class
sphinx.domains.javascript.JSModuleDirective to mark description of a new JavaScript module.
class
sphinx.domains.javascript.JSObjectDescription of a JavaScript object.
class
sphinx.domains.javascript.JavaScriptDomainJavaScript language domain.
class
sphinx.domains.math.MathDomainMathematics domain.
class
sphinx.domains.python.PyAttributeDescription of an attribute.
class
sphinx.domains.python.PyClassMethodDescription of a classmethod.
class
sphinx.domains.python.PyDecoratorFunctionDescription of a decorator.
class
sphinx.domains.python.PyDecoratorMethodDescription of a decoratormethod.
class
sphinx.domains.python.PyFunctionDescription of a function.
class
sphinx.domains.python.PyMethodDescription of a method.
class
sphinx.domains.python.PyModuleDirective to mark description of a new module.
class
sphinx.domains.python.PyPropertyDescription of an attribute.
class
sphinx.domains.python.PyStaticMethodDescription of a staticmethod.
class
sphinx.domains.python.PyTypeAliasDescription of a type alias.
class
sphinx.domains.python.PyVariableDescription of a variable.
class
sphinx.domains.python.PythonDomainPython language domain.
method
sphinx.domains.python.PythonDomain.note_module(name:str, node_id:str, synopsis:str, platform:str, deprecated:bool) -> NoneNote a python module for cross reference.
method
sphinx.domains.python.PythonDomain.note_object(name:str, objtype:str, node_id:str, aliased:bool=False, location:Any=None) -> NoneNote a python object for cross reference.
class
sphinx.domains.python.PythonModuleIndexIndex subclass to provide the Python module index.
func
sphinx.domains.python._annotations.type_to_xref(target:str, env:BuildEnvironment, *suppress_prefix:bool=False) -> addnodes.pending_xrefConvert a type string to a cross reference node.
class
sphinx.domains.python._object.PyObjectDescription of a general Python object.
method
sphinx.domains.python._object.PyObject.get_index_text(modname:str, name:tuple[str, str]) -> strReturn the text for the index entry of the object.
method
sphinx.domains.python._object.PyObject.handle_signature(sig:str, signode:desc_signature) -> tuple[str, str]Transform a Python signature into RST nodes.
func
sphinx.domains.python.builtin_resolver(app:Sphinx, env:BuildEnvironment, node:pending_xref, contnode:Element) -> Element | NoneDo not emit nitpicky warnings for built-in types.
func
sphinx.domains.python.filter_meta_fields(app:Sphinx, domain:str, objtype:str, content:Element) -> NoneFilter ``:meta:`` field from its docstring.
class
sphinx.domains.rst.ReSTDirectiveDescription of a reST directive.
class
sphinx.domains.rst.ReSTDirectiveOptionDescription of an option for reST directive.
class
sphinx.domains.rst.ReSTDomainReStructuredText domain.
class
sphinx.domains.rst.ReSTMarkupDescription of generic reST markup.
class
sphinx.domains.rst.ReSTRoleDescription of a reST role.
func
sphinx.domains.rst.parse_directive(d:str) -> tuple[str, str]Parse a directive signature.
class
sphinx.domains.std.CmdoptionDescription of a command-line option (..
method
sphinx.domains.std.Cmdoption.handle_signature(sig:str, signode:desc_signature) -> strTransform an option description into RST nodes.
class
sphinx.domains.std.ProductionListDirective to list grammar productions.
method
sphinx.domains.std.ProductionList.make_name_target(*name:str, *production_group:str, *location:str) -> addnodes.literal_strongMake a link target for the given production.
method
sphinx.domains.std.ProductionList.separator_node(*name:str, *max_len:int) -> nodes.TextReturn separator between 'name' and 'tokens'.
class
sphinx.domains.std.ProgramDirective to name the program for which options are documented.
class
sphinx.domains.std.TargetGeneric target for user-defined cross-reference types.
class
sphinx.environment.BuildEnvironmentThe environment in which the ReST files are translated.
method
sphinx.environment.BuildEnvironment.apply_post_transforms(doctree:nodes.document, docname:str) -> NoneApply all post-transforms.
method
sphinx.environment.BuildEnvironment.check_consistency() -> NoneDo consistency checks.
method
sphinx.environment.BuildEnvironment.clear_doc(docname:str) -> NoneRemove all traces of a source file in the inventory.
method
sphinx.environment.BuildEnvironment.doc2path(docname:str, base:bool=True) -> _StrPathReturn the filename for the document name.
method
sphinx.environment.BuildEnvironment.found_docs() -> set[str]Contains all existing docnames.
method
sphinx.environment.BuildEnvironment.get_doctree(docname:str) -> nodes.documentRead the doctree for a file from the pickle and return it.
method
sphinx.environment.BuildEnvironment.get_domain(domainname:str) -> DomainReturn the domain instance with the specified name.
method
sphinx.environment.BuildEnvironment.get_outdated_files(config_changed:bool) -> tuple[set[str], set[str], set[str]]Return (added, changed, removed) sets.
method
sphinx.environment.BuildEnvironment.new_serialno(category:str='') -> intReturn a serial number, e.g.
method
sphinx.environment.BuildEnvironment.note_dependency(filename:str | os.PathLike[str], *docname:str | None=None) -> NoneAdd *filename* as a dependency of the current document.
method
sphinx.environment.BuildEnvironment.note_included(filename:str | os.PathLike[str]) -> NoneAdd *filename* as a included from other document.
method
sphinx.environment.BuildEnvironment.path2doc(filename:str | os.PathLike[str]) -> str | NoneReturn the docname for the filename if the file is document.
method
sphinx.environment.BuildEnvironment.prepare_settings(docname:str) -> NonePrepare to set up environment for reading.
func
sphinx.environment.adapters.toctree.document_toc(env:BuildEnvironment, docname:str, tags:Tags) -> NodeGet the (local) table of contents for a document.
class
sphinx.environment.collectors.asset.DownloadFileCollectorDownload files collector for sphinx.environment.
method
sphinx.environment.collectors.asset.DownloadFileCollector.process_doc(app:Sphinx, doctree:nodes.document) -> NoneProcess downloadable file paths.
class
sphinx.environment.collectors.asset.ImageCollectorImage files collector for sphinx.environment.
method
sphinx.environment.collectors.asset.ImageCollector.process_doc(app:Sphinx, doctree:nodes.document) -> NoneProcess and rewrite image URIs.
class
sphinx.environment.collectors.dependencies.DependenciesCollectordependencies collector for sphinx.environment.
method
sphinx.environment.collectors.dependencies.DependenciesCollector.process_doc(app:Sphinx, doctree:nodes.document) -> NoneProcess docutils-generated dependency info.
class
sphinx.environment.collectors.metadata.MetadataCollectormetadata collector for sphinx.environment.
method
sphinx.environment.collectors.metadata.MetadataCollector.process_doc(app:Sphinx, doctree:nodes.document) -> NoneProcess the docinfo part of the doctree as metadata.
class
sphinx.environment.collectors.title.TitleCollectortitle collector for sphinx.environment.
class
sphinx.errors.ApplicationErrorApplication initialization error.
class
sphinx.errors.BuildEnvironmentErrorBuildEnvironment error.
class
sphinx.errors.ConfigErrorConfiguration error.
class
sphinx.errors.DocumentErrorDocument error.
class
sphinx.errors.ExtensionErrorExtension error.
class
sphinx.errors.PycodeErrorPycode Python source code analyser error.
class
sphinx.errors.SphinxErrorBase class for Sphinx errors.
class
sphinx.errors.SphinxParallelErrorSphinx parallel build error.
class
sphinx.errors.SphinxWarningWarning, treated as error.
class
sphinx.errors.ThemeErrorTheme error.
class
sphinx.errors.VersionRequirementErrorIncompatible Sphinx version error.
class
sphinx.events.EventManagerEvent manager for Sphinx.
method
sphinx.events.EventManager.add(name:str) -> NoneRegister a custom Sphinx event called *name*.
method
sphinx.events.EventManager.disconnect(listener_id:int) -> NoneDisconnect the handler given by *listener_id*.
method
sphinx.events.EventManager.emit(name:str, *allowed_exceptions:tuple[type[Exception], ...]=(), *args:Any) -> list[Any]Emit a Sphinx event.
method
sphinx.events.EventManager.emit_firstresult(name:str, *allowed_exceptions:tuple[type[Exception], ...]=(), *args:Any) -> AnyEmit a Sphinx event and return the first result.
func
sphinx.ext.apidoc._cli.main(argv:Sequence[str]=()) -> intRun the apidoc CLI.
func
sphinx.ext.apidoc._extension.run_apidoc(app:Sphinx) -> NoneRun the apidoc extension.
func
sphinx.ext.apidoc._generate.create_modules_toc_file(modules:list[str], opts:ApidocOptions, name:str='modules', user_template_dir:str | os.PathLike[str] | None=None) -> PathCreate the module's index.
func
sphinx.ext.apidoc._generate.is_excluded(root:str | Path, excludes:Sequence[re.Pattern[str]]) -> boolCheck if the directory is in the exclude list.
func
sphinx.ext.apidoc._generate.is_initpy(filename:str | Path) -> boolCheck *filename* is __init__ file or not.
func
sphinx.ext.apidoc._generate.is_package_dir(files:Iterable[Path | str]=(), *dir_path:Path | None=None) -> boolCheck given *files* contains __init__ file.
func
sphinx.ext.apidoc._generate.is_skipped_module(filename:str | Path, opts:ApidocOptions, _excludes:Sequence[re.Pattern[str]]) -> boolCheck if we want to skip this module.
func
sphinx.ext.apidoc._generate.is_skipped_package(dirname:str | Path, opts:ApidocOptions, excludes:Sequence[re.Pattern[str]]=()) -> boolCheck if we want to skip this module.
func
sphinx.ext.apidoc._generate.module_join(*modnames:str | None) -> strJoin module names with dots.
func
sphinx.ext.apidoc._generate.write_file(name:str, text:str, opts:ApidocOptions) -> PathWrite the output file for module/package <name>.
class
sphinx.ext.apidoc._shared.ApidocDefaultsDefault values for apidoc options.
method
sphinx.ext.apidoc._shared.ApidocDefaults.from_config(config:Config) -> SelfCollect the default values for apidoc options.
class
sphinx.ext.apidoc._shared.ApidocOptionsOptions for apidoc.
class
sphinx.ext.autodoc._directive.AutodocDirectiveA directive class for all autodoc directives.
class
sphinx.ext.autodoc._directive.DummyOptionSpecAn option_spec allows any options.
func
sphinx.ext.autodoc._directive_options.bool_option(arg:str | None) -> boolUsed to convert flag options to auto directives.
func
sphinx.ext.autodoc._directive_options.exclude_members_option(arg:str | None) -> EMPTY_T | set[str]Used to convert the :exclude-members: option.
func
sphinx.ext.autodoc._directive_options.members_option(arg:str | None) -> ALL_T | list[str] | NoneUsed to convert the :members: option to auto directives.
class
sphinx.ext.autodoc._dynamic._member_finder.ObjectMemberA member of object.
func
sphinx.ext.autodoc._dynamic._member_finder.unmangle(subject:Any, name:str) -> str | NoneUnmangle the given name.
class
sphinx.ext.autodoc._dynamic._mock.MockFinderA finder for mocking.
method
sphinx.ext.autodoc._dynamic._mock.MockFinder.invalidate_caches() -> NoneInvalidate mocked modules on sys.modules.
class
sphinx.ext.autodoc._dynamic._mock.MockLoaderA loader for mocking.
func
sphinx.ext.autodoc._dynamic._mock.ismock(subject:Any) -> boolCheck if the object is mocked.
func
sphinx.ext.autodoc._dynamic._mock.ismockmodule(subject:Any) -> TypeIs[_MockModule]Check if the object is a mocked module.
func
sphinx.ext.autodoc._dynamic._mock.undecorate(subject:_MockObject) -> AnyUnwrap mock if *subject* is decorated by mocked object.
func
sphinx.ext.autodoc._dynamic._preserve_defaults.update_default_value(obj:Any, bound_method:bool) -> NoneUpdate default value info of *obj* using type_comments.
func
sphinx.ext.autodoc._dynamic._type_comments.not_suppressed(argtypes:Sequence[ast.expr]=()) -> boolCheck given *argtypes* is suppressed type_comment or not.
func
sphinx.ext.autodoc._legacy_class_based._directive_options.bool_option(arg:Any) -> boolUsed to convert flag options to auto directives.
func
sphinx.ext.autodoc._legacy_class_based._directive_options.exclude_members_option(arg:Any) -> object | set[str]Used to convert the :exclude-members: option.
class
sphinx.ext.autodoc._legacy_class_based._documenters.AttributeDocumenterSpecialized Documenter subclass for attributes.
class
sphinx.ext.autodoc._legacy_class_based._documenters.ClassDocumenterSpecialized Documenter subclass for classes.
class
sphinx.ext.autodoc._legacy_class_based._documenters.DataDocumenterSpecialized Documenter subclass for data items.
class
sphinx.ext.autodoc._legacy_class_based._documenters.FunctionDocumenterSpecialized Documenter subclass for functions.
class
sphinx.ext.autodoc._legacy_class_based._documenters.ModuleDocumenterSpecialized Documenter subclass for modules.
method
sphinx.ext.autodoc._legacy_class_based._documenters.ModuleDocumenter.get_module_members() -> dict[str, ObjectMember]Get members of target module.
class
sphinx.ext.autodoc._legacy_class_based._documenters.ObjectMemberA member of object.
class
sphinx.ext.autodoc._legacy_class_based._documenters.PropertyDocumenterSpecialized Documenter subclass for properties.
func
sphinx.ext.autodoc._legacy_class_based._documenters.autodoc_attrgetter(obj:Any, name:str, *registry:SphinxComponentRegistry, *defargs:Any) -> AnyAlternative getattr() for types
class
sphinx.ext.autodoc.directive.AutodocDirectiveA directive class for all autodoc directives.
class
sphinx.ext.autodoc.directive.DocumenterBridgeA parameters container for Documenters.
class
sphinx.ext.autodoc.directive.DummyOptionSpecAn option_spec allows any options.
func
sphinx.ext.autodoc.directive.parse_generated_content(state:RSTState, content:StringList, documenter:Documenter) -> list[Node]Parse an item of content generated by Documenter.
func
sphinx.ext.autodoc.directive.process_documenter_options(documenter:type[Documenter], config:Config, options:dict[str, str]) -> OptionsRecognize options of Documenter from user input.
func
sphinx.ext.autodoc.importer.get_class_members(subject:Any, objpath:Any, attrgetter:_AttrGetter, inherit_docstrings:bool=True) -> dict[str, ObjectMember]Get members and attributes of target class.
func
sphinx.ext.autodoc.preserve_defaults.update_defvalue(app:Sphinx, obj:Any, bound_method:bool) -> NoneUpdate defvalue info of *obj* using type_comments.
func
sphinx.ext.autodoc.typehints.record_typehints(app:Sphinx, objtype:str, name:str, obj:Any, options:Options, args:str, retann:str) -> NoneRecord type hints to env object.
class
sphinx.ext.autosummary.AutoLinkSmart linking role.
class
sphinx.ext.autosummary.ImportExceptionGroupExceptions raised during importing the target objects.
func
sphinx.ext.autosummary.autosummary_table_visit_html(self:HTML5Translator, node:autosummary_table) -> NoneMake the first column of the table non-breaking.
func
sphinx.ext.autosummary.autosummary_toc_visit_html(self:nodes.NodeVisitor, node:autosummary_toc) -> NoneHide autosummary toctree list in HTML output.
func
sphinx.ext.autosummary.extract_summary(doc:Sequence[str], settings:Any) -> strExtract summary from docstring.
class
sphinx.ext.autosummary.generate.AutosummaryRendererA helper class for rendering.
method
sphinx.ext.autosummary.generate.AutosummaryRenderer.render(template_name:str, context:dict[str, Any]) -> strRender a template file.
class
sphinx.ext.autosummary.generate.DummyApplicationDummy Application class for sphinx-autogen command.
func
sphinx.ext.autosummary.mangle_signature(sig:str, max_chars:int=30) -> strReformat a function signature to a more compact form.
func
sphinx.ext.autosummary.strip_arg_typehint(s:str) -> strStrip a type hint from argument definition.
class
sphinx.ext.coverage.CoverageBuilderEvaluates coverage of code in the documentation.
class
sphinx.ext.doctest.DocTestBuilderRuns test snippets in the documentation.
method
sphinx.ext.doctest.DocTestBuilder.get_line_number(node:Node) -> int | NoneGet the real line number or admit we don't know.
class
sphinx.ext.doctest.TestDirectiveBase class for doctest-related directives.
func
sphinx.ext.doctest.is_allowed_version(spec:str, version:str) -> boolCheck `spec` satisfies `version` or not.
class
sphinx.ext.duration.DurationDomainA domain for durations of Sphinx processing.
func
sphinx.ext.duration.on_build_finished(app:Sphinx, error:Exception) -> NoneDisplay duration ranking on the current build.
func
sphinx.ext.duration.on_builder_inited(app:Sphinx) -> NoneInitialize DurationDomain on bootstrap.
func
sphinx.ext.duration.on_doctree_read(app:Sphinx, doctree:nodes.document) -> NoneRecord a reading duration.
func
sphinx.ext.duration.on_source_read(app:Sphinx, docname:str, content:list[str]) -> NoneStart to measure reading duration.
class
sphinx.ext.graphviz.ClickableMapDefinitionA manipulator for clickable map file of graphviz.
class
sphinx.ext.graphviz.GraphvizDirective to insert arbitrary dot markup.
class
sphinx.ext.graphviz.GraphvizSimpleDirective to insert arbitrary dot markup.
class
sphinx.ext.imgmath.InvokeErrorerrors on invoking converters.
func
sphinx.ext.imgmath.compile_math(latex:str, *config:Config) -> PathCompile LaTeX macros for math to DVI.
func
sphinx.ext.imgmath.convert_dvi_to_image(command:list[str], name:str) -> tuple[str, str]Convert DVI file to specific image format.
func
sphinx.ext.imgmath.convert_dvi_to_png(dvipath:Path, out_path:Path, *config:Config) -> int | NoneConvert DVI file to PNG image.
func
sphinx.ext.imgmath.convert_dvi_to_svg(dvipath:Path, out_path:Path, *config:Config) -> int | NoneConvert DVI file to SVG image.
func
sphinx.ext.imgmath.generate_latex_macro(image_format:str, math:str, config:Config, confdir:_StrPath) -> strGenerate LaTeX macro.
func
sphinx.ext.imgmath.read_svg_depth(filename:str | os.PathLike[str]) -> int | NoneRead the depth from comment at last line of SVG file
func
sphinx.ext.imgmath.write_svg_depth(filename:Path, depth:int) -> NoneWrite the depth to SVG file as a comment at end of file
func
sphinx.ext.inheritance_diagram.html_visit_inheritance_diagram(self:HTML5Translator, node:inheritance_diagram) -> NoneOutput the graph for HTML.
func
sphinx.ext.inheritance_diagram.import_classes(name:str, currmodule:str) -> list[type[Any]]Import a class using its fully-qualified *name*.
func
sphinx.ext.inheritance_diagram.latex_visit_inheritance_diagram(self:LaTeXTranslator, node:inheritance_diagram) -> NoneOutput the graph for LaTeX.
func
sphinx.ext.inheritance_diagram.texinfo_visit_inheritance_diagram(self:TexinfoTranslator, node:inheritance_diagram) -> NoneOutput the graph for Texinfo.
func
sphinx.ext.inheritance_diagram.try_import(objname:str) -> AnyImport a object or module using *name* and *currentmodule*.
About this data
These signatures were extracted from the public source of sphinx-doc/sphinx
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.