Tag : kapidox

Akademy: Let’s talk about music player and documentation


I’ll be at QtCon and Akademy in Berlin, mostly as observer, I guess 🙂

I’ll have also two workshops/discussions on Tuesday 6th (see [1]).

Music player

For some time now, there were threads [2] about designing a new music player. The VDG people came up with a vision and some first design ideas [3] and I built a first specification page on the community wiki [4].

I’ll do a workshop which will deal about:

  • what will make this player not just another player
  • feature discussion
  • architecture design
  • use of the public libraries of plasma-mediacenter
  • …what you want to add…

The first 3 points will be mostly a presentation of what I want to do, with discussions about how it can be done better.

I already wrote some code, but it was mostly to make some experimentation, the project was put on hold until this Akademy session, in order to start on the right basis.

Documentation and KApiDox

I also reserved a slot for KApiDox, the program that generates the api.kde.org website. The codebase changed a lot lately, and more and more projects are being generated. However, it’s still not very robust to errors (the whole process would break instead of just ditching the error source) and it appeared not to respond to every usercases.

If you think our API documentation is important and can/should be enhanced, please join the discussion so that I can know your needs (as API user or API writer) and enhance the whole thing in the future.


[1] https://community.kde.org/Akademy/2016/Tuesday
[2] https://forum.kde.org/viewtopic.php?f=285&t=122273
[3] https://community.kde.org/KDE_Visual_Design_Group/Music_Player
[4] https://community.kde.org/Playground/MediaPlayer

post image

The KApiDox poll results (at last!)


I add to put on the side most of my contributions for some times, as I’m finishing my master thesis in end August, and that I still have some exams in parallel. However it’s important that I give you a feedback about what you expect KApiDox to be. I already apologies, this post is long, but hopefully worth it.

As some of you might remember, there was a survey about the future of KApiDox and more generally of api.kde.org. First: thank you for answering, it was very helpful. In this post I’ll review your answers and discuss some of them. Feel free to comment if you do not agree with my understanding or to share your point of view. This is important for the promotion of KDE products.

Who are you

I’m quite happy because I got quite a lot of answers, mostly by KDE developers. Most people seem to be using api.kde.org for the KDE Frameworks documentation. An interesting contribution was from a developer that uses only the Qt Frameworks because he founds the KF5 online documentation difficult to use. Well, let’s try to change that!

Current status

I worked at modernizing the old api.kde.org website. It’s unfortunately not finished. Most of you find the new design nicer, which really pleases me, but still a lot of you think it’s not good enough to attract new people. As next questions show, there is a usability problem to solve: too many clicks to access to one info, more crosslinks are needed… (@VDG: Help!)

People expect the design to be more responsible for mobile browsing. I must say that I have no knowledge about this. As usual, contribution welcomed: just contact me!

Some people refered as well to the search box which

  1. Redirect to a page with the old design
  2. Shows results for all libraries, with not very transparent names (Frameworks in module Frameworks5)

This will change. See next section.

The future


I’d like to let KApiDox generating the search box. This would have the benefit to isolate the results. If you search within the KF5 module, you don’t want to get all the KDELibs, Krita, KDevelop results. Only KF5. And that makes sense.


About the API versions to show, most of you proposed generating only the major versions plus master (For example when Okular 5 will be released: okular4, okular5, master). This makes sense to me and so I’ll see how to do this.

Man/Qch files

Some people asked me about this. It still exists but hidden: https://api.kde.org/qch. Currently one script generates them and put them where to be found by links statically written on a hand-written page. I want KApiDox to handle this. It will first generate the full qch/man file by product (one for all KF5). I’ll think later how to make it smooth library by library if really needed.

Products organization

Some of you think only the Frameworks should appear here. Here is why I disagree: we don’t have the man power to maintain scripts generating the [Plasma applets, Okular, Marble, Amarok, KIPI, Krita,…] API documentation. Having a centralized place allow people using more easily what we propose. It only needs to be correctly done (and I hope it will).

