-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
119 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,56 @@ | ||
# mkdocs-jconfig-plugin | ||
|
||
This MkDocs plugin allows to process configuration variables using [Jinja](https://jinja.palletsprojects.com/) templates. | ||
|
||
## Installation | ||
|
||
Install the package with pip: | ||
|
||
```bash | ||
pip install mkdocs-jconfig-plugin | ||
``` | ||
|
||
Activate the plugin in `mkdocs.yml`: | ||
|
||
```yaml | ||
plugins: | ||
- search | ||
- calendar | ||
- jconfig | ||
``` | ||
## Configuration | ||
The plugin can be configured in the `plugins` section of `mkdocs.yml` as follows: | ||
|
||
```yaml | ||
plugins: | ||
- search | ||
- calendar | ||
- jconfig: | ||
items: | ||
- copyright | ||
``` | ||
|
||
The plugin supports the following configuration options: | ||
|
||
| Option | Description | | ||
|---------|-----------------------------------------------------------| | ||
| `items` | The configuration variables to process. Defaults to `[]`. | | ||
|
||
## Typical usage | ||
|
||
This plugin is useful when you want to automatically adjust the year in the copyright: | ||
|
||
```yaml | ||
copyright: copyright {{ cal.today.year }} The Authors | ||
plugins: | ||
- search | ||
- calendar | ||
- jconfig: | ||
items: | ||
- copyright | ||
``` | ||
|
||
Note that you need to activate the [calendar](https://github.com/supcik/mkdocs-calendar-plugin) plugin for this to work. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[tool.poetry] | ||
name = "mkdocs-jconfig-plugin" | ||
version = "0.1.0" | ||
description = "An MkDocs plugin to ..." | ||
version = "0.1.1" | ||
description = "An MkDocs plugin to process configuration items with Jinja2" | ||
authors = ["Jacques Supcik <[email protected]>"] | ||
repository = "https://github.com/supcik/mkdocs-jconfig-plugin" | ||
license = "Apache-2" | ||
|
@@ -29,6 +29,7 @@ black = "^23.3.0" | |
pylint = "^2.17.4" | ||
isort = "^5.12.0" | ||
pre-commit = "^3.3.3" | ||
mkdocs-calendar-plugin = "^0.3.0" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
# Hello | ||
|
||
{{ test }} | ||
|
||
Year : {{ year }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,15 @@ | ||
site_name: JConfig Plugin Test | ||
site_description: Test for JConfig Plugin | ||
copyright: copyright {{ year }} | ||
copyright: copyright {{ cal.today.year }} The Authors | ||
docs_dir: docs | ||
theme: readthedocs | ||
|
||
nav: | ||
- Main: index.md | ||
|
||
extra: | ||
year: 2023 | ||
test: we are in {{ year }} | ||
|
||
plugins: | ||
- search | ||
- calendar | ||
- jconfig: | ||
items: | ||
- copyright | ||
- extra.test | ||
- macros |