Commit Graph

12 Commits

Author SHA1 Message Date
Lubomir Rintel
8af1404e54 generate-docs-nm-settings-docs-gir: remove space from the beginning of a para
From nm-settings-dbus(5):

Before (ugly, offensive, possibly in violation of geneva protocol):

  ...
  | set, the authentication retries for 3
  | times before failing the connection.
  |
  |  Currently, this only applies to 802-1x
  | authentication.

After (beautiful, smells good, in harmony with nature):

  ...
  | set, the authentication retries for 3
  | times before failing the connection.
  |
  | Currently, this only applies to 802-1x
  | authentication.
2022-09-07 12:10:21 +02:00
Lubomir Rintel
4d42b81d2a generate-docs-nm-settings-docs-gir: move deprecation info to a separate tag
Previously, the deprecation data was included in <description*>, in form
of an integer. E.g.:

  /**
   * NMSettingLala:hello:
   *
   * Does this and that.
   *
   * Deprecated: 1.12: Be sad instead.
   **/

Results in:

  <property name="hello">
    <description>Does this and that. Deprecated: 1</description>
  </property>

Let's make it do this instead:

  <property name="hello">
    <description>Does this and that.</description>
    <deprecated since="1.12">Be sad instead.</description>
  </property>
2022-09-07 11:01:40 +02:00
Vojtech Bubela
5e4632f021 doc: preserve paraghraphs in nmcli man pages
Improve documentation by preserving paragraphs in the
nm-settings-nmcli man pages.

To do that structure of src/libnm-client-impl/nm-settings-docs-gir.xml
was changed to have "description" as subnode to property node instead
of attribute of property node. Another subnode "description-docbook"
was added - this node is then used when generating man pages.

tools/generate-docs-nm-settings-docs-gir.py and man/nm-settings-dbus.xsl
were also changed to accomodate for changes mentioned above.

Replace xsltproc tool with python script when generating
./src/libnmc-setting/settings-docs.h.

Deleted settings-docs.xsl since it was replaced by python script.

Change src/libnmc-setting/settings-docs.h.in accodring to newly
generated src/libnmc-setting/settings-docs.h

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/661

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1260
2022-07-15 17:25:15 +02:00
Igor Ponomarev
daecc226ee tools: Fix generate-docs-nm-settings-docs-gir.py on Python 2
On python2 the following error is raised:

`LookupError: unknown encoding: unicode`

Seems like `unicode` is a correct encoding in Python 3 but not 2.

Fix:

1. Change encoding to `utf-8`
2. Pass output path string instead of opening file and passing
   opened file object. Python2 and 3 might need different file
   modes, passing just path lets ElementTree select appropriate
   file mode.

Fixes: f00e90923c ('tools: Use ElementTree to write XML in generate-docs-nm-settings-docs-gir.py')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1249
2022-06-03 08:26:12 +02:00
Igor Ponomarev
f00e90923c tools: Use ElementTree to write XML in generate-docs-nm-settings-docs-gir.py
Instead of manually writting XML line by line.
Quoting is automatic.
Makes it much easier to modify. (just add new elements)

Generated XML not indented at the moment.
2022-05-31 13:28:59 +02:00
Igor Ponomarev
a2298d31c0 tools: Modernize generate-docs-nm-settings-docs-gir.py to 2022 standards
* Create main() function and put its execution under
  __name__ == '__main__' guard.
* Only one module import per line
* Use required=True to check if necessary arguments have
  been passed.
* Remove usage() as ArgumentParser handles that already
2022-05-31 13:28:51 +02:00
Thomas Haller
aaf2155023 libnm/docs: fix documentation for "proxy.pac-script" 2022-03-21 15:21:37 +01:00
Thomas Haller
977ea352a0 all: update deprecated SPDX license identifiers
These SPDX license identifiers are deprecated ([1]). Update them.

[1] https://spdx.org/licenses/

  sed \
     -e '1 s%^/\* SPDX-License-Identifier: \(GPL-2.0\|LGPL-2.1\)+ \*/$%/* SPDX-License-Identifier: \1-or-later */%' \
     -e '1,2 s%^\(--\|#\|//\) SPDX-License-Identifier: \(GPL-2.0\|LGPL-2.1\)+$%\1 SPDX-License-Identifier: \2-or-later%' \
     -i \
     $(git grep -l SPDX-License-Identifier -- \
         ':(exclude)shared/c-*/' \
         ':(exclude)shared/n-*/' \
         ':(exclude)shared/systemd/src' \
         ':(exclude)src/systemd/src')
2021-01-05 09:46:21 +01:00
Valentin David
54e25f23f5 build/docs: fix generated XML syntax in tools/generate-docs-nm-settings-docs-gir.py
Class description may contains double quotes which is not valid as XML
attribute value.

[thaller@redhat.com: adjust original patch to reformat code with python black]

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/620
2020-09-08 17:35:14 +02:00
Thomas Haller
5b7d39f8e1 docs: fix escaping XML in "tools/generate-docs-nm-settings-docs-gir.py"
The gtk-doc text that the tool receives is not XML, it's a plain text.
When setting the plain text as XML attribute, we need to properly escape
it. The previous XML escape code was naive, and didn't cover for a
plain ampersand.

(cherry picked from commit 1641cc1d03)
2020-06-26 13:33:41 +02:00
Sayed Shah
be822b52e6 all: reformat python files with python black
Part of !537.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/537
2020-06-15 16:40:38 +02:00
Thomas Haller
87edf2f298 docs: move generate-docs scripts from "libnm/" to "tools/"
They are not only used in "libnm/" directory. Move to "tools/".
2020-06-11 10:53:50 +02:00