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

Docs: Add API Reference as top-level nav #2180

Merged
merged 2 commits into from
Nov 28, 2024
Merged

Conversation

ikreymer
Copy link
Member

can either link to redoc hosted elsewhere or make a local copy:

  • for local frontend build, just redirect to http://localhost:30870/api/redoc
  • for deployment, make local copy: run copy-api-docs.sh, copy locally from prod and serve at /api/
  • copy-api-docs.sh copies openapi.json, redoc and logo to /api/ dir
  • if analytics enabled, also injects analytics scripts
  • for local testing, run copy-api-docs.sh and then run mkdocs serve
  • ci: copy from prod server
  • fixes Publish API docs separately #1582

- for local build, just point to http://localhost:30870/api/redoc
- for deployment, copy locally from prod and serve at /api/
- add copy-api-docs.sh to copy openapi.json, redoc and logo to /api/ dir
- for local testing, run copy-api-docs.sh and then run mkdocs serve
- fixes #1582
@ikreymer ikreymer requested a review from emma-sg November 26, 2024 02:09
Comment on lines +10 to +15
if [ -n $ENABLE_ANALYTICS ]; then
SCRIPT_1=' <script defer data-domain=\"docs.browsertrix.com\" src=\"https://p.webrecorder.net/js/script.outbound-links.js\"></script>'
SCRIPT_2=' <script>window.plausible = window.plausible || function () { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>'
awk "1;/<head>/{ print \"$SCRIPT_1\"; print \"$SCRIPT_2\" }" $TARGET/index.html > $TARGET/index.html.new
mv $TARGET/index.html.new $TARGET/index.html
fi
Copy link
Member

Choose a reason for hiding this comment

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

A little messy but it looks like we'd have to fork redoc's html template to do this when building it, so whatever

@ikreymer ikreymer merged commit 9911547 into main Nov 28, 2024
1 check passed
@ikreymer ikreymer deleted the docs-backend-api-link branch November 28, 2024 01:00
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.

Publish API docs separately
2 participants