Feat/gen toc#477
Conversation
…eviewer Add @VelmiraS as Docforge reviewer
documentation fixes
feat: make GitHub host configurable via github-oauth-env-map
Go map iteration is randomized, causing gen-toc to produce different file ordering on each run. Sort the result slice before returning.
|
Adding label DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
What this PR does / why we need it:
Adds a new gen-toc subcommand that generates a navigation YAML file from a Docforge manifest. The generated structure reflects the dir / file / fileTree hierarchy defined in the manifest and can be used as input for SAP portal (toc.yaml)
Also fixes a non-deterministic ordering bug in Tree() output caused by Go map iteration randomness — without this fix, repeated runs of gen-toc on the same manifest could produce different orderings.
Which issue(s) this PR fixes:
Fixes ##471
Special notes for your reviewer:
The gen-toc subcommand does not download files — it only resolves the manifest and derives the navigation structure. The --strip-root flag removes the top-level directory prefix from all paths in the output.
The ordering fix in pkg/registry/repositoryhost/github_http_cache.go (sort.Strings(out) in Tree()) is a minimal, safe change — GitHub API already returns entries alphabetically, so the sort produces the same result as preserving API order.
Release note:
Added
gen-tocsubcommand to generate a navigation YAML from a Docforge manifest without downloading any files. Supports VitePress, MkDocs, SAP portal (toc.yaml), and other navigation formats. Use--strip-rootto remove the top-level directory prefix from all paths.