Skip to content

Move common code from the template's docs/_scripts/macros.py to a new frequenz.repo.config.mkdocs.macros module #176

@llucax

Description

@llucax

What's needed?

We need to remove boilerplate code from the user's repository, otherwise when the user customize these files and there is a new version, upgrading is much harder as the changes need to be merged.

Proposed solution

Move the boilerplate code to library code:

  • Create frequenz.repo.config.mkdocs.macros.
  • Move the functions _CODE_ANNOTATION_MARKER, _slugify and _hook_macros_plugin to the new module and make them public.
  • Update the templates to remove these and use them from the library, and also remove the mypy ignore for Markdown, as the user code doesn't need to import it directly anymore.

Use cases

No response

Alternatives and workarounds

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    part:cookiecutterAffects the generation of projects using cookiecutterpart:mkdocsAffects the configuration of mkdocstype:enhancementNew feature or enhancement visitble to users

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions