Base
Handsdown API Index / Handsdown / Generators / Base
Auto-generated documentation for handsdown.generators.base module.
BaseGenerator
Attributes
-
INDEX_NAME
- Index filename: 'README.md' -
INDEX_TITLE
- Index title: 'Index' -
insert_toc
- Whether to add ToC to generated module docs: False
Base documentation generator.
Arguments
project_name
- Name of the project.input_path
- Path to repo to generate docs.output_path
- Path to folder with auto-generated docs to output.source_paths
- List of paths to source files for generation.docstring_processor
- Docstring converter to Markdown.loader
- Loader for python modules.raise_errors
- RaiseLoaderError
instead of silencing in.source_code_url
- URL to source files to use instead of relative paths, useful for GitHub Pages.source_code_path
- Path to local source codetoc_depth
- Maximum depth of child modules ToCencoding
- File encoding
Signature
class BaseGenerator:
def __init__(
self,
input_path: Path,
output_path: Path,
source_paths: Iterable[Path],
project_name: Optional[str] = None,
docstring_processor: Optional[BaseDocstringProcessor] = None,
loader: Optional[Loader] = None,
raise_errors: bool = False,
source_code_url: Optional[str] = None,
source_code_path: Optional[Path] = None,
toc_depth: int = 1,
encoding: str = ENCODING,
) -> None:
...
See also
BaseGenerator()._write_changed
Write content to file if it's changed.
Signature
BaseGenerator().cleanup_old_docs
Remove old docs generated for this module.
Signature
BaseGenerator().generate_doc
Generate one module doc at once.
Arguments
source_path
- Path to source file.
Raises
GeneratorError
- Ifsource_path
not found in current repo.
Signature
BaseGenerator().generate_docs
Generate all doc files at once.
Signature
BaseGenerator().generate_external_configs
Signature
BaseGenerator().generate_index
Generate <output>/README.md
file.
Contains a Tree of all modules in the project.
Signature
BaseGenerator().get_children_module_records
Get all module records that are children of this module.
Signature
See also
BaseGenerator().get_external_configs_templates
Get a tuple with pairs of template path to project path
Signature
BaseGenerator().get_md_document
Get or create MDDocument for module record.
Signature
See also
BaseGenerator().get_see_also_links
Get links to other modules that are referenced in the docstring.
Signature
def get_see_also_links(
self, record: NodeRecord, module_record: ModuleRecord, md_document: MDDocument
) -> List[str]:
...
See also
BaseGenerator().replace_links
Signature
def replace_links(
self,
module_record: ModuleRecord,
record: NodeRecord,
md_document: MDDocument,
docstring: str,
) -> str:
...