Now come the question about how to organize things. There is no clear cut whether Plasma and Frameworks API must be on top, or considered only as one other KDE products. It is not my choice to promote one or another library: for now it will stay alphabetical. A problem with the idea of organizing in categories, is that it is difficult to understand this organization. Is Okular in Office or Graphic? I use it only to read PDF and epub, but you can also read pictures… Hum…

The inside

It might be less important for you, but I redesigned most of the code (written in Python). Currently everything is done through dictionaries, without too much exception handling. This makes KApiDox not robust at all. I really want to change that, and to ease in the same time the feature extension. Moreover it is part of the Frameworks, but cannot be used in the current state by people out of KDE. I really want to make that nicer, more robust, and more Pythonic. We’ll see 😛

About the expected documentation

This poll raised some comments about the documentation in itself (content) and what could be improved. It doesn’t concern KApiDox but all of us, to provide more useful documentation.

  • The class-by-class documentation is mostly fine (Hurray!)
  • Information about how classes and libraries fit and work together is missing. A more high-level documentation (less technical but more about the concepts) would be really appreciated.
  • The introduction pages should link and name the main classes so that one doesn’t have to browse through all of them (through the awful class picker).
  • More tutorial and examples would be really appreciated, directly in the class documentation or in the introduction pages. Remember my last post about this.
  • Some API need reviews from people who are new to KDE: too much assumptions are made on the reader knowledge. This example was given:
    NormalizedRect TextEntity::transformedArea ( const QTransform &  matrix) const
    Returns the transformed area of the text entity. 

    Question: Why should one ever use such a method?


As you can see there is a lot to do. If you are interested in Python, Javascript, HTML, CSS or even Doxygen, please contact me. I’m sure there is work for more than me and it will allow the features to appear faster, and by that help the whole community!

I guess that’s all…. Oh and by the way: KDevelop, Krita and libgames, it would be great if you would join our front page…..

Writing up-to-date tutorials with Doxygen

The other day we were discussing on #plasma about KApiDox and what the Plasma team needed to write awesome documentation. Sebas and Martin were specially complaining about the fact that keeping a tutorial up-to-date was difficult because it is only text which will never be compiled for real by the writer, or not as presented.

The solution

I’d like to share the solution that Doxygen propose (adapted from the Doxygen documentation [1]):

The command is

\snippet <file-name> ( block_id )

Contrary to \include that includes a complete file as source code, this only quotes a fragment of a file. To refer to the same file you are documenting, use this as the <file-name>

For example, the putting the following command in the documentation, references a snippet in file example.cpp residing in a subdirectory which should be pointed to by EXAMPLE_PATH.

  * ....
  * A resource can easily be added with:
  * \snippet snippets/example.cpp Adding a resource
  * ...

A unique identifier refers to the snippet defined as followed

    QImage image(64, 64, QImage::Format_RGB32);
    image.fill(qRgb(255, 160, 128));
//! [Adding a resource]
        QUrl("mydata://image.png"), QVariant(image));
//! [Adding a resource]

The output of the snippet command is:

    QUrl("mydata://image.png"), QVariant(image));

What follows

I updated the wiki [2], and now you can continue writing awesome documentation about how to use your libraries.

You know what? The more it goes, the more I think that Techbase is slowly becoming useless… But Schhhhtttttt… this is a secret. 😀

Cheers and have fun !


[1] http://www.stack.nl/~dimitri/doxygen/manual/commands.html#cmdsnippet
[2] https://community.kde.org/Guidelines_and_HOWTOs/API_Documentation#Code_Examples_in_APIDOX

post image

KApiDox (or api.kde.org): I need your input !

Hi there!

As you might know, I’m the new maintainer of KApiDox, and by that I’m more or less responisble of the api.kde.org website.

KApiDox used to be a script for generating the KDE Frameworks (KF5) API. This is however changing: I would like to generate all KDE APIs with this tool.

