-
Notifications
You must be signed in to change notification settings - Fork 50
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
Exhale forces code highlighting language to be cpp despite Doxygen supporting multiple languages #28
Comments
Hehe. I was wondering when this was going to surface. What follows is a bypass, and notes to myself for fixing it. Generally, the doxygen XML can be used. However, I'd love to hear your thoughts on the last part (adding a config variable). As you can see, I've thought about this problem for a good while, just never gotten around to fixing it. Bypassing the ProblemCurrently, you can bypass all program listing issues by adding exhale_args = {
# ...
"exhaleDoxygenStdin" = textwrap.dedent('''
INPUT = ../path
XML_PROGRAMLISTING = NO
''')
} I don't know how relevant this is to Verilog, but the XML program listing is used to infer some missing relationships for these types: Lines 1747 to 1749 in d5a6adb
TBH I've always felt that me doing that means that I'm ultimately missing something during parsing. The reason for mentioning it is simply to point out that (unfortunately) disabling Fixing the ProblemLooking up the language via file extension?The primary issue with this is the C++ community does not agree on conventions here. The way I've always operated: Read the language data from Doxygen's XML somehow?This is definitely possible and preferred. We'll get something like <compounddef id="common_8h" kind="file" language="C++">
<compoundname>common.h</compoundname> This comes from Doxygen's default I'll work on this soon, it's just a matter of mapping the doxygen A config setting (maybe allow a function which returns the value?)However, this is actually required as well. CUDA can generally be parsed well by Doxygen, but it's not official. In one of my projects, I do FILE_PATTERNS = *.hpp *.cuh
EXTENSION_MAPPING += cuh=c++ The implication is the following will be created: <compounddef id="bilateral__filter_8cuh" kind="file" language="C++">
<compoundname>bilateral_filter.cuh</compoundname> but Sphinx actually has a CUDA lexer! Ideally, I would just let users specify a function object so that they can do whatever they want and return a lexer to me. It would be something like exhale_args {
# ...
"lexerMapping": {
r".*\.cuh": "cuda",
r"path/to/exact_filename\.ext": "c"
}
} This would cover the final case of languages not officially supported by Doxygen.
|
@mithro what does the Doxygen XML produce for you for verilog files? As in with the <compounddef id="common_8h" kind="file" language="C++"> They officially only support VHDL, the following mapping is what I have: LANG_TO_LEX = {
"IDL": "idl",
"Java": "java",
"Javascript": "js",
"C#": "csharp",
"C": "c",
"C++": "cpp",
"D": "d",
"PHP": "php",
"Objecive-C": "objective-c",
"Python": "py",
"Fortran": "fortran",
"FortranFree": "fortran",
"FortranFixed": "fortranfixed",
"VHDL": "vhdl"
} |
FYI The Doxygen with verilog support is here -> https://github.com/avelure/doxygen-verilog Doing a
Looks like you should add; <compounddef id="ip64-addr_2README_8md" kind="file" language="Markdown">
<compounddef id="HeaderRAM_8v" kind="file" language="Verilog"> LANG_TO_LEX = {
"IDL": "idl",
"Java": "java",
"Javascript": "js",
"C#": "csharp",
"C": "c",
"C++": "cpp",
"D": "d",
"PHP": "php",
"Objecive-C": "objective-c",
"Python": "py",
"Fortran": "fortran",
"FortranFree": "fortran",
"FortranFixed": "fortranfixed",
"VHDL": "vhdl",
"Verilog": "verilog",
"Markdown": "markdown",
} |
@mithro Excellent, I believe this is fixed now on the You should be able to clone |
Update: when writing the test case I ran into issues where @mithro the plan here is to do that and include some other updates in a |
Don't wait on me. If you have a solution that works for my use case I'll update my configs when I move to the new release. |
I'm using Doxygen to generate documentation from Verilog with Exhale. This seems to mostly work pretty well except here -> https://github.com/svenevs/exhale/blob/master/exhale/graph.py#L2534
Exhale is forcing the program listing code highlighting to be C++. This means that Sphinx's gets very grumpy when it tries to highlight this code block and Verilog is not valid C++ :-).
It would be good if we could use one of the following for providing the code block language parameters;
Thoughts?
The text was updated successfully, but these errors were encountered: