mawosoft / WindowsSearchManager

Powershell module for managing Windows Search.
https://mawosoft.github.io/WindowsSearchManager/
MIT License
6 stars 0 forks source link

Linking tocs inserts unwanted extra toc level. #7

Closed mawosoft closed 1 year ago

mawosoft commented 1 year ago

reference/toc.yml link to api/toc.yml inserts unwanted extra toc level. If linking to api index page, we get two separate tocs.

WindowsSearchManager
├─ (cmdlets)
Mawosoft.PowerShell.WindowsSearchManager
├─ Mawosoft.PowerShell.WindowsSearchManager
   ├─ (types)

If there is a way in DocFx to configure this properly, I haven't found it yet. But the following approach works and we can create all tocs automatically

1) Extend convertPlatyPStoDocFxMarkdown.ps1 to also create the reference/toc.yml for the cmdlets. 2) Run docfx metadata to generate the api/*.yml and api/toc.yml for the types. 3) Join both tocs into a single file at reference/toc.yml 4) Run docfx build to generate the website. The api/toc.yml must be either explicitly excluded in docfx.json or just deleted in Step 3.

Also make sure to update the Inputs/Outputs for the docs build targets to include the *.cs files the metadata step depends upon. We've forgotten this in the current iteration.

Not sure yet if the two docfx runs should also be split into separate build targets.