Doxygen for QML components
Aurélien Gâteau
agateau at kde.org
Tue Oct 16 13:06:28 UTC 2012
Hi,
Currently documentation for QML components is done via a big comment at the
beginning of the QML files, which leads to duplication of information and thus
sometimes synchronization problems. For example right now the TabBar
documentation states it inherits from DualStateButton.
I have been playing this morning with an input filter for Doxygen, which makes
it possible to extract more information from the QML file. The idea of an input
filter is to process the QML file to produce something which looks like C++,
which Doxygen can then use. This approach brings the following benefits:
- list properties, methods and signals (with parameter types for properties
and signals, except alias properties for now)
- extract inheritance information
- document class elements with comment blocks located next to the documented
element
The code is available from kde:scratch/gateau/doxyqml . It is just a hack
right now, using a proper grammar file would be more reliable, but it works
reasonably well right now.
Running Doxygen with doxyqml on kde-
runtime/plasma/declarativeimports/plasmacomponents/qml produce this:
http://agateau.com/tmp/plasmacomponents/annotated.html
Of course, the big header-block comments would need to be split for the
documentation to be be nicer. I did the work for the CommonDialog and
PageStack classes:
- http://agateau.com/tmp/plasmacomponents/classCommonDialog.html
- http://agateau.com/tmp/plasmacomponents/classPageStack.html
What do you think? Is this something you would be interested to see integrated
on api.kde.org?
Aurélien
More information about the Plasma-devel
mailing list