new: Add generated documentation website - #639
Open
lgarber-akamai wants to merge 41 commits into
Open
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
This pull request implements a new generated documentation site that is automatically pushed to GitHub Pages.
The below preview URLs can be preview the documentation site in your browser:
Rendering
This PR uses Sphinx with the Read the Docs theme to render documentation. The Sphinx configuration and all relevant static files are stored under the
docsdirectory.Command Documentation Generation
Due to the complexity and abundance of CLI commands, the logic to generate documentation pages for CLI commands is located in the
linodecli/documentationdirectory.The
linodecli/documentation/templatesdirectory contains various Jinja2 templates which are dynamically rendered using the structures defined inlinodecli/documentation/template_data.py.CLI documentation pages are rendered to a user-defined directory when
linode-cli generate-docsis called. This is an indirect dependency of themake generate-docstarget, which will automatically render the command documentation into thedocs/_generateddirectory before executing any Sphinx commands.Publishing
To automatically publish the documentation to a publicly available URL, this PR adds a new documentation.yml GitHub Actions workflow file.
This workflow has three jobs:
Build the documentation and upload it as an artifact
Pull down the built docs from the first step and commit them to the
_documentationbranchmain,dev)_documentationbranch automatically be created if it does not already exist.Pull down the built docs from the first step and upload them as a release asset.
The Documentation Branch
This PR uses a dedicated documentation branch because it allows us to make multiple versions of the documentation available at at time. Additionally, this allows us to manually rebase any sensitive/unwanted documentation details.
This branch stores all relevant versions as subdirectories, with the
latestdirectory andindex.htmlfiles being updated on-demand by job #2 (mentioned above).✔️ Testing
The following test steps assume you have pulled down this PR locally and run
make install.Unit Testing
Documentation Rendering
generate-docstarget:Ensure the documentation generates successfully.
Open the documentation index in your browser:
Publishing
new/doc-generationbranch on your fork containing the changes from this PR:BuildandCommit to Pages Branchjobs under theBuild Documentationworkflow run successfully under your fork.Deploy from a branch, the target branch to the_documentationbranch, and the path to/ (root).MYGHUSERNAME.github.io/linode-cli/new/doc-generation.new/doc-generationbranch.new/doc-generationbranch with the formatvX.X.X.MYGHUSERNAME.github.io/linode-cli/latest.📷 Preview
Configuration Page