-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move mkdocstrings-macros integration to a library #349
Open
llucax
wants to merge
16
commits into
frequenz-floss:v0.x.x
Choose a base branch
from
llucax:robotech
base: v0.x.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
github-actions
bot
added
the
part:template
Affects the cookiecutter template files
label
Feb 4, 2025
llucax
added
type:enhancement
New feature or enhancement visitble to users
type:tech-debt
Improves the project without visible changes for users
part:mkdocs
Affects the configuration of mkdocs
labels
Feb 4, 2025
This module is basically documentation, but there is some relationship to macros as we'll provide the `CODE_ANNOTATION_MARKER` as a macro variable, so we take the opportunity to unify the documentation in one place. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
This module provides the required hooking, so macros can be used inside docstrings properly when using `mkdocstrings`. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
This commit adds a new utility function to retrieve version information from the repository and expose it as a couple of macro variables. This function is also called from the convenience `define_env()` function, so the variables are provided by default. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
The new function `hook_env_with_everything()` will do all the default hooking, so it is easier to define a custom `define_env()` where only a few macros are added, but still gets all the variables macros and filters provided by this module. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
For the basic usage we can actually use the module itself as a *pluglet*: https://mkdocs-macros-plugin.readthedocs.io/en/latest/pluglets/ Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
With this, there is no need for customization unless you want to define your own macros. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
The macros plugin already offer easy access to git info, so we can do a last resort try of getting the current sha from there. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
This completely removes the macros script. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
We now use the *pluglet* for templates too. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
part:mkdocs
Affects the configuration of mkdocs
part:template
Affects the cookiecutter template files
type:enhancement
New feature or enhancement visitble to users
type:tech-debt
Improves the project without visible changes for users
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR moves the documentation macros functionality from individual template repositories into a central location, making it available as a
macros
pluglet. Key improvements include:macros
pluglet with common functionalityThe PR also bumps template dependencies and repository configuration versions in preparation for the 0.12 release.
Fixes #179.