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

Add support for xrefitem based page generation #596

Merged
merged 7 commits into from
Nov 15, 2020

Conversation

utzig
Copy link
Contributor

@utzig utzig commented Nov 5, 2020

Implement full support for parsing XML using xrefitem, and page blocks. Add a new directive, "doxygenpage", for rendering pages that contain data that was "xrefitem"'d.

For the "doxygenpage" directive, which uses a block of kind="page", which is pretty much the same as kind="namespace" or kind="group", I decided to remove most options, but I might want "content-only" later which I'd rather add in a followup PR.

A bit of confusion might exist now that I am calling this "doxygenpage" and using examples from "xrefsect" while building the examples, which is due to the strong relation between both, but maybe the "xrefsect" example should now be renamed "page".

I am adding a very small test attached that can be built using doxygen doxyfile && sphinx-build -b html . html just in case you want to see how the results look: xref_test.tar.gz

Also includes commits fixing a few issues found on the way.

PR: tests are failing on Sphinx==3.3.0 on my machine (but this is also the case for master).

@utzig
Copy link
Contributor Author

utzig commented Nov 5, 2020

@vermeeren breathe master seems to also fail for https://github.com/sphinx-doc/[email protected]. Can I disable it temporarily on this PR? I believe the issue is with Sphinx itself, and also happens with 3.3.0 release; I have already submitted a fix upstream a few days ago...

@vermeeren
Copy link
Collaborator

@utzig Yeah no problem, you can disable it for now.

@utzig
Copy link
Contributor Author

utzig commented Nov 5, 2020

@utzig Yeah no problem, you can disable it for now.

Ooops, sorry, did not expect you to answer this fast! I did it now, but I'll drop the commit once the test passes (if it does!).

@utzig utzig force-pushed the xrefsect-pages branch 2 times, most recently from a390e4f to 33fe8d8 Compare November 5, 2020 19:12
@utzig
Copy link
Contributor Author

utzig commented Nov 5, 2020

@utzig Yeah no problem, you can disable it for now.

I dropped the commit disabling Sphinx git and >3.2.1 so it should fail again!

@utzig
Copy link
Contributor Author

utzig commented Nov 5, 2020

Can rebase after #597 to pass again...

When xrefitem, or its specializations, is used some extra XML elements
are generated which were not properly parsed; this commit adds the extra
parsing required.

* properly parses a variable list element, which consists of a set of
  varlistentry + listitem elements
* docTitleTypeSub was extended to to parse the "ref" and "anchor"
  elements which exist inside a varlistentry.

Signed-off-by: Fabio Utzig <[email protected]>
Copy link
Collaborator

@vermeeren vermeeren left a comment

Choose a reason for hiding this comment

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

@utzig Finally had some proper time to review today, sorry for the delay. The directive itself, including implementation, are all good. This definitely fills in a gap of functionality, big thanks for that.

Just noticed some minor issues with the docs, can you fixup? The follow-up review will be quick and a release will be made after merging as usual.

documentation/source/directives.rst Show resolved Hide resolved
documentation/source/directives.rst Outdated Show resolved Hide resolved
documentation/source/page.rst Outdated Show resolved Hide resolved
documentation/source/directives.rst Outdated Show resolved Hide resolved
documentation/source/page.rst Outdated Show resolved Hide resolved
@vermeeren vermeeren self-assigned this Nov 15, 2020
@vermeeren vermeeren added code Source code documentation Generated html, changelog, inline comments enhancement Improvements, additions (also cosmetics) labels Nov 15, 2020
When xrefitem or any of its specializations is used, Doxygen generates a
new file of kind="page"; this is very similar to a "group" or
"namespace" file.

This commit adds proper filter handling and a new directive, doxygenpage,
that can be used to include documentation from a page block.

Signed-off-by: Fabio Utzig <[email protected]>
When a content block was not found, the message would imply it is of
type "namespace"; fix it so that the proper "kind" is displayed
("namespace", or "group", or "page").

Signed-off-by: Fabio Utzig <[email protected]>
The elements "docvariablelist", "docvarlistentry" and "docanchor" are
used whenever an xrefitem is used in a project, and the proper compound
of kind="page" is generated.

This commits adds rendering of the elements in a definition block, and
properly adds a target to anchor elements so they can be referenced
later.

Signed-off-by: Fabio Utzig <[email protected]>
Mimic Doxygen html output, by adding a pending_xref to xrefitem titles,
which can later be resolved to the generated xrefsect page, if it was
added to the project.

Signed-off-by: Fabio Utzig <[email protected]>
Add initial documentation with "doxygenpage" usage relying on previously
added xrefsect examples.

Signed-off-by: Fabio Utzig <[email protected]>
@utzig
Copy link
Contributor Author

utzig commented Nov 15, 2020

@vermeeren I believe all issues were fixed.

@michaeljones michaeljones merged commit 31a42f4 into breathe-doc:master Nov 15, 2020
michaeljones pushed a commit that referenced this pull request Nov 15, 2020
Copy link
Collaborator

@vermeeren vermeeren left a comment

Choose a reason for hiding this comment

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

@utzig Everything is good, thanks! Compliments for the clean commits as usual. Released as v4.24.0.

@utzig utzig deleted the xrefsect-pages branch November 16, 2020 00:09
This was referenced Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Source code documentation Generated html, changelog, inline comments enhancement Improvements, additions (also cosmetics)
Projects
None yet
3 participants