docs: allow to skip values in "enumval expansion"

When using "enumval expansion" in documentation comments (i.e.
"#IPTunnelMode:*"), sometimes there are values that are only for
internal usage, and not intended to be used from public APIs. Sometimes
this value is even rejected when trying to set it from public APIs.

Allow to prevent values from appearing in public APIs documentation,
marking it with the custom annotation "(attribute NM.internal=1)".

Note: currently, gtkdoc doesn't support annotations on enum fields when
using the inline style "@ENUM_VALUE_NAME: description". Instead, a
docblock needs to be used:

    enum EnumTypeName {
        /**
         * ENUM_VALUE_NAME: (attributes NM.internal=1)
         *
         * description
         */
         ENUM_VALUE_NAME
         ...
    }
This commit is contained in:
Íñigo Huguet 2023-08-11 12:37:01 +02:00
parent 8460040df1
commit 87df1130bd

View file

@ -70,6 +70,9 @@ def init_enumvals(girxml):
enum_cname = enum.attrib[type_key]
enums[enum_cname] = []
for enumval in enum.findall("./gi:member", ns_map):
if enumval.find('./gi:attribute[@name="NM.internal"]', ns_map) is not None:
continue
cname = enumval.attrib[identifier_key]
num_val = enumval.attrib["value"]
doc = enumval.find("./gi:doc", ns_map)
@ -88,6 +91,9 @@ def init_enumvals(girxml):
enum_cname = enum.attrib[type_key]
enums[enum_cname] = []
for enumval in enum.findall("./gi:member", ns_map):
if enumval.find('./gi:attribute[@name="NM.internal"]', ns_map) is not None:
continue
cname = enumval.attrib[identifier_key]
num_val = int(enumval.attrib["value"])
doc = enumval.find("./gi:doc", ns_map)