|
| 1 | +# Development Context |
| 2 | + |
| 3 | +This file captures the original prompts and context that motivated the changes to this fork of mkdocs-monorepo-plugin. |
| 4 | + |
| 5 | +## Original Problem Statement |
| 6 | + |
| 7 | +The user wanted to reorganize documentation navigation in a monorepo setup. Specifically: |
| 8 | + |
| 9 | +1. **Initial Request**: Reorganize guides to highlight "Running Applications in Kubernetes" at the top level |
| 10 | + - Original prompt: "I believe the guides Certificate Management with cert-manager, Using Public IPs for Egress Traffic, Configuring GitLab Datasource Access need to be organized, these are like individual topics. I would like to highlight at the top level Running Applications in Kubernetes" |
| 11 | + |
| 12 | +2. **Navigation Structure Goals**: |
| 13 | + - Surface TigerCLI guides prominently (currently under "Others → TigerCLI → Guides") |
| 14 | + - Categorize other guides under thematic sections (Security, Cost Management, Observability) |
| 15 | + - Avoid duplicating the entire TigerCLI navigation tree |
| 16 | + |
| 17 | +3. **Technical Challenge**: |
| 18 | + - Original prompt: "Can we have multiple locations?" (regarding including TigerCLI in multiple places) |
| 19 | + - The existing mkdocs-monorepo-plugin didn't support including only a subset of a navigation tree |
| 20 | + - Using `!include` would either: |
| 21 | + - Include the entire navigation tree, or |
| 22 | + - Require manual duplication of content |
| 23 | + |
| 24 | +4. **Solution Direction**: |
| 25 | + - Original prompt: "Can we make 'Kubernetes and TigerCLI' use the build-deploy/tigercli guide section of the tree? Like can I reference a heading inside of mkdocs?" |
| 26 | + - Fork mkdocs-monorepo-plugin to add anchor-based partial navigation inclusion |
| 27 | + - Implement syntax: `!include path/to/mkdocs.yml#SectionName` |
| 28 | + |
| 29 | +## Design Decisions |
| 30 | + |
| 31 | +### Alias Generation Strategy |
| 32 | +When an anchor is used, the alias is generated as `{site_name}-{SectionName}` to: |
| 33 | +- Ensure uniqueness from the full include |
| 34 | +- Allow the same mkdocs.yml to be included both fully and partially |
| 35 | +- Provide clear, predictable naming |
| 36 | + |
| 37 | +### Known Limitations |
| 38 | +Original prompt: "The fragment syntax uses the alias name correct? It then generates a new alias. I suppose this could result in collisions and might make this potentially incompatible." |
| 39 | + |
| 40 | +We documented this in `limitations.md`: |
| 41 | +- If `site_name` of one file matches the generated alias of another (`{SiteName}-{Section}`), a collision occurs |
| 42 | +- Build-time detection with clear error messages |
| 43 | +- Workaround: Avoid naming patterns that match generated aliases |
| 44 | + |
| 45 | +### Testing Philosophy |
| 46 | +Original prompt: "Can we test / assert for an expected failure? How specific can we get? Let's use existing practices in the project if it already has some form of test harness, mocking etc." |
| 47 | + |
| 48 | +- Used existing `unittest` framework |
| 49 | +- Added `test_alias_collision_detection()` to document and test the collision scenario |
| 50 | +- Followed existing pattern of `self.assertRaises(SystemExit)` for expected failures |
| 51 | + |
| 52 | +## Final Navigation Structure |
| 53 | + |
| 54 | +```yaml |
| 55 | +nav: |
| 56 | +- Components: "*include docs/vendor/build-deploy/planet-idp/components/*/mkdocs.yml" |
| 57 | +- Guides: |
| 58 | + - Deploying Applications: "!include docs/vendor/build-deploy/tigercli/mkdocs.yml#Guides" |
| 59 | + - Security: |
| 60 | + - Certificate Management with cert-manager: guide/certificate-management-with-cert-manager.md |
| 61 | + - Cost Management: |
| 62 | + - Using Public IPs for Egress Traffic: guide/using-public-ips-for-egress-traffic.md |
| 63 | + - Observability: |
| 64 | + - Configuring GitLab Datasource Access: guide/configuring-gitlab-datasource-access.md |
| 65 | +- Others: |
| 66 | + - TigerCLI: "!include docs/vendor/build-deploy/tigercli/mkdocs.yml" |
| 67 | +``` |
| 68 | +
|
| 69 | +This structure: |
| 70 | +- Highlights deployment guides prominently under "Guides → Deploying Applications" |
| 71 | +- Organizes other guides thematically |
| 72 | +- Keeps full TigerCLI documentation available under "Others" |
| 73 | +- Uses the new anchor syntax to extract only the "Guides" section |
| 74 | +
|
| 75 | +## Attribution |
| 76 | +
|
| 77 | +Changes developed with assistance from Claude Code (Anthropic), as noted in commit messages with co-authorship attribution. |
0 commit comments