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

Automatically generate API overview documentation #61994

Merged
merged 3 commits into from
Mar 19, 2024

Conversation

edersondisouza
Copy link
Collaborator

@edersondisouza edersondisouza commented Aug 29, 2023

This PR should address #50922. It basically:

  • Generate \since tags from doxgen and git (it may not be perfect, but it's a fairly comprehensive start);
  • Manually fix add some based on current information from doc/develop/api.overview.rst;
  • Add \version (showing stability level) based on information from doc/develop/api.overview.rst;
  • Use all new info (\since and \version) to generate the new API overview page, which is basically an improved version of doxygen own "Modules index" page.

More details of each step are on the commit messages. Two things that still stand out:

  • To parse the doxygen XML info, I've used its own "doxmlparser" Python lib, but it needs to be installed from the sources, as there's no package on PyPi. There's an open issue at doxygen repo about it: Improve usability of doxmlparser doxygen/doxygen#8848
  • The new API overview page points to the doxygen documentation, not for any RST that may exist for it. Since the page now comes from doxygen, we could a) add a new xrefitem tag to reference it, but then we'd have doxygen pointing to RST and RST pointing to doxygen, which could be an issue; or b) have another file to map RST pages for some doxygen groups, but it would be another burden to maintain. Any thoughts about this?

Fixes #50922

@nashif nashif dismissed kartben’s stale review March 11, 2024 16:02

please revisit

nashif
nashif previously approved these changes Mar 11, 2024
@nordicjm
Copy link
Collaborator

nordicjm commented Mar 12, 2024

In the current output, the list is just unusable, who's going to look at this https://builds.zephyrproject.io/zephyr/pr/61994/docs/develop/api/overview.html through 625 rows of APIs to find an API to use? The existing documentation has 94 so the table size has jumped 7 times

@henrikbrixandersen
Copy link
Member

In the current output, the list is just unusable, who's going to look at this https://builds.zephyrproject.io/zephyr/pr/61994/docs/develop/api/overview.html through 625 rows of APIs to find an API to use?

I agree. Having this list in our documentation adds no real, user-oriented value to the project.

@gmarull
Copy link
Member

gmarull commented Mar 12, 2024

In the current output, the list is just unusable, who's going to look at this https://builds.zephyrproject.io/zephyr/pr/61994/docs/develop/api/overview.html through 625 rows of APIs to find an API to use? The existing documentation has 94 so the table size has jumped 7 times

Indenting with -

image

image

@gmarull
Copy link
Member

gmarull commented Mar 12, 2024

In the current output, the list is just unusable, who's going to look at this https://builds.zephyrproject.io/zephyr/pr/61994/docs/develop/api/overview.html through 625 rows of APIs to find an API to use? The existing documentation has 94 so the table size has jumped 7 times

Versions also seem to be part of the (0.1.0, 0.8.0 and 1.0.0) set only. I am not sure how has this even decided. This doesn't make any sense.

@nashif
Copy link
Member

nashif commented Mar 12, 2024

Versions also seem to be part of the (0.1.0, 0.8.0 and 1.0.0) set only. I am not sure how has this even decided. This doesn't make any sense.

this is explained in the overview, added another note now. The version numbers are based on current life cycle status as we have it documented for some of the APIs right now. Those versions will change as the API evolves over time.

@nashif
Copy link
Member

nashif commented Mar 12, 2024

Indenting with -

yes, not my favorite as well, probably there is a better way to display a tree, suggestions welcome. Change to _ now, looks a bit better.

@nashif
Copy link
Member

nashif commented Mar 12, 2024

In the current output, the list is just unusable, who's going to look at this builds.zephyrproject.io/zephyr/pr/61994/docs/develop/api/overview.html through 625 rows of APIs to find an API to use? The existing documentation has 94 so the table size has jumped 7 times

"It is what it is" This is how many APIs we have. If you are interested in 1 API, you can search for it in the table. The table loads juist fine for me.
The fact that the existing list was short is because it was unmaintained and incomplete. This is what we are trying to sovle with this PR among other things.

Comment on lines +32 to +33
* @since 1.0
* @version 1.0.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should have any version information, as it is an umbrella entry without anything in the group. All the other network related groups are children of this "networking" group but it does not make them stable. If one looks at the generated documentation list, it gives an impression that all the network APIs are v1.0.0 which is not the case.

@kartben
Copy link
Collaborator

kartben commented Mar 12, 2024

Indenting with -

yes, not my favorite as well, probably there is a better way to display a tree, suggestions welcome. Change to _ now, looks a bit better.

as a quick hack, I am guessing &nbsp would achieve the same goal without being visible

@nashif
Copy link
Member

nashif commented Mar 12, 2024

as a quick hack, I am guessing &nbsp would achieve the same goal without being visible

I tried this, did not work.

@edersondisouza
Copy link
Collaborator Author

In the current output, the list is just unusable, who's going to look at this https://builds.zephyrproject.io/zephyr/pr/61994/docs/develop/api/overview.html through 625 rows of APIs to find an API to use? The existing documentation has 94 so the table size has jumped 7 times

Indenting with -

image

image

I had a version that indented with spaces, but for HTML only, not for PDF - but the feedback was "need to work with PDF". Sphinx is quite keen on removing whitespaces...

Based on information from doc/develop/api/overview.rst, add current
version for some groups representing APIs, following the following
table:

  - Experimental:   0.1.0
  - Unstable:       0.8.0
  - Stable:         1.0.0

Also based on doc/develop/api/overview.rst, add 'since' tag to the
groups.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
It will be necessary to parse the doxygen XML files to extract `since`
and `version` from them.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Copy link
Member

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overall idea and implementation is fine. I am not particularly a fan of versioning individual APIs but I'll take it as a means to help our users.

But I completely disagree that we should sacrifice the cleanliness of the HTML build to improve the .pdf one. I think the HTML one should come first, and those _ are just very distracting and reflect poorly on the quality of our doc. I suggest @edersondisouza reverts back to spaces.

@nashif
Copy link
Member

nashif commented Mar 14, 2024

But I completely disagree that we should sacrifice the cleanliness of the HTML build to improve the .pdf one. I think the HTML one should come first, and those _ are just very distracting and reflect poorly on the quality of our doc. I suggest @edersondisouza reverts back to spaces.

yes, I am also fine with that, the indentation and table looks bad with the '_'

A new extension, api_overview.py, is used to, leveraging doxygen's
Python module doxmlparser, parse the doxygen generated XML files.
All groups ('defgroup' and 'addtogroup' tags) are collected, alongside
their 'version' and 'since' info.

From there, a new Sphinx directive `api-overview-table` is populated,
including the name of the group, and if available, their 'since' and
'version' information.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
@edersondisouza
Copy link
Collaborator Author

Ok, found a way to indent with spaces that seems to work both with HTML and PDF.

@nashif
Copy link
Member

nashif commented Mar 15, 2024

"\U000000A0", nice

Copy link
Member

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now, thank you!

@carlescufi carlescufi merged commit 9ab243d into zephyrproject-rtos:main Mar 19, 2024
25 checks passed
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.

Improve management and documentation of API states