improve generated documentation for nm-settings
in man nm-settings
we describe the individual properties. This gets generated from gtk-doc like https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/1916c55d3ae3d16b2137a2224fdb480f51da55df/src/libnm-core-impl/nm-setting-ip6-config.c#L862
Note that we have special tags like ---nmcli---
. These tags get parsed by tools/generate-docs-nm-property-infos.py
. There we support simple text (describtion:
) and full fledged docbook XML (description-docbook:
). Especially the latter support complex formatting (lists, enumerations).
Most properties don't overwrite this, and we just take the gtk-doc (see for example ipv6.dhcp-duid
in man nm-settings-nmcli
). Those gtk-docs get parsed by the tools/generate-docs-nm-settings-docs-gir.py
script (resulting in src/libnm-client-impl/nm-settings-docs-gir.xml
).
Later, tools/generate-docs-nm-settings-docs-merge.py
merges src/libnm-client-impl/nm-property-infos-%.xml
with src/libnm-client-impl/nm-settings-docs-gir.xml
, and it goes on from there...
Anyway. Back to ipv6.dhcp-duid
doc. You see, that it's very hard to read, because the entire text gets joined in one long paragraph. That is because tools/generate-docs-nm-settings-docs-gir.py
's get_docs()
strips out line breaks.
The task is to adjust get_docs()
, so that we get still relatively nicely formatted documentation, preserving the individual paragraphs.
Try:
Xml_pretty() {
tidy --indent yes --indent-spaces 4 --indent-attributes yes --wrap-attributes yes --input-xml yes --output-xml yes "$@" 2> /dev/null
}
touch src/libnm-client-impl/NM-1.0.gir && make V=1 src/libnm-client-impl/nm-settings-docs-gir.xml
Xml_pretty src/libnm-client-impl/nm-settings-docs-gir.xml