Skip to content
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

Merged
merged 1 commit into from
Jul 30, 2021
Merged

add api reference docs #567

merged 1 commit into from
Jul 30, 2021

Conversation

geoffcline
Copy link
Contributor

Description of changes:

This PR copies the auto generated API docs into the hugo site.

Todo:

  • brief intro on this page.
  • (eventually) automate building and including this.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@geoffcline geoffcline added the documentation Improvements or additions to documentation label Jul 28, 2021
@geoffcline geoffcline self-assigned this Jul 28, 2021
@geoffcline geoffcline added this to In progress in Documentation via automation Jul 28, 2021
@netlify
Copy link

netlify bot commented Jul 28, 2021

✔️ 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 @@
---
Copy link
Contributor

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
---

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

Copy link
Contributor

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.

@geoffcline
Copy link
Contributor Author

can we merge this right now, and then I'll keep on the issue to automate?

@ellistarn
Copy link
Contributor

can we merge this right now, and then I'll keep on the issue to automate?

Sorry I assumed WIP because of the title.

ellistarn
ellistarn previously approved these changes Jul 30, 2021
@ellistarn
Copy link
Contributor

One tiny detail. Can you delete API.md now that this is on the website?

@geoffcline geoffcline changed the title [WIP] add api reference docs add api reference docs Jul 30, 2021
@geoffcline geoffcline marked this pull request as ready for review July 30, 2021 16:20
@geoffcline
Copy link
Contributor Author

ok, rebased, removed api.md, and ready for review

@geoffcline geoffcline moved this from In progress to in review in Documentation Jul 30, 2021
@ellistarn ellistarn merged commit b15abb5 into aws:main Jul 30, 2021
Documentation automation moved this from in review to Done Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants