Many libraries build a GObject introspection repository (*.gir) these days which allows the library to be used from many scripting (Python, JavaScript, Perl, etc.) and other (e. g. Vala) languages without the need for manually writing bindings for each of those.
One issue that I hear surprisingly often is “there is zero documentation for those bindings”. Tools for building documentation out of a .gir have existed for a long time already, just far too many people seem to not know about them.
For example, to build Yelp XML documentation out of the libnotify bindings for Python:
$ g-ir-doc-tool --language=Python -o /tmp/notify-doc /usr/share/gir-1.0/Notify-0.7.gir
Then you can call yelp /tmp/notify-doc to browse the documentation. You can of course also use the standard Mallard tools to convert them to HTML for sticking them on a website:
$ cd /tmp/notify-doc $ yelp-build html .
Admittedly they are far from pretty, and there are still lots of refinements that should be done for the documentation itself (like adding language specific examples) and also for the generated result (prettification, dynamic search, and what not), but it’s certainly far from “nothign”, and a good start.
If you are interested in working on this, please show up in #introspection or discuss it on bugzilla, desktop-devel-list@, or the library specific lists/bug trackers.
#1 by Olav Vitters on 2013/03/05 - 10:16
Zitieren
Could we have this on library.gnome.org + in tarballs?
#2 by Florian Diesch on 2013/03/05 - 14:17
Zitieren
Just a few weeks a ago I started to play around with generating .rst input files for Sphinx from .gir files. Looks promising so far, but parsing the doc strings is a PITA. I may publish the first results soon.
#3 by Michael Hall on 2013/03/05 - 14:49
Zitieren
See also https://github.com/aruiz/GDN
That is a Django project that pulls GIR data into a database that you can build a dynamic API documentation website around.
#4 by Jim on 2013/03/05 - 16:54
Zitieren
It’s still _beyond_ useless. The first thing I tried was /usr/share/gir-1.0/xrandr-1.3.gir, which generates a series of 7 pages that have the name of a property (or function? who can tell), and contain nothing except the word “None”. I’d say that’s even less than zero documentation, it’s a downright insult.
#5 by pitti on 2013/03/05 - 17:24
Zitieren
@Jim: Please don’t even look at/try the xlib and xrandr .girs; they are hand-crafted .gir files which serve no purpose at all, and don’t work. They are not in any way comparable to “real” girs such as Gtk-3.0, GUdev-1.0, or UDisks-2.0.gir.
#6 by Ray Strode on 2013/03/05 - 17:47
Zitieren
Can it produce devhelp compatible api docs?
#7 by flo on 2013/03/05 - 20:08
Zitieren
@Florian Diesch
Valadoc includes a docbook/gtkdoc subset parser which works quite well.
#8 by pitti on 2013/03/05 - 20:49
Zitieren
g-ir-doc-tool just spits out Mallard .page files, so I suppose it should be possible somehow. If anyone figures out, it should be added to https://live.gnome.org/GObjectIntrospection/Doctools .
#9 by Dmitrijs Ledkovs on 2013/03/06 - 11:59
Zitieren
Can you have a G+ +1 button please? =)