-
Notifications
You must be signed in to change notification settings - Fork 7.6k
docs: Switch from 'breathe' to 'docleaf' for API documentation generation #59570
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
Changes from all commits
8c90ea0
16e50d8
48b8f74
7c72f82
6280a62
396ef38
f02486f
27e93d6
f63d8d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,7 +85,7 @@ jobs: | |
DOC_TARGET="html" | ||
fi | ||
|
||
DOC_TAG=${DOC_TAG} SPHINXOPTS="-q -W -t publish" make -C doc ${DOC_TARGET} | ||
DOC_TAG=${DOC_TAG} SPHINXOPTS="-q -W --keep-going -t publish" make -C doc ${DOC_TARGET} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. drop? I wonder if we should actually default to this, I was not aware of this option! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've removed the commit that removed this and amended the commit message to indicate your approval. |
||
|
||
- name: compress-docs | ||
run: | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,4 +93,3 @@ API reference | |
|
||
.. doxygengroup:: bt_mesh_blob_cli | ||
:project: Zephyr | ||
:members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,4 +67,3 @@ API reference | |
|
||
.. doxygengroup:: bt_mesh_blob_srv | ||
:project: Zephyr | ||
:members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,3 @@ API reference | |
|
||
.. doxygengroup:: bt_mesh_dfd_srv | ||
:project: Zephyr | ||
:members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,3 @@ API reference | |
|
||
.. doxygengroup:: bt_mesh_dfu_cli | ||
:project: Zephyr | ||
:members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,4 +68,3 @@ API reference | |
|
||
.. doxygengroup:: bt_mesh_dfu_srv | ||
:project: Zephyr | ||
:members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,3 @@ API reference | |
|
||
.. doxygengroup:: bt_mesh_large_comp_data_cli | ||
:project: Zephyr | ||
:members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,3 @@ API reference | |
|
||
.. doxygengroup:: bt_mesh_large_comp_data_srv | ||
:project: Zephyr | ||
:members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,3 @@ API reference | |
|
||
.. doxygengroup:: bt_mesh_od_priv_proxy_cli | ||
:project: Zephyr | ||
:members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,3 @@ API reference | |
|
||
.. doxygengroup:: bt_mesh_od_priv_proxy_srv | ||
:project: Zephyr | ||
:members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,3 @@ API reference | |
|
||
.. doxygengroup:: bt_mesh_op_agg_cli | ||
:project: Zephyr | ||
:members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,3 @@ API reference | |
|
||
.. doxygengroup:: bt_mesh_op_agg_srv | ||
:project: Zephyr | ||
:members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,4 +33,3 @@ API reference | |
|
||
.. doxygengroup:: bt_mesh_priv_beacon_cli | ||
:project: Zephyr | ||
:members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,4 +36,3 @@ API reference | |
|
||
.. doxygengroup:: bt_mesh_priv_beacon_srv | ||
:project: Zephyr | ||
:members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,4 +129,3 @@ API reference | |
|
||
.. doxygengroup:: bt_mesh_rpr_cli | ||
:project: Zephyr | ||
:members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,3 @@ API reference | |
|
||
.. doxygengroup:: bt_mesh_rpr_srv | ||
:project: Zephyr | ||
:members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,3 @@ API reference | |
|
||
.. doxygengroup:: bt_mesh_sol_pdu_rpl_cli | ||
:project: Zephyr | ||
:members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,3 @@ API reference | |
|
||
.. doxygengroup:: bt_mesh_sol_pdu_rpl_srv | ||
:project: Zephyr | ||
:members: |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,18 +1,30 @@ | ||||||||||||||||||||||||||||||||||||||||||
# Each line should contain the regular expression of a known Sphinx warning | ||||||||||||||||||||||||||||||||||||||||||
# that should be filtered out | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:.*:: dma_config'.* | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
# Function and (enum or struct) name | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:.*:: flash_img_check'.* | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:.*:: zsock_fd_set'.* | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:.*:: net_if_mcast_monitor'.* | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:.*:: fs_statvfs'.* | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*dmic_trigger.*'.* | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:.*:: uint16_t id'.* | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:.*:: dma_config'.* | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:.*:: net_if_mcast_monitor'.* | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:struct:: bt_ots_init'.* | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
# Struct and typedef name | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:.*:: zsock_fd_set'.* | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
# Function and extern function | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*net_if_ipv4_addr_mask_cmp.*'.* | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*net_if_ipv4_is_addr_bcast.*'.* | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*net_if_ipv4_addr_lookup.*'.* | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*net_if_ipv6_addr_lookup.*'.* | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*net_if_ipv6_maddr_lookup.*'.* | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
# Common field names | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*struct in_addr.*'.* | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*struct in6_addr.*'.* | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*struct net_if.*'.* | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:struct:: bt_ots_init'.* | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
# Clash with field of nested anonymous struct | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:member:: enum *bt_mesh_dfd_upload_phase bt_mesh_dfd_srv.phase'.* | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:member:: struct *bt_mesh_blob_xfer bt_mesh_dfu_cli.blob'.* | ||||||||||||||||||||||||||||||||||||||||||
.*Duplicate C declaration.*\n.*'\.\. c:member:: struct *net_if *\* net_if_mcast_monitor.iface'. | ||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+28
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: why didn't these fail in breathe? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question. It would also be sensible to ask how many of the other patterns in this file we still need. Docleaf isn't a line-for-line translation of Breathe into Rust. It is a new attempt to solve the same problem in a similar fashion. If it was easier to follow the logic the Breathe code base then a from-scratch re-write might not have been so appealing. All this is to say, I don't know why these didn't fail for Breathe and I'm not exactly sure why they are required for Docleaf. Would you like clear answers to this before progressing? I can see why that would be appealing and feel like the correct approach. It'll take a bit of digging around though. Edit: I'll dig into them. It'll be good to understand them more. Maybe a system we were can feed the names in as some config and docleaf can flag where it sees them in the rendering process or something. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Initial impression is that the root of the issue at times seems to be that the Sphinx C-domain does not have good handling for when structs, functions and other entities have the same name. This is allowed in C and present a few times in the Zephyr code base. This leads to duplicate targets being generated and triggering warnings from the Sphinx C Domain code. It is mentioned here: sphinx-doc/sphinx#8241 (comment) in an issue which goes on to reference this pull request: sphinx-doc/sphinx#8313 as the solution but that seems to have been open for a long time. As the references are parsed and stored by the C Domain which then generates the warnings for clashes, I don't see there being a clear way to work around them other than the current regexes. The question then becomes the difference between Breathe and Docleaf and that comes down to how much of the Doxygen XML the two systems attempt to render. In various edge cases, the XML becomes harder to make clear sense of and so the two systems potentially draw the lines at different points in different places. Neither are perfect. I will work through the various cases (as highlighted by deleting all the lines in known-warnings.txt file) and document why each appears to be happening and attempt to improve Docleaf where possible. Any due to name clashes are potentially going to have to stay but I can see at least one case where field name is clashing with a field in a nested structure and that might be possible to avoid. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added a new commit which adds categories to the known-warnings.txt file attempting to indicate the source of the various issues. Some are due to entities sharing the same name and the Sphinx issues indicated before. Some are due to fields with the same name appearing in multiple anonymous structs. Some are due to Doxygen not indicating It is possible to use the Doxygen Finally the new lines are due to Docleaf attempting to render fields from anonymous structs which then clash with fields in the parent struct. I believe this didn't happen in Breathe as it doesn't attempt to render the members in some of these situations. For example, the breathe output for Whilst the docleaf output is: With the actual code being: zephyr/include/zephyr/bluetooth/mesh/dfd_srv.h Lines 117 to 136 in db1a718
Which shows that the anonymous struct members incorrectly appear in the body of the main struct. Unfortunately this is because the Doxygen xml output (structbt__mesh__dfd__srv.zip) doesn't distinguish between the two levels. It flattens everything. I'm not sure what is better or worse. Leaving out the details or having them poorly represented. I haven't yet looked to see if there is a doxygen issue for this but I fear it might involve changes to their XML structures to better support this and that seems like it is possibly unlikely. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would welcome input as to what we might want to address or account for at this stage or if the current state is acceptable in some fashion for moving forwards. |
Uh oh!
There was an error while loading. Please reload this page.