pulp / pulp-docs

Python Package to help aggregating Pulp's multirepo ecosystem into a unified doc.
https://pedro-psb.github.io/pulp-docs/
2 stars 4 forks source link

Add summary section as Repositories main page #49

Closed pedro-psb closed 2 months ago

pedro-psb commented 2 months ago

To improve the navigability of the website, I want to add landing page for each repository listed with a generated ToC.

This should enable skimming through the entire summary, instead of having to expand all the sections one-by-one.

Requirements

Given the main left navbar, which list the repository namespaces (e.g "Pulp Core", "Pulp RPM", "Pulp CLI", etc)

As a user who want to find info about a specific Repository, when clicking on a Repository namespace I wanna see:

pedro-psb commented 2 months ago

Some notes from early experiments:

# on hooks.py
def on_nav(nav, config, files):
    """
    Create repo-index-toc data here.
    See hook events: https://www.mkdocs.org/dev-guide/plugins/#events
    """
    # get each repository subtree in nav.items (Tree of Section/Pages)
    # for each subtree, serialize to markdown list structure
    # save serialized markdown string
    # write to files here or on_page events
    ...