Skip to content

Commit

Permalink
Add support for Doxygen's @bug command (#463)
Browse files Browse the repository at this point in the history
Now they're displayed as a `!!! danger` admonition.
  • Loading branch information
JamesWrigley committed Jan 7, 2024
1 parent 094d9bc commit a2fc6c7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Changelog](https://keepachangelog.com).

### Added

- Doxygens `@deprecated` command will now be translated to a `!!! compat`
admonition ([#460]).
- Doxygens `@deprecated` and `@bug` commands will now be translated to `!!!
compat` and `!!! danger` admonitions, respectively ([#460], [#463]).

### Breaking

Expand Down
1 change: 1 addition & 0 deletions src/generator/documentation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ function format_block(x::Clang.BlockCommand, options)
name in ["brief", "details"] && return [content]
name in ["note", "warning"] && return ["!!! $name", "", " $content"]
name in ["deprecated"] && return ["!!! compat \"Deprecated\"", "", " $content"]
name in ["bug"] && return ["!!! danger \"Known bug\"", "", " $content"]
["\\$name$args $content"]
end

Expand Down
1 change: 1 addition & 0 deletions test/generators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ end
@test docstring_has(" * `foo`: A parameter")
@test docstring_has("### Returns")
@test docstring_has("Whatever I want")
@test docstring_has("!!! danger \"Known bug\"")
@test docstring_has("### See also")
@test docstring_has("quux()")
@test docstring_has("callback")
Expand Down
2 changes: 2 additions & 0 deletions test/include/documentation.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*
* @return Whatever I want.
*
* @bug May wipe your disk.
*
* @see quux()
*
* @deprecated This function is evil.
Expand Down

0 comments on commit a2fc6c7

Please sign in to comment.