Replies: 3 comments
-
It is both possible and good, but I don't have the time myself to implement it right now. I'm happy to review a PR. Looking at https://dbus.freedesktop.org/doc/dbus-api-design.html#documentation there are at least three different ways of commenting:
I'm okay with supporting any or all of these but if you're exploring, can you do a quick check if any of the other two are more common than the Also annotations are probably the simplest to implement as there is already some support for it (deprecations) in dbus-codegen. What is the reason that is not appropriate here? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the link! There were a few considerations regarding annotations:
We currently hand-enter gtk-doc-style comments into the introspection output. The reason why I was doubtful about that being correct in the long term is that they are generic comments on the XML, and I wasn't certain they would be the best to read programmatically to describe what the methods, args, and interfaces are for. Of course, the link you gave me states that that format is preferred, and a search makes it seem pretty usual. Regarding the I'll ask further. |
Beta Was this translation helpful? Give feedback.
-
@mvollmer Could you give an opinion on how best to programmatically insert comments in the introspection data? |
Beta Was this translation helpful? Give feedback.
-
Looking in files in /usr/share/dbus-1/interfaces on my machine I notice that a number of them, e.g., org.fedoraproject.Config.Printing.xml include a bunch of xml which consists of doc specifications. Here is a snippet from the beginning of the file:
I do not know where the idea arose that it was ok to put these additional tags in the introspection data. I know that these doc tags are not explicit in the very old DTD which was once used to specify the introspection data format.
Below is a list of all the files that use the
<doc:doc>
tag on my machine:Note that they are mostly official freedesktop interfaces, so presumably this approach is not totally frowned upon.
I cloned PackageKit at https://github.com/PackageKit/PackageKit.git, and noticed that the introspection data is provided as a file in the source tree. I didn't dig deeply into the build system or try to find out how it is used.
But having seen that, I have the question in the title: Is it possible and good to add a facility for including documentation in the introspection output?
Why is this on my mind? Well, without it, we end up editing the introspection data by hand to add better documentation for our users. We currently do it like this: https://stratis-storage.github.io/manager.xml . It is pretty tedious to do it for every new release. It would be nice if we could generate the docs programmatically, instead.
The annotation facility, which was briefly considered, does not seem appropriate.
What would have to be added would be a new method on interfaces, methods, and args, which allowed adding documentation for these elements.
Beta Was this translation helpful? Give feedback.
All reactions