diff --git a/docs/_data/plugins.py b/docs/_data/plugins.py index cbac0510eaaef2f22dcce4593f6c701b341d8066..d47f6ebb412742d56dc34d39bd2b4f7713e21e0b 100644 --- a/docs/_data/plugins.py +++ b/docs/_data/plugins.py @@ -153,6 +153,10 @@ def add_external_to_nav( repo_parent, nav_parent[1:], ) + elif repo_dict["online_url"].startswith('/'): + nav.append({ + repo_dict["nav_entry"]: repo_dict["online_url"].replace('/','../',1) + }) else: nav.append({repo_dict["nav_entry"]: repo_dict["online_url"]}) @@ -833,10 +837,8 @@ def update_version(env: dict) -> None: if last_major >= 0: mike_version.append( { - "version": "{}.{}".format(last_major, last_minor), - "title": "{}.{}.{}".format( - last_major, last_minor, last_patch - ), + "version": f"{last_major}.{last_minor}", + "title": f"{last_major}.{last_minor}.{last_patch}", "aliases": [], } ) @@ -846,10 +848,8 @@ def update_version(env: dict) -> None: if last_minor >= 0: mike_version.append( { - "version": "{}.{}".format(last_major, last_minor), - "title": "{}.{}.{}".format( - last_major, last_minor, last_patch - ), + "version": f"{last_major}.{last_minor}", + "title": f"{last_major}.{last_minor}.{last_patch}", "aliases": [], } ) @@ -859,8 +859,8 @@ def update_version(env: dict) -> None: last_patch = patch mike_version.append( { - "version": "{}.{}".format(last_major, last_minor), - "title": "{}.{}.{}".format(last_major, last_minor, last_patch), + "version": f"{last_major}.{last_minor}", + "title": f"{last_major}.{last_minor}.{last_patch}", "aliases": ["latest"], } ) @@ -914,9 +914,11 @@ def define_env(env: dict) -> None: var: Key in env.variables to return. Returns: - The value of `env.variables[var]`. + The value of `env.variables[var]` if it exists, else return None. """ - return env.variables[var] + if var in env.variables: + return env.variables[var] + return None @env.macro # pylint: disable=W0612 diff --git a/docs/_data/template/repo.tpl.yaml b/docs/_data/template/repo.tpl.yaml index 8fb19b07957b60bfcd8e20aa45b32f96271618ce..900e5c8fcbe87feda0168e5c18d2772b38ed2de0 100644 --- a/docs/_data/template/repo.tpl.yaml +++ b/docs/_data/template/repo.tpl.yaml @@ -1,3 +1,4 @@ + ### BEGIN MKDOCS TEMPLATE ### ### WARNING, DO NOT UPDATE CONTENT BETWEEN MKDOCS TEMPLATE TAG !### ### Modified content will be overwritten when updating.### @@ -29,11 +30,13 @@ repo_name: # (OPTIONAL) Path, relative to `docs_dir` mkdocs config, to the logo of the # repo. If not specified, path will automatically be set to - # `assets/img/meta/reop_name_logo.png` - #logo: "assets/img/meta/repo_template_logo.png" + # `assets/img/meta/repo_name_logo.png` + #logo: "assets/img/meta/repo_name_logo.png" # Description of the repo, will be used to setup the mkdocs description. desc: >- - Repo description with markdown support + An explicit description to explain what my repo do. Can be a multiline + description with **markdown** support such as + [link](https://url.domain.tld) and more. # (OPTIONAL) If you plan to use `mkdocstring` plugins to render python # source code, you will need to provide the path where your source files @@ -47,3 +50,4 @@ repo_name: - name: "Firstname Lastname" mail: "mail@domain.tld" ### END MKDOCS TEMPLATE ### + diff --git a/docs/_data/template/subrepo.tpl.yaml b/docs/_data/template/subrepo.tpl.yaml index 07ca0f40be28fa4711ace0eb6a5c95aace2b4f0d..bd0ff061b65b6fc3a55ddfc5b52a62ef7a4787df 100644 --- a/docs/_data/template/subrepo.tpl.yaml +++ b/docs/_data/template/subrepo.tpl.yaml @@ -1,3 +1,4 @@ + ### BEGIN MKDOCS TEMPLATE ### ### WARNING, DO NOT UPDATE CONTENT BETWEEN MKDOCS TEMPLATE TAG !### ### Modified content will be overwritten when updating.### @@ -25,6 +26,10 @@ subrepo: # - name: subrepo_1 # # SSH or HTTP link to the online subrepo_1 # git_url: git@domain.tld:namesapce/subrepo_1 + # # Key `subpath` is a str pointing to the path in the subrepo where + # # there is a file `mkdocs.yaml` and folder `docs` if not the root + # # of the subrepo + # subpath: sub/dir/ # # List of subdirectory from `dir_name` which are repos with # # mkdocs documentation which will be included in the documentation. # external: @@ -34,6 +39,10 @@ subrepo: # - name: subrepo_2 # # SSH or HTTP link to the online subrepo_2 # git_url: git@domain.tld:namesapce/subrepo_2 + # # Key `subpath` is a str pointing to the path in the subrepo where + # # there is a file `mkdocs.yaml` and folder `docs` if not the root + # # of the subrepo + # subpath: sub/dir/ # # Another sub dir_name which also old subrepos # subdir_name: # nav_entry: "Sub Nav Entry" @@ -75,3 +84,4 @@ subrepo: # - Mkdocs Template: /my_program/mkdocs_template/ # ``` ### END MKDOCS TEMPLATE ### +