Add CI for Sphinx/ReadTheDocs build #161
Merged
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.
Closes #152
This change adds a GitHub action to locally build the Sphinx build used by ReadTheDocs as a check for pull requests, so that we can catch problematic changes before they are merged. After the build completes without errors, a "linkcheck" build is run that checks that all links to external sites are valid links. Links between documents are currently not checked, as there are some in the User Guide and other docs that are not correct and require further changes in the main slang repo.
This change also adds the
build_toctreebuild flag to the Sphinx build, which when specified will uncomment the toctree directives in the files and build them into the standard Sphinx TOC, which we do not build for the actual deployment (due to the O(n^2) build times), so that the build can warn against inaccessible docs. Theadd_orphan_directiveis used to suppress those warnings by addingorphan: trueto the frontmatter so that Sphinx will not complain about the doc not existing in a toctree when we leave it uncommented.All warnings should be treated as errors (except for "myst.header", which is a warning for a cosmetic issue), but that will require making changes to various docs and doc generators in the main slang repo first to eliminate those warnings. Once those are fixed, the
-Wflag needs to be added to the build, and the suppressed warnings "myst.xref_missing" and "myst.xref_ambiguous" need to be unsuppressed.