Skip to content

Split mkdocs utils out to a new frequenz-mkdocsutil repo #443

@llucax

Description

@llucax

What's needed?

Extract all Python-only mkdocs helpers into frequenz-mkdocsutil. This package serves projects that need to generate Python API reference pages (via mkdocs-gen-files / mkdocstrings) and should not depend on protobuf or build-time tooling.

Proposed solution

Files to move

  • src/frequenz/repo/config/mkdocs/api_pages.py — the Python-related functions (e.g. generate_python_api_pages)
  • src/frequenz/repo/config/mkdocs/mkdocstrings_macros.py — mkdocstrings macros for rendering examples (if used)
  • src/frequenz/repo/config/mkdocs/mike.py — mike helpers (optional; or provide as an extra mike)

Possible new repository layout

  • frequenz.mkdocsutil (package)
    • __init__.py (exports generate_python_api_pages)
    • api_pages.py
    • mkdocstrings_macros.py (optional)
    • mike_helpers.py (optional)

Dependencies

  • Minimal runtime deps: mkdocs-gen-files, mkdocstrings, mkdocs-material

Docs/build usage example

  • In a docs build environment (dev or docs extra):
[project.optional-dependencies]
mkdocs = [
  "frequenz-mkdocsutil>=X.Y,<X+1",
]

and in the mkdocs script:

from frequenz_mkdocs_python import generate_python_api_pages

generate_python_api_pages("src", "python-reference")

Metadata

Metadata

Assignees

Labels

part:mkdocsAffects the configuration of mkdocstype:tech-debtImproves the project without visible changes for users

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions