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( )[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( ) 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( ) 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',
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()
.