GenDocsFromAutomodsummο
- class plasmapy_sphinx.automodsumm.generate.GenDocsFromAutomodsummο
Bases:
objectClass used for stub file generation from
automodapiandautomodsumm. An instance of the class is connected to the Sphinx eventbuilder-inited, which is emitted when the builder object is created.Attributes Summary
Instance of the Sphinx application.
Instance of the
SphinxLoggerAdapterfor report during builds.Methods Summary
__call__(app)Scan through source files, check for the
automodsummandautomodapidirectives, and auto generate any associated stub files.event_handler__autodoc_skip_member(app,Β ...)Event handler for the Sphinx event
autodoc-skip-member.find_in_files(filenames)Search files for the
automodapiandautomodsummdirectives and generate a list ofAutomodsummEntry's indicating which stub files need to be generated.find_in_lines(lines[,Β filename])Search a list of strings for the
automodapiandautomodsummdirectives and generate a list ofAutomodsummEntry's indicating which stub files need to be generated.generate_docs(source_filenames[,Β ...])Generate and write stub files for objects defined in the
automodapiandautomodsummdirectives.Attributes Documentation
- app: 'Sphinx' = Noneο
Instance of the Sphinx application.
- logger = <SphinxLoggerAdapter sphinx.plasmapy_sphinx.automodsumm.generate (DEBUG)>ο
Instance of the
SphinxLoggerAdapterfor report during builds.
Methods Documentation
- __call__(app: Sphinx)ο
Scan through source files, check for the
automodsummandautomodapidirectives, and auto generate any associated stub files.- Parameters:
app (
Sphinx) β Instance of the Sphinx application.
Note
Adapted from
sphinx.ext.autosummary.process_generate_options().
- static event_handler__autodoc_skip_member(app: Sphinx, what: str, name: str, obj: Any, skip: bool, options: dict)ο
Event handler for the Sphinx event
autodoc-skip-member. This handler ensures the__call__method is documented if defined by the associated class.
- find_in_files(filenames: List[str]) List[AutomodsummEntry]ο
Search files for the
automodapiandautomodsummdirectives and generate a list ofAutomodsummEntryβs indicating which stub files need to be generated.- Parameters:
filenames (List[str]) β List of filenames to be searched.
Note
Adapted from
sphinx.ext.autosummary.generate.find_autosummary_in_files().
- find_in_lines(lines: List[str], filename: str | None = None) List[AutomodsummEntry]ο
Search a list of strings for the
automodapiandautomodsummdirectives and generate a list ofAutomodsummEntryβs indicating which stub files need to be generated.- Parameters:
Note
Adapted from
sphinx.ext.autosummary.generate.find_autosummary_in_lines().
- generate_docs(source_filenames: List[str], output_dir: str | None = None, suffix: str = '.rst', base_path: str | None = None, imported_members: bool = False, overwrite: bool = True, encoding: str = 'utf-8') Noneο
Generate and write stub files for objects defined in the
automodapiandautomodsummdirectives.- Parameters:
source_filenames (List[str]) β A list of all filenames for with the
automodapiandautomodsummdirectives will be searched for.output_dir (
str) β Directory for which the stub files will be written to.suffix (
str) β (Default".rst") Suffix given to the written stub files.base_path (
str) β The common base path for the filenames listed insource_filenames. This is typically the source directory of the Sphinx application.imported_members (
bool) β (DefaultFalse) SetTrueto include imported members in the stub file documentation for module object types.overwrite (
bool) β (DefaultTrue) Will cause existing stub files to be overwritten.encoding (
str) β (Default:"utf-8") Encoding for the written stub files.
Note
Adapted from
sphinx.ext.autosummary.generate.generate_autosummary_docs().