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 rendering of \section, \subsection and \subsubsection #635

Merged
merged 2 commits into from
Feb 13, 2021

Conversation

utzig
Copy link
Contributor

@utzig utzig commented Feb 9, 2021

\section, \subsection and \subsubsection are commands that can be added to \page for creating multi-level section rendering, including a title and content.

https://www.doxygen.nl/manual/commands.html#cmdsection
https://www.doxygen.nl/manual/commands.html#cmdsubsection
https://www.doxygen.nl/manual/commands.html#cmdsubsubsection

Implement the rendering using Docutils nodes.title() which already uses the structure of the document to attribute a proper heading level, which should not need extra handling since the Doxygen XML already guarantees the proper structure.

For \section aka sect1, \subsection aka sect2 and \subsubsection aka
sect3, separate title into a simple string instead of adding to content.
This allows for easier creation of a proper title in the renderer.

Signed-off-by: Fabio Utzig <utzig@apache.org>
@utzig
Copy link
Contributor Author

utzig commented Feb 9, 2021

This should fix the issue mentioned here: #395 (comment)

One thing that is not working here are the \ref, as in the example from the comment above, "This page contains the subsections \ref subsection1 and \ref subsection2.". Those \ref's do generate the proper pending_xref node but are not resolved correctly, and I still have to debug why, but otherwise the rendering itself should be 100%.

\section, \subsection and \subsubsection are commands that can be added
to \page for creating multi-level section rendering, including a title
and content.

https://www.doxygen.nl/manual/commands.html#cmdsection
https://www.doxygen.nl/manual/commands.html#cmdsubsection
https://www.doxygen.nl/manual/commands.html#cmdsubsubsection

Implement the rendering using Docutils nodes.title() which already uses
the structure of the document to attribute a proper heading level, which
should not need extra handling since the Doxygen XML already guarantees
the proper structure.

Signed-off-by: Fabio Utzig <utzig@apache.org>
@vermeeren
Copy link
Collaborator

@utzig Is this ready for review and merging in your eyes?

@utzig
Copy link
Contributor Author

utzig commented Feb 9, 2021

@utzig Is this ready for review and merging in your eyes?

The only weird thing is the \ref issue I mentioned and I don't think it is directly related to the PR itself, so I'll take a look after I fix #632. I think this one is fine to merge as is.

@vermeeren vermeeren self-requested a review February 13, 2021 15:13
@vermeeren vermeeren self-assigned this Feb 13, 2021
@vermeeren vermeeren added code Source code enhancement Improvements, additions (also cosmetics) labels Feb 13, 2021
@vermeeren vermeeren linked an issue Feb 13, 2021 that may be closed by this pull request
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 All good here too, will check the final open PR and then make a release.

michaeljones pushed a commit that referenced this pull request Feb 13, 2021
@michaeljones michaeljones merged commit e6e66de into breathe-doc:master Feb 13, 2021
@utzig utzig deleted the section branch February 13, 2021 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Source code enhancement Improvements, additions (also cosmetics)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

..doxygenpage
3 participants