Skip to content

docs: add Mintlify helm-docs template for k8s-reporter#854

Merged
dangrondahl merged 1 commit into
mainfrom
mintlify-helm-template
May 4, 2026
Merged

docs: add Mintlify helm-docs template for k8s-reporter#854
dangrondahl merged 1 commit into
mainfrom
mintlify-helm-template

Conversation

@dangrondahl
Copy link
Copy Markdown
Contributor

Summary

  • Add a second helm-docs template set (MINTLIFY.md.gotmpl + _mintlify_templates.gotmpl) that generates Mintlify-compatible output with <ParamField> components and an <Info> version callout
  • Share all prose sections (install, upgrade, customCA, etc.) with the existing README template via _templates.gotmpl to avoid duplication
  • Remove {.command} Hugo attribute from shell code fences (Mintlify doesn't support it; GitHub ignores it)
  • Wrap <instance_name> in backticks in values.yaml so MDX parser won't treat it as an HTML tag

How it works

The docs repo workflow runs helm-docs twice with different template sets:

# GitHub README (existing):
helm-docs --template-files README.md.gotmpl,_templates.gotmpl

# Mintlify docs (new):
helm-docs --template-files MINTLIFY.md.gotmpl,_templates.gotmpl,_mintlify_templates.gotmpl --output-file k8s_reporter.md

Once this lands and a chart version is released, the hand-crafted helm/k8s_reporter.mdx in the docs repo can be deleted.

Test plan

  • Run helm-docs --template-files README.md.gotmpl,_templates.gotmpl --dry-run and verify README output is unchanged except {.command} removal
  • Run helm-docs --template-files MINTLIFY.md.gotmpl,_templates.gotmpl,_mintlify_templates.gotmpl --dry-run and verify Mintlify output has <ParamField> components with correct descriptions and defaults
  • Verify <instance_name> is wrapped in backticks in both outputs

Closes #853

Add a second helm-docs template set that generates Mintlify-compatible
output with <ParamField> components for the configurations section and
an <Info> version callout. The prose sections (install, upgrade, customCA,
etc.) are shared with the existing README template to avoid duplication.

Also fix two Mintlify-compatibility issues in the shared templates:
- Remove {.command} Hugo attribute from shell code fences
- Wrap <instance_name> in backticks in values.yaml env description

Closes #853
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 4, 2026

Claude finished @dangrondahl's task in 2m 11s —— View job


PR Review: Mintlify helm-docs template for k8s-reporter

  • Run static analysis (build, vet, mod tidy)
  • Read changed files and gather context
  • Review code quality and correctness
  • Post review feedback

Static Analysis

All clean — go build, go vet, and go mod tidy pass with no issues. (No Go code changed in this PR, as expected for a template-only change.)


Review Summary

Clean, well-structured PR. The shared-template approach avoids prose duplication, the {.command} removal is a sensible cleanup, and the MDX backtick fix is forward-thinking. A few minor observations below — nothing blocking.


Detailed Feedback

Good patterns worth calling out

  • Shared prose via _templates.gotmpl — install/upgrade/customCA sections are defined once and consumed by both README.md.gotmpl and MINTLIFY.md.gotmpl. This is the right approach and will prevent drift.
  • mintlify.paramField helper — cleanly handles the object/list edge case (omitting default attribute when the value is complex). The backtick-stripping on line 93 and quote-trimming on line 100 are correct for helm-docs output format.
  • Semantic grouping of values — the categorized sections (General, Image, Reporter configuration, etc.) are a usability improvement over a flat table for docs readers.

Minor observations

  1. Fragile "General" catch-all filter (_mintlify_templates.gotmpl:13) — The General section uses a long negative filter (not (or (hasPrefix "image." ...) ...)) meaning any new top-level key added to values.yaml in the future lands in General by default. This is probably the intended behavior, but it's worth being aware that new prefixed groups (e.g. if monitoring. keys are added later) would need a manual update to both the exclusion filter and a new section block. This is inherent to the approach and not really avoidable — just a maintenance note.

  2. Empty description fallback (_mintlify_templates.gotmpl:94) — $desc := or .Description .AutoDescription will produce an empty string if a value has neither a -- comment nor an auto-detected description. This would render <ParamField> with no body text. In practice all current values.yaml entries have descriptions, so this is theoretical — but if a bare key is ever added, the output would be subtly broken.

  3. Trailing --- in MINTLIFY.md.gotmpl (line 25) — In Mintlify, --- at the end of a document renders as a horizontal rule, which is fine. Just confirming this was intentional rather than leftover frontmatter syntax.

No issues found with

  • The {.command} removal from code fences — correct that Mintlify doesn't support Hugo attributes and GitHub ignores them
  • The `<instance_name>` backtick wrapping in values.yaml — necessary to prevent MDX parsing it as an HTML tag
  • Template invocation order in MINTLIFY.md.gotmpl — mirrors README.md.gotmpl structure with appropriate Mintlify-specific swaps (mintlify.versionInfo vs chart.versionBadge, mintlify.configurations vs chart.valuesTable)
  • Frontmatter in MINTLIFY.md.gotmpltitle and description are standard Mintlify page metadata

Verdict: Looks good to merge. No bugs or security issues. The template logic is correct and the approach is well-designed for maintainability.

@dangrondahl dangrondahl merged commit dfda890 into main May 4, 2026
20 checks passed
@dangrondahl dangrondahl deleted the mintlify-helm-template branch May 4, 2026 11:50
sofusalbertsen pushed a commit to kosli-dev/docs that referenced this pull request May 4, 2026
## Summary
- Updates the `helm-docs` template files in the reference docs workflow
to use Mintlify-specific templates (`MINTLIFY.md.gotmpl`,
`_mintlify_templates.gotmpl`) instead of `README.md.gotmpl`.

## Blocked on
- Waiting on kosli-dev/cli#854 to be merged first (adds the new template
files to the CLI repo).

## Test plan
- [ ] Merge kosli-dev/cli#854
- [ ] Trigger the `Update Reference Docs` workflow and verify helm docs
generate correctly with the new templates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: Helm chart README template produces Mintlify-incompatible markdown

2 participants