Automatically generate per-submodule API reference doc pages in template

Đang mở
#573 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
documentation

Hướng nghiên cứu

Start with the template's {{cookiecutter.project_slug}}/mkdocs.yml and docs/api.md, then read the linked mkdocstrings recipe for automatic code reference pages. Check how mkdocs_gen_files and mkdocs-literate-nav fit the template's existing configuration. Done means generated docs provide per-submodule API pages and navigation without manually maintained stubs.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement
Is Your Feature Request Related to a Problem? Please Describe

Currently the mkdocstrings configuration for the MkDocs docs in the template

https://github.com/UCL-ARC/python-tooling/blob/f1a228d564614619b61e3783f7527b5b5672efb6/%7B%7Bcookiecutter.project_slug%7D%7D/mkdocs.yml#L46-L55

is set up to show submodules on the same page as the parent package, with a single 'API reference' page included in the docs

https://github.com/UCL-ARC/python-tooling/blob/f1a228d564614619b61e3783f7527b5b5672efb6/%7B%7Bcookiecutter.project_slug%7D%7D/docs/api.md?plain=1#L1-L3

While this works reasonably for small packages, once packages start getting larger it gets cumbersome to have all the API documentation on a single page.

In Sphinx the analagous autodoc plug-in instead defaults to creating a nested directory structure in the built docs reflecting the package structure with one page per submodule and appropriate indices to link all the nav together.

This can be achieved manually in our current set up by setting show_submodules to False, creating a Markdown source page for each submodule with the appropriate content, and adding entries to the nav section for each of the module pages but this is obviously very error prone / likely to end up getting out of sync.

Describe the Solution You'd Like

The mkdocstrings docs has instructions for setting up a recipe to automate building the appropriate module stub pages using mkdocs_gen_files plug-in and generating the navigation structure using mkdocs-literate-nav - ideally we should implement this in the template.

Describe Alternatives You've Considered

No response

Additional Context

No response

Ngôn ngữ chính
Python
Star
62
Fork
10
Merge trung bình
7 ngày 6 giờ
Pull request đã merge (30 ngày)
6

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của UCL-ARC/python-tooling

Tất cả issue của UCL-ARC/python-tooling

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.