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

Generate API docs #1884

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

lucacome
Copy link
Member

@lucacome lucacome commented Apr 25, 2024

Proposed changes

Problem: We want to have our CRDs documented

Solution: Use gen-crd-api-reference-docs to automatically generate the
docs

Closes #1754

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.

NONE

@github-actions github-actions bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file labels Apr 25, 2024
@lucacome lucacome force-pushed the docs/generate-api-docs branch 3 times, most recently from 9838a02 to 06d6744 Compare April 25, 2024 22:16
@lucacome lucacome marked this pull request as ready for review April 25, 2024 22:16
@lucacome lucacome requested review from a team as code owners April 25, 2024 22:16
@lucacome
Copy link
Member Author

@nginxinc/nginx-docs I need your help to make the new page look good 😅

@@ -0,0 +1,1151 @@
---
Copy link
Member

Choose a reason for hiding this comment

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

Is there any way to see this page rendered? It doesn't seem to have deployed in Netlify (although I might just be looking in the wrong place 😅)

Copy link
Member Author

Choose a reason for hiding this comment

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

seems like it didn't deploy after a force push, we have it now https://deploy-preview-1884--nginx-gateway-fabric.netlify.app/nginx-gateway-fabric/reference/api/

It doesn't look good 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

We should have an example of generated API documentation for other software: I'll inquire with the team what the caveats are.

Copy link
Contributor

Choose a reason for hiding this comment

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

The NGINX One API ref guide just calls the JSON spec and redoc does the formatting auto-magically.

See: https://github.com/nginxinc/docs/blob/main/content/nginx-one/reference/api/nginx-one-api-reference.md

Published output: https://docs.nginx.com/nginx-one/reference/api/nginx-one-api-reference/

Copy link
Contributor

Choose a reason for hiding this comment

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

The doc type is "redoc"

image

Copy link
Member Author

Choose a reason for hiding this comment

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

@travisamartin it's a little bit different from the Open API Spec, we don't have a JSON.
It's something similar to https://gateway-api.sigs.k8s.io/reference/spec/

Copy link
Member Author

Choose a reason for hiding this comment

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

@ADubhlaoich @travisamartin any chance you can help with this?

Copy link
Contributor

Choose a reason for hiding this comment

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

@lucacome Some more investigation work is required on our end about if an existing template can be adapted for this.

Does the Gateway API follow a specific, known schema?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure, this is just an html page

@ADubhlaoich
Copy link
Contributor

@Jcahilltorre @travisamartin Any thoughts on the formatting issues for this generated API documentation?

I think there's some examples without these formatting issues in NGINX Management Suite, which are OpenAPI based IIRC.

@lucacome lucacome force-pushed the docs/generate-api-docs branch 2 times, most recently from 7383009 to ed76c4d Compare April 30, 2024 16:06
Problem: We want to have our CRDs documented

Solution: Use gen-crd-api-reference-docs to automatically generate the
docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

Auto-generate docs for NGF CRDs
4 participants