Skip to content

Commit

Permalink
Add support of mkdocs macros
Browse files Browse the repository at this point in the history
The mkdocs macros plugin also us to add variables in the markdown,
including some predefined variables such as those from git metadata.

In this case, the git short tag is used to automatically have the
revision tag up-to-date with the latest version in the pre-commit
config.

https://github.com/fralau/mkdocs-macros-plugin
https://mkdocs-macros-plugin.readthedocs.io/en/latest/git_info/

Signed-off-by: Eric Brown <eric.brown@securesauce.dev>
  • Loading branch information
ericwb committed Oct 3, 2024
1 parent 02b0666 commit da1bea4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,12 @@ precli -h
## Version control integration

Use [pre-commit](https://pre-commit.com/). Once you have it installed, add
this to the `.pre-commit-config.yaml` in your repository
(be sure to update `rev` to point to a real git tag/revision!):

this to the `.pre-commit-config.yaml` in your repository:

```
repos:
- repo: https://github.com/securesauce/precli
rev: '' # Update me!
rev: {{ git.short_tag }}
hooks:
- id: precli
```
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mkdocs
mkdocstrings[python]
mkdocs-material
mkdocs-macros-plugin
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ theme:
plugins:
- mkdocstrings
- search
- macros

nav:
- Home: index.md
Expand Down

0 comments on commit da1bea4

Please sign in to comment.