Skip to content

Use crd-ref-docs for API reference documentation generation#563

Merged
afritzler merged 4 commits intomainfrom
bug/fix-make-docs
Dec 10, 2025
Merged

Use crd-ref-docs for API reference documentation generation#563
afritzler merged 4 commits intomainfrom
bug/fix-make-docs

Conversation

@xkonni
Copy link
Contributor

@xkonni xkonni commented Dec 10, 2025

Replaced outdated github.com/ahmetb/gen-crd-api-reference-docs (v0.3.0, last updated 2020) with github.com/elastic/crd-ref-docs (v0.2.0).

The old tool was incompatible with modern Go versions and failed to parse types with embedded netip.Addr/netip.Prefix fields. The new tool successfully generates API reference documentation.

Changes:

  • Tool: ahmetb/gen-crd-api-reference-docselastic/crd-ref-docs
  • Version: v0.3.0 → v0.2.0
  • Command flags updated to match new tool's API

@github-actions github-actions bot added size/XXL bug Something isn't working documentation Improvements or additions to documentation labels Dec 10, 2025
switch from gen-crd-api-reference-docs to crd-ref-docs as the previous
one is not maintained and threw errors when running in osx with go1.25.5

Initially the output changes a lot, but all information is there and the formatting
is nice and easy to read.
@asergeant01
Copy link
Contributor

Looks good to me

Copy link
Member

@afritzler afritzler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should consider removing the configs in the hack folder.

@afritzler afritzler changed the title fix make docs, switch to elastic/crd-ref-docs Use crd-ref-docs for API reference documentation generation Dec 10, 2025
@xkonni xkonni self-assigned this Dec 10, 2025
@afritzler afritzler added enhancement New feature or request and removed bug Something isn't working labels Dec 10, 2025
@afritzler
Copy link
Member

Somehow apiVersion and kind are doubled in the output. Maybe that is "works as designed" ... But in general I like the rendered output better. @xkonni did you also have a look at the rendered version via make start-docs?

Screenshot 2025-12-10 at 10 57 31

@xkonni
Copy link
Contributor Author

xkonni commented Dec 10, 2025

We should consider removing the configs in the hack folder.

the config is being used updated to remove field descriptions and removed obsolete templates.

@xkonni
Copy link
Contributor Author

xkonni commented Dec 10, 2025

Somehow apiVersion and kind are doubled in the output. Maybe that is "works as designed" ... But in general I like the rendered output better. @xkonni did you also have a look at the rendered version via make start-docs?

Screenshot 2025-12-10 at 10 57 31

fixed it in the latest commit.

Copy link
Member

@afritzler afritzler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @xkonni for this great PR!

@afritzler afritzler merged commit 6d0581a into main Dec 10, 2025
14 checks passed
@afritzler afritzler deleted the bug/fix-make-docs branch December 10, 2025 11:44
@github-project-automation github-project-automation bot moved this to Done in Roadmap Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/metal-automation documentation Improvements or additions to documentation enhancement New feature or request size/XXL

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants