mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-16 21:08:08 +02:00
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:
parent
8460040df1
commit
87df1130bd
1 changed files with 6 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue