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
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
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,
    )