Skip to content

Commit

Permalink
geanygendoc: Add support for types "include" and "other"
Browse files Browse the repository at this point in the history
They are both ignored by the default configuration, as include
directives are not usually useful to document, and "other" is not
normally emitted by the C language parser.
  • Loading branch information
b4n committed Jul 6, 2024
1 parent 7a2f1dc commit 8043a67
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions geanygendoc/data/filetypes/c.conf
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ doctypes = {
enumval.policy = FORWARD;
# usually, locals are just not documented and get in the way
local.policy = FORWARD;
# usually nothing useful to document
include.policy = PASS;
other.policy = PASS;

function = {
template = "/**\n * {symbol}:\n{for arg in argument_list} * @{arg}: {cursor}\n{end} * \n * {cursor}\n{if returns} * \n * Returns: \n{end}{if write_since}{if returns} * \n{end} * Since: \n{end} */\n";
Expand Down Expand Up @@ -77,6 +80,9 @@ doctypes = {
doxygen = {
# usually, locals are just not documented and get in the way
local.policy = FORWARD;
# usually nothing useful to document
include.policy = PASS;
other.policy = PASS;

function.template = "/**\n * {doxygen_prefix}brief {cursor}\n{for a in argument_list} * {doxygen_prefix}param {a} \n{end}{if returns} * {doxygen_prefix}returns \n{end}{if write_since} * {doxygen_prefix}since \n{end} * \n * \n */\n";
macro.template = "/**\n * {doxygen_prefix}brief {cursor}\n{for a in argument_list} * {doxygen_prefix}param {a} \n{end}{if returns} * {doxygen_prefix}returns \n{end}{if write_since} * {doxygen_prefix}since \n{end} * \n * \n */\n";
Expand Down
4 changes: 4 additions & 0 deletions geanygendoc/docs/manual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ Known types
A field (of a class for example).
``function``
A function.
``include``
An include directive.
``interface``
An interface.
``local``
Expand All @@ -356,6 +358,8 @@ Known types
A method.
``namespace``
A namespace.
``other``
A non-specific type that highly depend on the language.
``package``
A package.
``prototype``
Expand Down
2 changes: 2 additions & 0 deletions geanygendoc/src/ggd-tag-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,14 @@ static const struct {
{ tm_tag_field_t, "field" },
{ tm_tag_function_t, "function" },
{ tm_tag_interface_t, "interface" },
{ tm_tag_include_t, "include" },
{ tm_tag_local_var_t, "local" },
{ tm_tag_macro_t, "define" },
{ tm_tag_macro_with_arg_t, "macro" },
{ tm_tag_member_t, "member" },
{ tm_tag_method_t, "method" },
{ tm_tag_namespace_t, "namespace" },
{ tm_tag_other_t, "other" },
{ tm_tag_package_t, "package" },
{ tm_tag_prototype_t, "prototype" },
{ tm_tag_struct_t, "struct" },
Expand Down

0 comments on commit 8043a67

Please sign in to comment.