Zeal: Man pages docset?

Created on 22 Feb 2014  路  33Comments  路  Source: zealdocs/zeal

Can Zeal use local man pages (from Cygwin) as a docset source (as described in http://blog.kapeli.com/linux-man-pages-in-dash/)?

scopmisdocsets typfeature

Most helpful comment

@amosbird High!

  1. Download Linux.docset.zip from here https://github.com/Yanpas/mandocset/tree/master/etc
  2. Etract it to Linux.docset folder
  3. Move this folder to Zeal docsets (C:\Users\%username%\AppData\Local\Zeal\Zeal\docsets or ~/.local/share/Zeal/Zeal/docsets/

All 33 comments

Unfortunately generating docsets from man pages is not implemented in Zeal.

If you have access to an OS X computer, perhaps you could generate the man pages docset in Dash and copy it over to your Zeal's docsets directory.

If you have access to an OS X computer, perhaps you could generate the man pages docset in Dash and copy it over to your Zeal's docsets directory.

That won't work. Dash works as a regular man page browser behind the scenes, it doesn't generate anything, it just shows man pages.

The current Man Pages docset is just an empty placeholder docset that lets Dash know it should search man pages as well, nothing else.

That won't work. Dash works as a regular man page browser behind the scenes, it doesn't generate anything, it just shows man pages.

Ah, thanks for clarifying. I should've checked it better before posting. :)

Anyway, it would be cool to have man pages support implemented, so I'm keeping this issue open.

Can I use that work around on Windows? Like copy the manpages from my Linux VM and put them into a directory that Zeal can search inside?

This would be a nice feature to have

:+1: Since I can use many of the linux commandline tools w/o cygwin, by install util-linux-ng, so it would be a nice feature to have man page docs.

There are a lot if sites like this http://linux.die.net/man/ which have all man pages online. It will be easier to use them.

@Yanpas Point. It probably _would_ be easier to point HTTrack at one of those and then slap a docset definition on the result for when I don't have network connectivity.

Actually, I've been waiting for this :smiling_imp:

@ssokolow I've acrually meant exporting man pages online to docset format :smile:

@Yanpas I have no problem doing that myself... I just consider it unacceptably hacky and restrictive for the official "mark as solved" solution.

@Kapeli
How is searching manpages implemented in Dash? Does it hardcode manpage location on OS X? Or does it delegate man page search to apropos and parse the result?

@louy2 both, and a few more.

I have hardcoded paths. I also check: /private/etc/man.conf, /etc/manpaths, /etc/manpaths.d, /bin/bash -l -c "/usr/bin/man -W", /bin/bash -l -c "/usr/bin/man -k ."

OS X docset also contains man pages. It would be fine to have them separately, cause OS X is very huge docset.

@Yanpas
Are you sure? @Kapeli said that on OS X manpage is not stored in docset but rendered on the fly.

Absolutely. OS x is posix compatible os, so there exist all posix C calls like unlink, read, write, fcntl. The problem that search results show a lot of unnecessary functions with same names from foundation framework, Swift and so on
E. g.:
https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/ls.1.html
https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man2/unlink.2.html

The OS X docset contains some man pages, yes. This docset is deprecated as Apple switched to a different documentation format in Xcode 8. The new Apple docs can be found here: https://developer.apple.com/reference. It's unlikely they'll update the OS X docset in the future.

Is there any way to have Dash specifically look in a Dash-specific folder for man pages without setting it globally? Does Dash take into account the MANPATH environment variable if it's set in a plist or something?

Dash takes into account the MANPATH if it was set for /bin/bash. The easiest way to add man paths to Dash is probably in /etc/manpaths.

Please contact me with support requests regarding Dash in the future. This issue tracker is for Zeal.

High everybody!
I've created script to generate docsets from man, details here https://github.com/Yanpas/mandocset
It uses man2html utility, avaiable on Ubuntu and Debian e.g. In etc folder there are two docsets (posix and linux) which are "compiled", you may use them

I wasn't able to find author of this utility. Beware of a bug: this util may go to endless loop with printf.1p file from posix

@Yanpas nice work. You could also add XML feeds to simplify installation of prebuilt docsets.

@Yanpas Hi, how can I install your docset into zeal?

@amosbird High!

  1. Download Linux.docset.zip from here https://github.com/Yanpas/mandocset/tree/master/etc
  2. Etract it to Linux.docset folder
  3. Move this folder to Zeal docsets (C:\Users\%username%\AppData\Local\Zeal\Zeal\docsets or ~/.local/share/Zeal/Zeal/docsets/

Thanks!

I think it is still much more valuable to search manpages on linux on-the-fly, as manpages are installed incrementally over time, the script above only generates static linux and posix manpages which is sub-optimal.

I tried to use the script against /usr/share/man on linux and while zeal recognizes it, click on search result does not produce any output on the right-side pane in zeal, so it's broken.

is it possible to add dynamic-man-page on the fly to zeal?

Given that Zeal is built using Qt, I'd think the simplest solution would be:

  1. Add an option to use KIOSlaves for disk access.
  2. Generate an index which uses man: URLs.

(If you've got Konqueror installed, try typing man:ls in the address bar... assuming your distro doesn't split the man KIOSlave out into some not-installed-by-default extras package.)

There's also the info KIOSlave, which even generates redirects so you can ask for info:ls and wind up at info:coreutils/ls invocation.

that won't work in gnome though, I don't know how Dash does it, the manpages are all gzipped with many symlinks, the best is to locate them based on search terms in zeal, then gunzip and convert them to html on the fly for zeal to display. unfortunately I'm unfamiliar with Qt.

this issue with above static script(mandocset) is that it can not deal with gzipped format files with symlinks used, which are common under /usr/share/man/

that won't work in gnome though

KDE Frameworks 5 has been focused on being modular, so don't count KIOSlaves out immediately.

KIOSlaves are the closest Qt equivalent to GIO/GnomeVFS (with GIO now being part of GTK+ itself), and one could already argue that Zeal being based on Qt "won't work in gnome" on the same grounds.

Sounds complicated. Easier would be pipe gzip to pandoc/man2html to pipe in zeal.

That is an option. The info KIOSlave's page footer makes it clear that it's based on a customized version of info2html.

Support for docset format plugins is one of the goals of the upcoming refactoring (or rather reimplementation) of the core logic as a separate backend service. Once we have that, plugin(s) should crawl through the locally available man/info/whatever pages, and populate Zeal's search index.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cccaballero picture cccaballero  路  7Comments

diosney picture diosney  路  4Comments

sheershoff picture sheershoff  路  4Comments

taulant picture taulant  路  5Comments

husniddin1354 picture husniddin1354  路  7Comments