-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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 API context page #30115
Add API context page #30115
Conversation
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.
Can you remove the changes you made to kernel.h? Let's begin with irq.h and see what it looks like, can you also post the rendered version?
@utzig if you could, could you paste screenshots of what this looks like, on both the API doc and the new context page? |
I think this is missing the mark. A key driver of #18970 (which is what we're trying to solve) is to precisely describe what behavior can be expected when using a specific API. "Allowed contexts" doesn't cover the range of behaviors at all, and free-form text is verbose and potentially inconsistent. What do we want the source code and the generated documentation to look like? As a first-attempt I'd like to see the doxygen markup look something like:
where the behavior is defined using standard tags. An objection to If we could have the generated detailed documentation for each function contain those identifiers replaced by links to the terminology that might work. Also generating a separate page that produces a table with rows for each API function like #18970 (comment) would be very helpful too. |
Sure, I'll do as a preview. Building today has one link direction broken and I am trying to find what broke it. This is what an API documentation section looks like: Mind that the "Allowed from:" title should be a link to the context page, which is what broke since the PR was first openened. This is the context page (and link in the nav): This was generated with "kernel.h" also included while I am debugging the issue mentioned before. Also there could be pages for the standard commands like "\deprecated", "\test", "\todo" and "\bug", if people decide to use those in source code. I have not added them here. This behavior pretty much only mimics what Doxygen already does on its html "pages" generation. |
Yeah, I like the idea as well, I really lacked the creativity to come up with something that works well in both the Sphinx based generation and the Doxygen html generation, which was one of @nashif requirements initially. If it was Sphinx only, it would be fine to do it this way. |
I don't know the internals, but I don't think it's a big deal if this doxygen documentation were to use unlinked tag identifiers, as long as this documentation could have them replaced with links. Are there hooks that would allow that to be done? |
@pabigot just to clarify, when you mention |
I'd forgotten that branch of the discussion existed; something like that is fine. I just want something relatively terse using well-defined terms. |
Also, to be forward-looking: Even if we have a list of function properties, it's likely there will be cases where some additional text is required to explain specific behavior. E.g. I don't know how that could be done, but it's something that has value. |
This release adds support for xrefitem based pages. Signed-off-by: Fabio Utzig <[email protected]>
@allowed_from should be used to document where APIs can be called from. Signed-off-by: Fabio Utzig <[email protected]>
Change current @note commands with API context information to use @allowed_from. Signed-off-by: Fabio Utzig <[email protected]>
Add a page for rendering the contents of @allowed_from documentation. Signed-off-by: Fabio Utzig <[email protected]>
@pabigot I am doing a bit of experimenting with Doxygen macros and trying to come up with a solution that is still based on the initial idea but that also implements your suggestions. One example would be adding aliases like this:
This will force all those API terminology into "reserved words", meaning that the API attributes are not "free text", so they must be typed correctly and each attribute links back to its documentation in the API terminology page on the Sphinx pages, does not link on Doxygen yet. A rendering looks like this: It's still a PoC locally, have not updated commits, but I hope this moves the PR closer to what you have in mind. |
Would that in the header look like:
? I think that could be tolerable. If it's the bare word @carlescufi let's look at this in API today too. |
Yes, exactly that. |
API meeting 1st December 2020:
Each of the function properties is a link to the corresponding section in terminology page. That page in its turn will link to a list of functions (cross-reference) that contain the same property. Aside from this we need to generate a table described in this comment. @utzig when you prototype this, please paste the result of rendering a sample function in both Breathe and Doxygen. |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
Updated breathe for xrefitem page support, add
@allowed_from
macro and update API functions to use it instead of@note
to describe context requirements, and add new page to render the "Allowed From" contents.Initial support for suggestions on #21061