Skip to content

Commit

Permalink
docs: add MkDocs support for variables
Browse files Browse the repository at this point in the history
  • Loading branch information
silopolis committed Nov 22, 2023
1 parent eb961d3 commit 2264f72
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/includes/extra.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Define global variables here
# You can create other files and add them to the plugins.macros.include_yaml
# array in mkdocs.yml
extra:
test_global_var: "Test global variable value"
7 changes: 7 additions & 0 deletions docs/includes/test.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Testing and demonstration page

{% set test_local_var = "Test local variable value" %}

## Variables

* test_local_var: {{ test_local_var }}
* test_global_var: {{ test_global_var }}


## Glossary

Expand Down
1 change: 1 addition & 0 deletions docs/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ mkdocs-git-revision-date-localized-plugin==1.2.1
mkdocs-material[imaging]==9.4.9
mkdocs-ezglossary-plugin==1.5.5
mkdocs-kroki-plugin==0.6.1
mkdocs-macros-plugin==1.0.5
# mkdocs-git-committers-plugin-2
# mkdocs-git-authors-plugin
# mkdocs-minify-plugin
Expand Down
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ plugins:
FileTypes:
- svg
- png
# https://fotrimzi.github.io/mkdocs-showcase/variables.html
- macros:
include_yaml: ['docs/includes/extra.yaml']
# https://squidfunk.github.io/mkdocs-material/setup/setting-up-social-cards/
- social
# enabled: !ENV [CI, false]
Expand Down
11 changes: 10 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jinja2==3.1.2
# mike
# mkdocs
# mkdocs-ezglossary-plugin
# mkdocs-macros-plugin
# mkdocs-material
markdown==3.5.1
# via
Expand All @@ -89,6 +90,7 @@ mkdocs==1.5.3
# mkdocs-ezglossary-plugin
# mkdocs-git-revision-date-localized-plugin
# mkdocs-kroki-plugin
# mkdocs-macros-plugin
# mkdocs-material
# mkdocs-section-index
mkdocs-awesome-pages-plugin==2.9.2
Expand All @@ -99,6 +101,8 @@ mkdocs-git-revision-date-localized-plugin==1.2.1
# via -r docs/requirements.in
mkdocs-kroki-plugin==0.6.1
# via -r docs/requirements.in
mkdocs-macros-plugin==1.0.5
# via -r docs/requirements.in
mkdocs-material[imaging]==9.4.9
# via -r docs/requirements.in
mkdocs-material-extensions==1.3
Expand Down Expand Up @@ -146,13 +150,16 @@ pyparsing==3.1.1
pyproject-hooks==1.0.0
# via build
python-dateutil==2.8.2
# via ghp-import
# via
# ghp-import
# mkdocs-macros-plugin
pytz==2023.3.post1
# via mkdocs-git-revision-date-localized-plugin
pyyaml==6.0.1
# via
# mike
# mkdocs
# mkdocs-macros-plugin
# pymdown-extensions
# pyyaml-env-tag
pyyaml-env-tag==0.1
Expand All @@ -175,6 +182,8 @@ sqlalchemy==1.4.41
# ormar
starlette==0.22.0
# via fastapi
termcolor==2.3.0
# via mkdocs-macros-plugin
tinycss2==1.2.1
# via
# cairosvg
Expand Down

0 comments on commit 2264f72

Please sign in to comment.