How to browse and search API documentation offline on Linux

Last updated on August 23, 2020 by Dan Nanni

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

On Ubuntu 14.04 or earlier:

Installing Zeal on Ubuntu LTS is a breeze thanks to its PPA repository.

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

On Ubuntu 14.10 or later:

At this point, the official PPA has not been updated for the latest Ubuntu 14.10. Thus install Zeal by building it from the source:

$ sudo apt-get install git qt5-default libgtk2.0-dev libqt5webkit5-dev libappindicator-dev qtbase5-private-dev libxcb-keysyms1-dev
$ git clone https://github.com/jkozera/zeal.git
$ cd zeal/zeal
$ qmake
$ make
$ sudo make install

Install Zeal on Debian

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

Next, install other prerequisites before building 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

Finally, download the source, and build/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

Install Zeal on Arch Linux

Installation on Arch Linux is straightforward with AUR.

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 EditOptions, 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 EditOptions, 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.

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Xmodulo © 2021 ‒ AboutWrite for UsFeed ‒ Powered by DigitalOcean