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

treat .unparsed as plain text #806

Merged
merged 2 commits into from
Feb 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion breathe/filetypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ def get_extension(filename: str) -> str:
# If the filename is just '.ext' then we get ('.ext', '') so we fall back to first part if
# the second isn't there
(first, second) = os.path.splitext(filename)
return (second or first).lstrip(".")

# Doxygen allows users to specify the file extension ".unparsed" to disable syntax highlighting.
# We translate it into the pygments unhighlighted 'text' type
return (second or first).lstrip(".").replace("unparsed", "text")
5 changes: 5 additions & 0 deletions documentation/source/codeblocks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ recognize the code block's contained syntax as a C++ snippet.
* message(STATUS "Element is ${element}")
* endforeach()
* @endcode
*
* Another code-block that explicitly remains not highlighted.
* @code{.unparsed}
* Show this as is.
* @endcode
*/
void with_unannotated_cmake_code_block();

Expand Down
5 changes: 5 additions & 0 deletions examples/specific/code_blocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ void with_standard_code_block();
* message(STATUS "Element is ${element}")
* endforeach()
* @endcode
*
* Another code-block that explicitly remains not highlighted.
* @code{.unparsed}
* Show this as is.
* @endcode
*/
void with_unannotated_cmake_code_block();

Expand Down