-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 Sphinx documentation framework #19950
Conversation
@woody-apple please take a look on this PR. After getting a green light, we'll rebase it to current main. |
/rebase |
Initial commit for the doc portal framework. Signed-off-by: Grzegorz Ferenc <[email protected]>
Added sections to Examples doc container page. Restructured Guides landing page. Signed-off-by: Grzegorz Ferenc <[email protected]>
Fixed Markdown header levels to improve visibility for Examples container page. Signed-off-by: Grzegorz Ferenc <[email protected]>
Fixed or removed all warnings from Sphinx when building. Fixes include: - Linking errors - Typos - ToC tree errors - Adding MyST configuration data - Modify the external_content extension to allow syntax that renders on both GitHub and Sphinx Signed-off-by: Gaute Svanes Lunde <[email protected]>
Changed the GitHub rendered emoji ✔️ to the ascii symbol ✔ so that it renders with Sphinx. Signed-off-by: Gaute Svanes Lunde <[email protected]>
Add a workflow for building the documentation with Sphinx and deploy the generated html to the `gh-pages` branch. Signed-off-by: Gaute Svanes Lunde <[email protected]>
The incomplete API page has been removed, and doxygen disabled. The landing page is now set to the top level `README.md`, and the external_content extension is updated to transform specific prefixes and links to folders into external links. Signed-off-by: Gaute Svanes Lunde <[email protected]>
Expand the markdown fences to include MyST for Sphinx syntax like the following: ```{include} my/file.md ``` Signed-off-by: Gaute Svanes Lunde <[email protected]>
Push the Sphinx generated documentation output to the connectedhomeip-doc repository to be used by github.io. Signed-off-by: Gaute Svanes Lunde <[email protected]>
No longer include doxygen, Breathe or doxyrunner in the Sphinx build process. Signed-off-by: Gaute Svanes Lunde <[email protected]>
Removed the deployment step so that the current doxygen generated API is not overwritten. The deployment step should be reintroduced with another repository and another deployment key when ready. A link to the existing API has been added to the documentation. Signed-off-by: Gaute Svanes Lunde <[email protected]>
Signed-off-by: Gaute Svanes Lunde <[email protected]>
Signed-off-by: Gaute Svanes Lunde <[email protected]>
Push the Sphinx-generated html to project-chip/connectedhomeip-doc, overwriting the current Doxygen documentation. Signed-off-by: Gaute Svanes Lunde <[email protected]>
86a172b
to
6504487
Compare
PR #19950: Size comparison from 48f87f3 to 6504487 Increases (5 builds for nrfconnect, psoc6, telink)
Decreases (2 builds for esp32, psoc6)
Full report (57 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, telink)
|
Postponed past 1.0 for now: this branch had conflicts for a while and the delta is somewhat large. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marking changes requested to wait until after 1.0 branch
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This stale pull request has been automatically closed. Thank you for your contributions. |
Problem
This PR is a follow-up to the doc framework meeting on February 13, 2022. Goals discussed at the meeting for the doc framework setup:
Change overview
This PR introduces Sphinx as a documentation framework, and includes a workflow that builds the documentation and deploy the generated html to an external repository where it is served by github.io (Currently on hold).
The PR consists of:
running doxygen andtransforming markdown files to be compatible with MyST.A preview of the generated page can be seen based off my fork here: https://gautesl.github.io/connectedhomeip/docs/
I will keep the page up while this PR is open.
Differences when writing docs for Sphinx
Adding files to Sphinx
Currently, everything in
/docs
and all images and.md
files in/examples
are part of the Sphinx documentation. Everything picked up by Sphinx must be part of the ToC-tree, but in the case that a file should be part of the documentation but not part of the ToC-tree, the following can be put on top of the file:Note that this will not render as hidden on GitHub.
For a file to be a part of the ToC-tree, it must be referenced by another file with the following syntax:
See
docs/index.md
for the root of the ToC-tree.Should a file within
/docs
or/examples
not be part of the documentation, it must be added to theexclude_patterns
list located in/docs/conf.py
.HTML
Nested HTML tags in markdown files will not render. If nesting is necessary to e.g. centre an image, the following syntax can be used (note that this will not render on GitHub):
For more information, see the official documentation
Links
Some existing links no longer works when used within Sphinx. To avoid rewriting all existing documentation and make the links renderable both on Sphinx and GitHub, the broken links are transformed upon building with the following rules:
[link](my/page#my_section)
becomes[link](my/page)
.md
,.png
,.jpg
and.svg
files are transformed into external links to the GitHub location of that fileconf.py
underexternal_content_link_extensions
src
or.vscode
folders are transformed into external links to the GitHub location of that file.conf.py
underexternal_content_link_repositories
if you need to link to a file not included in the ToC-tree.<a name="my-anchor"></a>
pattern no longer works.[See my section](#my-section)
in combination with#### My Section
.For more information, see the official documentation
Emojis
Emojis written on the form
:heavy_check_mark:
does not render in Sphinx. Where these would be used, the unicode version of the emoji should be used directly instead.Final notes
docbuild.yaml
workflow currently does not deploy the generated html anywhere. This will be changed when a destination is ready.README.md
files include a table of contents at the very start. If desired, these may be removed in the future, as Sphinx automatically maintains a ToC for every page.Testing
make linkcheck
in thedocs
folder.