Skip to content

msaUtils Module

.gen_ref_pages


Generate the code reference pages and navigation.

Functions

format_pip_result

format_pip_result(pip_result, version)

Internal support function, there should be no need to call this directly

generate_code_reference_documentation

generate_code_reference_documentation(
    virtual_ref_nav_path: str = "reference",
    ref_md_file: str = "SUMMARY.md",
    virtual_requirements_nav_path: str = "requirements",
    req_md_file: str = "requirements.md",
    source_path: str = "msaUtils",
    source_file_type_filter: str = "*.py",
    requirement_file: str = "requirements.txt",
    md_file_type: str = ".md",
    recreate_pip_info: bool = False,
    exclude_functions: List[str] = [
        "__init__",
        "__main__",
        "main",
        "run",
    ],
    pkl_info_file: str = "docs/saved_req_package_pip_info.pkl",
)

Generates the virtual mkdocs md files and adds them to the navigation.

Note

That is the function you should call from mkdocs with mkdocs.yml config:

- gen-files:
  scripts:
    - docs/gen_ref_pages.py

In that gen_ref_pages.py call: generate_code_reference_documentation()

Scans the requirement file and gets pip show info for each package and stores it to a pickle file.

PARAMETER DESCRIPTION
virtual_ref_nav_path

internal node name for the created reference docu

TYPE: str DEFAULT: 'reference'

ref_md_file

str = reference md file, shouldn't be changed

TYPE: str DEFAULT: 'SUMMARY.md'

virtual_requirements_nav_path

str = the virtual nav path

TYPE: str DEFAULT: 'requirements'

req_md_file

name of the requirement md file

TYPE: str DEFAULT: 'requirements.md'

source_path

the path to the package/source code root to document everything below and in that dir

TYPE: str DEFAULT: 'msaUtils'

source_file_type_filter

filetype to document, should be .py

TYPE: str DEFAULT: '*.py'

requirement_file

name of the requirement file to analyze for used libraries

TYPE: str DEFAULT: 'requirements.txt'

md_file_type

md file filetype, should be .md

TYPE: str DEFAULT: '.md'

recreate_pip_info

recreate the pip analyze, when you changed requirement file, you also can just delete the pkl file

TYPE: bool DEFAULT: False

exclude_functions

list of functions to exclude

TYPE: List[str] DEFAULT: ['__init__', '__main__', 'main', 'run']

pkl_info_file

str = the filepathname of the pkl file to store the pip information result

TYPE: str DEFAULT: 'docs/saved_req_package_pip_info.pkl'

generate_sub_process_result

generate_sub_process_result(requirement_file) -> dict

Internal support function, there should be no need to call this directly


Last update: September 24, 2022
Created: September 24, 2022