-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add api reference docs #567
Conversation
✔️ Deploy Preview for karpenter-docs-prod ready! 🔨 Explore the source changes: 898af32 🔍 Inspect the deploy log: https://app.netlify.com/sites/karpenter-docs-prod/deploys/61042780a0d95c0007fae1ce 😎 Browse the preview: https://deploy-preview-567--karpenter-docs-prod.netlify.app |
@@ -0,0 +1,439 @@ | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need an automated mechanism to copy these docs.
Something like
codegen: ## Generate code. Must be run if changes are made to ./pkg/apis/...
...
gen-crd-api-reference-docs \
-api-dir ./pkg/apis/provisioning/v1alpha3 \
-config $(shell go env GOMODCACHE)/github.com/ahmetb/gen-crd-api-reference-docs@v0.3.0/example-config.json \
-out-file website/content/en/docs/Reference/_index.md \
-template-dir $(shell go env GOMODCACHE)/github.com/ahmetb/gen-crd-api-reference-docs@v0.3.0/template
What happens if we're missing the top of this index file?
---
title: "API Reference"
linkTitle: "API Reference"
weight: 70
---
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's #532 :)
we need that "frontmatter" (in hugo terms) for the page header and nav structure to render properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about combining the output with a template and overwriting the existing page?
codegen: ## Generate code. Must be run if changes are made to ./pkg/apis/...
...
gen-crd-api-reference-docs \
-api-dir ./pkg/apis/provisioning/v1alpha3 \
-config $(shell go env GOMODCACHE)/github.com/ahmetb/gen-crd-api-reference-docs@v0.3.0/example-config.json \
-out-file website/content/en/docs/Reference/code-gen.txt \
-template-dir $(shell go env GOMODCACHE)/github.com/ahmetb/gen-crd-api-reference-docs@v0.3.0/template
cat <(cat website/content/en/docs/Reference/api-docs-header.txt) \
website/content/en/docs/Reference/code-gen.txt \
> website/content/en/docs/Reference/_index.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks perfect. Bonus points for not creating a temp file.
can we merge this right now, and then I'll keep on the issue to automate? |
Sorry I assumed WIP because of the title. |
One tiny detail. Can you delete API.md now that this is on the website? |
ok, rebased, removed api.md, and ready for review |
Description of changes:
This PR copies the auto generated API docs into the hugo site.
Todo:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.