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

Apply field-list and admonition handling to classes and unions #764

Conversation

jakobandersen
Copy link
Collaborator

Most declarations use the description() method to render the brief and detailed descriptions. That function which pulls up field-lists and admonitions from the detailed description, such that Sphinx can process the field-lists.
But classes and unions render their content through visit_compounddef() which didn't process the detailed description.
This PR factors out the handling so both methods can apply the handling.
This incidentally also means that classes and unions now get affected by breathe_order_parameters_first which, despite its name, determines the order between field-lists in general (including template parameter documentation) and admonitions.

Fixes #761.

As test case:

/// @brief Type
/// @tparam E the type parameter
template<typename E>
using Type = int;

/// @brief Concept
/// @tparam E the type parameter
template<typename E>
concept Concept = true;

/// @brief Var
/// @tparam E the type parameter
template<typename E>
int Var = 42;

/// @brief Function
/// @tparam E the type parameter
template<typename E>
void Function() {}

/// @brief Class
/// @tparam E the type parameter
template<typename E>
class Class {};

/// @brief Union
/// @tparam E the type parameter
template<typename E>
union Union { int i; };

The concept declaration seems to no be handled correctly by Doxygen, so it should be checked at a later stage.

@2bndy5
Copy link
Contributor

2bndy5 commented Nov 18, 2021

Here are some screenshots from this PR's build docs CI artifacts

For template classes

image
image

For template functions

image
image


I think it's safe to say this solution works as intended

@jakobandersen
Copy link
Collaborator Author

Great, thanks for testing!

@jakobandersen jakobandersen merged commit a60c113 into breathe-doc:master Nov 19, 2021
@jakobandersen jakobandersen deleted the detailed_description_field_lists branch November 19, 2021 15:05
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.

tparam not recognized for classes
2 participants