How to browse and search API documentation offline on Linux

For a programmer, good API documentation is worth more than a library of programming textbooks. If you are an avid developer, you probably want to make your life easier by keeping all necessary API documentation right at your fingertips. Most IDEs provide brief tooltips or IDE-specific ways of incorporating API documentation. However, these are mostly IDE-specific, and availability and verbosity of documentation vary across languages.

This is when Zeal can help you. Zeal is an offline API documentation browser. The idea of Zeal comes from Dash, MacOS X documentation browser, which comes with 130+ curated document sets (docsets) of popular programming languages, scripts, and frameworks. Zeal can access the same docsets contributed by Dash. Each docset contains detailed API definition, code snippets, and user-contributed notes.

In this tutorial, I will describe how set up Zeal to browse and search API documentation offline on Linux platforms.

Install Zeal on Ubuntu

Installing Zeal on Ubuntu is a breeze thanks to its PPA repository. Note that you also need to install Qt5 SDK since Zeal requires Qt5.

$ sudo add-apt-repository ppa:ubuntu-sdk-team/ppa
$ sudo add-apt-repository ppa:jerzy-kozera/zeal-ppa
$ sudo apt-get update
$ sudo apt-get install zeal

Install Zeal on Debian

First, install QT5 on Debian by using the official QT installer.

Next, install other prerequisites to build Zeal from the source.

$ sudo apt-get install g++ libxcb-keysyms1-dev zlib1g-dev libx11-dev libxslt1-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libgl1-mesa-dev

Download the source. Then build and install Zeal from the source as follows.

$ git clone https://github.com/jkozera/zeal.git
$ cd zeal/zeal
$ qmake
$ make
$ sudo make install

Install Zeal on Fedora

Install prerequisites for building Zeal with Qt5.

$ sudo yum install qt5-qtwebkit-devel qt5-qtbase-devel xcb-util-keysyms-devel bsdtar

Clone the source from the official repository, and build Zeal from the source.

$ git clone https://github.com/jkozera/zeal.git
$ cd zeal/zeal
$ qmake-qt5
$ make
$ sudo make install

Launch Zeal on Linux

To launch Zeal, simply run:

$ zeal

During the first-time launch, you may get a warning message of hotkey binding conflicts. To get around the warning, you can disable the Zeal's default hotkey (i.e., alt+space). To do so, go to Edit -> Options, and select "Clear" in Hotkey option. If you want, you can set up a custom shortcut for Zeal.

One-time set up for Zeal is to download API docsets, which will be used to look up API definitions offline. As mentioned earlier, these docsets are contributed as part of MacOS X Dash project. Zeal is able to access the same API documents.

Go to Edit -> Options, choose "Docsets" tab, and click on "Download"
button.

Then you will see a list of available docsets as follows.

Choose docsets which you want to access offline, and click "Download button again. Once chosen docsets are downloaded successfully, you will see them listed under "Docsets" as follows. By default, the chosen docsets will be stored in ~/.local/share/zeal/docsets.

Now you are ready to access API documentation. Simply start typing the API you want to look up in the left search bar. The API definition will instantly show up in the right sidebar.

Subscribe to Xmodulo

Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.

The following two tabs change content below.
Dan Nanni is the founder and also a regular contributor of Xmodulo.com. He is a Linux/FOSS enthusiast who loves to get his hands dirty with his Linux box. He likes to procrastinate when he is supposed to be busy and productive. When he is otherwise free, he likes to watch movies and shop for the coolest gadgets.

6 thoughts on “How to browse and search API documentation offline on Linux

  1. Finally had time to test this. Seems very nice. Has anyone tried to find out how much effort would be needed to add a set of manual pages to the docsets?

  2. Very funny seeing this in relation to Ubuntu - which pioneered the idea of not supplying documentation for the packages they installed.

Leave a comment

Your email address will not be published. Required fields are marked *

Current ye@r *