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 Documentation Generation and Deployment #312

Closed
wants to merge 3 commits into from
Closed

Conversation

rachfop
Copy link

@rachfop rachfop commented May 11, 2024

Description:

This pull request adds the capability to generate API documentation using pydoctor and automatically deploy it to GitHub Pages.

Changes

  • Added a new GitHub Actions workflow (CI-api-docs.yml) to generate and deploy API documentation.
  • Updated the pydoctor command in the workflow to match the project's folder structure and configuration.
  • Configured the workflow to generate API documentation on every push to the repository.

Deployment to GitHub Pages

Please note that after merging this pull request, additional steps are required to enable GitHub Pages for the repository:

  1. Go to the repository settings on GitHub.
  2. Navigate to the "Pages" section.
  3. Under "Source", select the "gh-pages" branch and click "Save".
  4. Re-run the apidocs workflow to trigger the first deployment.

As mentioned in the actions-gh-pages documentation, the first workflow run won't actually publish the documentation to GitHub Pages. GitHub Pages needs to be enabled afterwards in the repository settings, select the gh-pages branch, then re-run your workflow.

Once the deployment is complete, the API documentation will be accessible at:

https://runpod.github.io/runpod-python/

Preview

You can preview the generated API documentation by running the pydoctor command locally:

pydoctor \
    --project-name=RunPod \
    --project-version=your-project-version \
    --project-url=https://github.com/runpod/runpod-python \
    --html-viewsource-base=https://github.com/your-username/your-repo/tree/your-branch-or-tag \
    --make-html \
    --html-output=docs/api \
    --project-base-dir="." \
    --docformat=restructuredtext \
    --intersphinx=https://docs.python.org/3/objects.inv \
    ./runpod

The generated documentation will be available in the docs/api directory.

Please review the changes and let me know if you have any questions or suggestions.

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.

1 participant