KDevelop TechNotes

Issue 1: Browsing documentation with KDevAssistant

Every developer who once used Qt library knows about Qt Assistant application which come among with the library. In short, Qt Assistant is an API documentation browser with contents tree, index and full text search. The application does great job navigating you through Qt library and tools documentation. But alas it can not neither browse nor index KDE libraries API documentation and DevHelp (GTK and GNOME API) documentation.

Of course, separate browsing tool is available for DevHelp and KDE API documentation can be viewer simply in the web browser. But when we develop we want simple and uniform access to all documentation we use, don't we? Yes, we want and therefore KDevelop IDE provides you with the solution: KDevelop Assistant application (KDevAssistant, kdevassistant from the command line).

What can KDevAssistant do? It can:

And it currently supports following documentation formats:

Detailed information about KDevAssistant capabilities is summarized in the table below:

Documentation format

TOC

Index

Full text search

Qt DCF

+

+

+

Doxygen

+

+

+

DevHelp

+

+

+

CHM

+

-

-

KDevelopTOC

+

+

-

Custom

+

-

-

Screenshots:




Documentation contents tree



Documentation index



Documentation Finder



Full text search



Installation

KDevAssistant application comes with KDevelop IDE distribution. If you have KDevelop version >= 3.1 installed then you have KDevAssistant as well.

KDevelop downloads:
Recent version: http://www.kdevelop.org/index.html?filename=HEAD/download.html
Stable version: http://www.kdevelop.org/index.html?filename=download.html

During the first run KDevAssistant tries to find automatically available documentation. It currently can autodetect Qt, KDE libraries and DevHelp documentation.

If you want to perform autodetection after the first run then:

Of course, manual settings are possible at any time with configuration dialog.

Usage

KDevAssistant can be always used as a standalone GUI application but at the same time it exports some of its functionality with DCOP. What does that mean for you? This means that once you have KDevAssistant running you can perform certain actions from an external editor or a command line. KDevelop IDE itself uses DCOP to communicate with KDevAssistant when it told to do so ("Settings -> Configure KDevelop -> Documentation -> Other -> Use KDevelop Assistant to browse documentation" setting). You can configure your editor or IDE to communicate with KDevAssistant in the similar way through DCOP.

Short description of available DCOP interfaces and their functions:

Examples of using DCOP functions from the shell:

#runs KDevAssistant and remembers it's dcop id
export KDEVASSISTANT=`dcopstart kdevassistant`

#looks up for 'QString' in the documentation index
dcop $KDEVASSISTANT KDevDocumentation 'lookupInIndex(QString term)' QString

#searches for 'QString' in the full text search database
dcop $KDEVASSISTANT KDevDocumentation 'searchInDocumentation(QString term)' QString

#opens man page for gcc
dcop $KDEVASSISTANT KDevDocumentation 'manPage(QString term)' gcc

#opens info page for autoconf
dcop $KDEVASSISTANT KDevDocumentation 'infoPage(QString term)' autoconf

#opens a text file 
dcop $KDEVASSISTANT KDevPartController showDocument "$HOME/.profile" true

Vim and Emacs can be configured to talk with KDevAssistant using DCOP too, but don't ask me how ;) - I'm not a Vim or Emacs expert :) Volunteers?

KDevelop and KDevAssistant

You might ask why KDevAssistant looks like the main KDevelop IDE application. The answer is simple - they are using the same plugins and "shell" (implementation of KDevelop plugin architecture among with the main window). Indeed, kdevassistant and kdevelop applications differ only by main.cpp files. The rest is the same. KDevAssistant loads only documentation and file selector plugins while KDevelop IDE usually loads more plugins.

This is possible because KDevelop aims to be not an application but a common platform to build plugin-based IDE-like applications. More information about KDevelop Platform will be available in further issues of "KDevelop TechNotes".



Discuss this article: http://www.kdevelop.org/phorum5/read.php?2,26441

© 2004 by Alexander Dymo mailto:adymo@kdevelop.org.

Permission to copy, publish and modify this document without restrictions is granted.

Everybody is welcome to share KDevelop knowledge and experience. We accept any materials for the future issues of KDevelop TechNotes.

Reviews:

30.11.2004 - first revision.

01.12.2004 - corrected links.