It is on its way, but before going further I need your input.

We worked with Thomas (@Colomar) on a little survey about the api. This will take less than 5 minutes of your time but help a lot. To be helpful, you don’t need to actually use the KApiDox scripts, but only the api.kde.org website.

Please answer the questions here: http://survey.kde.org/index.php/612593/lang-en

It will help me a lot to make things better!

Cheers and have fun!

post image

The future of KApiDox

Hello there,

I’ve been working hard to enhance KApiDox. I’d like to come back on what it is for, what I did and what I see for its future.


I created a new branch in the KApiDox repository [1] and it’s currently in review on ReviewBoard [2].

Please review it, and if you have the corresponding rights, give me the green lights do put what I did in production. I think it will help KDE products to be more visible on the web. To know more, do read what follows. 🙂

What is KApiDox

KApiDox is part of the KDE Frameworks. As Aurélien Gateau wrote [3]:

KApiDox is a set of tools used to generate KDE Frameworks documentation. These command-line tools use Doxygen to do most of the work.

Currently you can use two tools: kgenapidox, to generate the documentation of a single framework and kgenframeworksapidox, to generate the documentations of all frameworks as well as the landing page which lets you list and filter frameworks by supported platforms.

You can see it working on [4].

Oh, and by the way, it’s written in Python.

What do I propose instead

The Frameworks are the only set of libraries that have a sort of visibility on the web. If other products, like say KDevelop or libkdegames, have public libraries, there is no easy way to generate the documentation and put it on the website.

Global idea

You already got it: the idea is to improve and correct what I pointed above. The new KApiDox would be one tool, that would be run over a set of repositories. It would read recursively all folders and look for CMakeLists.txt and metainfo.yml files. I’ll speak about the latter below.

The libraries are then organized in:

  • products: it can be a group like KDE Frameworks, Calligra, KDevelop… or a single library like KIPI,…
  • subgroups: Tier 1, Tier 2, …, Krita, …
  • libraries: KApiDox, KArchive, ….

A nice landing page is automatically created, then subpages and the documentation. You can see an example in the tar.gz file attached to my review [2].

How can it be used by your projects?

The documentation of your projects can be generated if they provide a metainfo.yml file.

The minimal syntax, for an independent library is:

# metainfo.yml

description: Library doing X
maintainer: ochurlaud
public_lib: true  # This is the only mandatory key, don't forget it!
logo: path/to/logo.png

This would be understood as a product consisting in one library, which name is read from the CMakeLists.txt.

It’s a little more complex if you want to have groups and subgroups, you can add a lot of other keys (to define the group description, where the sources are, where is the internal documentation…) that are presented in the metainfo_syntax.md file [5] at the root of the repository (in the branch olivier/generate_all_repos).

The future

Since I don’t have the green light to actually use the KApiDox scripts, I don’t want to spend too much time on it, in case my proposition is refused. But I have ideas to go further.

  • The tool can easily figure out if it is run over only one product or several or one library.. So the landing page could be different for each scenario.
  • People told me that having different version available (like Qt does for the versions 4.8 and 5.x) would be a great plus. It’s quite easy if I teach KApiDox some git commands….
  • KApiDox is designed to run only over public libraries (if the key public_lib is not true or not set the library is ignored). An argument could be used to generate as well the private libraries so that developers can use it for themselves.
  • KApiDox can currently only work in our infrastructure. If it is supposed to be part of the KDE Framework, it should be usable by other people, out of the community. This means refactoring the code a little and putting what is only part of KDE in another place.
  • Please review!

    Now that you have a rough idea of what I propose, if you find it useful, please tell it, and review my works so that it can be used as soon as possible! The link is there: [2].


    [1] KApiDox on Quickgit (think to select the correct branch: olivier/generate_all_repos)
    [2] Review on ReviewBoard
    [3] Aurélien’s post
    [4] API documentation generated by KApiDox
    [5] metainfo_syntax.md