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 class/struct/union specific location #203

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Syllo
Copy link

@Syllo Syllo commented Jun 12, 2021

Hey,

Nice project!

I encountered a wrong #include text while generating the documentation (the hyperref is good).
Doxygen allows the user to specify a specific include path and your script did not extract the correct information from the xml.
Fortunately this info is present inside the <includes> tag.

This is somewhat related to #137. Because the path in <location file="xx"/> is not stripped using the STRIP_FROM_INC_PATH option (otherwise we would have a problem referencing the files).

That is, there is still an issue for the path displayed in the text for functions, enums, typedefs, variables and
defines which are not part of a class/struct or union.
I believe that this was a custom addition of yours and Doxygen doesn't provide the tag for these unfortunately.

A fix to the latter would involve something as provided in #139, but where the paths in STRIP_FROM_INC_PATH are also stripped of STRIP_FROM_PATH beforehand to mimic Doxygen behavior (because the paths in <location file="xx"/> are already stripped of STRIP_FROM_PATH).

When documenting a class, a struct or an union, Doxygen allows the user
to specify a custom header.

Doxygen doc:
  \class <name> [<header-file>] [<header-name>]
  \struct <name> [<header-file>] [<header-name>]
  \union <name> [<header-file>] [<header-name>]

The specified <header-name> can be retrieved between the
<includes></includes> tag of the generated xml for the
classes/structs/unions constructs.

This patch uses <header-name> instead of the default path extracted from
the <location file="xx"/> without modifying the location.

This also fixes mosra#137 for these three constructs when the user does not
define the <header-file>/<header-name>, because the value present inside
the <includes> tag is stripped using the Doxygen STRIP_FROM_INC_PATH
option, whereas <location file="xx"/> is not. Hence, there is still an
issue for namespaces, free functions, enums, typedefs, variables and
defines which are not part of a class/struct or union.
Doxygen support for STRIP_FROM_INC_PATH is applied to class/struct and
enums through the <includes> xml tag. m.css additionaly shows such
information for functions, enum, namespaces, typedef, variables and
defines through the information extracted from the <location file="xx"/>
tag.

However the location available through the <location file="xx"/> is not
stripped using STRIP_FROM_INC_PATH, only STRIP_FROM_PATH.

This patch provides STRIP_FROM_INC_PATH support by building the prefixes
(STRIP_FROM_INC_PATH stripped from STRIP_FROM_PATH) and stripping the
longest match when constructing the include html.
@Syllo
Copy link
Author

Syllo commented Jun 12, 2021

I added the support for STRIP_FROM_INC_PATH in a second commit if you want that too.

friendlyanon pushed a commit to friendlyanon/m.css that referenced this pull request Jul 15, 2021
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.

None yet

1 participant