Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MKDocs Template
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EDP
MKDocs Template
Commits
756e833a
Verified
Commit
756e833a
authored
4 years ago
by
Romain Deville
Browse files
Options
Downloads
Patches
Plain Diff
Improve plugins.py in documentation and tpl.yaml
parent
8e22d41d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docs/_data/plugins.py
+14
-12
14 additions, 12 deletions
docs/_data/plugins.py
docs/_data/template/repo.tpl.yaml
+7
-3
7 additions, 3 deletions
docs/_data/template/repo.tpl.yaml
docs/_data/template/subrepo.tpl.yaml
+10
-0
10 additions, 0 deletions
docs/_data/template/subrepo.tpl.yaml
with
31 additions
and
15 deletions
docs/_data/plugins.py
+
14
−
12
View file @
756e833a
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
docs/_data/template/repo.tpl.yaml
+
7
−
3
View file @
756e833a
### 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/re
o
p_name_logo.png`
#logo: "assets/img/meta/repo_
templat
e_logo.png"
# `assets/img/meta/rep
o
_name_logo.png`
#logo: "assets/img/meta/repo_
nam
e_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 ###
This diff is collapsed.
Click to expand it.
docs/_data/template/subrepo.tpl.yaml
+
10
−
0
View file @
756e833a
### 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 ###
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment