Skip to content

Commit

Permalink
Merge pull request #806 from 2bndy5/alias-unparsed-code
Browse files Browse the repository at this point in the history
treat .unparsed as plain text
  • Loading branch information
michaeljones authored Feb 18, 2022
2 parents 2a68310 + 5602cf5 commit c1d15fe
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
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

1 comment on commit c1d15fe

@2bndy5
Copy link
Contributor

@2bndy5 2bndy5 commented on c1d15fe Feb 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you re-run the linting CI, it will fail due to updates in mypy. In general, this update is good as mypy doesn't need as many type: ignore comments on import statements. However, this update does require some src changes for the linting CI to pass. I'll be submitting a PR shortly that includes the needed changes (& more)...

Please sign in to comment.