GenDocsFromAutomodsumm
- class plasmapy_sphinx.automodsumm.generate.GenDocsFromAutomodsumm[source]
Bases:
object
Class used for stub file generation from
automodapi
andautomodsumm
. 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
SphinxLoggerAdapter
for report during builds.Methods Summary
__call__
(app)Scan through source files, check for the
automodsumm
andautomodapi
directives, 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
automodapi
andautomodsumm
directives 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
automodapi
andautomodsumm
directives 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
automodapi
andautomodsumm
directives.Attributes Documentation
- app: 'Sphinx' = None
Instance of the Sphinx application.
- logger = <SphinxLoggerAdapter sphinx.plasmapy_sphinx.automodsumm.generate (DEBUG)>
Instance of the
SphinxLoggerAdapter
for report during builds.
Methods Documentation
- __call__(app: Sphinx)[source]
Scan through source files, check for the
automodsumm
andautomodapi
directives, 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)[source]
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] [source]
Search files for the
automodapi
andautomodsumm
directives 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) List[AutomodsummEntry] [source]
Search a list of strings for the
automodapi
andautomodsumm
directives 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, suffix: str = '.rst', base_path: str = None, imported_members: bool = False, overwrite: bool = True, encoding: str = 'utf-8') None [source]
Generate and write stub files for objects defined in the
automodapi
andautomodsumm
directives.- Parameters:
source_filenames (List[str]) – A list of all filenames for with the
automodapi
andautomodsumm
directives 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
) SetTrue
to 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()
.