Skip to content

prepare

nbdev_mkdocs.mkdocs.prepare(root_path: str, use_relative_doc_links: bool = False, no_test: bool = False, no_mkdocs_build: bool = False) -> None ¤

Prepare mkdocs for serving

Parameters:

Name Type Description Default
root_path str

The root path of the project

required
use_relative_doc_links bool

If set to True, relative links are added to symbol references in generated documentation. Else, the value set in doc_host in settings.ini is added to symbol references in generated documentation. This flag should be set to False if this function is called directly without calling preview.

False
no_test bool

If set to False, the unit tests will be run, else they will be skipped

False
no_mkdocs_build bool

If set to True, then the mkdocs build will be skipped. This flag should be set to False if this function is called directly without calling preview

False

Note

The above docstring is autogenerated by docstring-gen library (https://github.com/airtai/docstring-gen)

Source code in nbdev_mkdocs/mkdocs.py
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
def prepare(
    root_path: str,
    use_relative_doc_links: bool = False,
    no_test: bool = False,
    no_mkdocs_build: bool = False,
) -> None:
    """Prepare mkdocs for serving

    Args:
        root_path: The root path of the project
        use_relative_doc_links: If set to True, relative links are added to symbol references in generated
            documentation. Else, the value set in doc_host in settings.ini is added to symbol references in
            generated documentation. This flag should be set to `False` if this function is called directly
            without calling preview.
        no_test: If set to False, the unit tests will be run, else they will be skipped
        no_mkdocs_build: If set to True, then the mkdocs build will be skipped. This flag
            should be set to `False` if this function is called directly without calling preview

    !!! note

        The above docstring is autogenerated by docstring-gen library (https://github.com/airtai/docstring-gen)
    """
    with set_cwd(root_path):
        if no_test:
            nbdev_export.__wrapped__()
            refresh_quarto_yml()
        else:
            nbdev_export.__wrapped__()
            nbdev_test.__wrapped__()
            nbdev_clean.__wrapped__()
            refresh_quarto_yml()

    nbdev_mkdocs_docs(
        root_path=root_path,
        use_relative_doc_links=use_relative_doc_links,
        no_mkdocs_build=no_mkdocs_build,
    )