parochial: Help Manage project specific documentation

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Parochial helps manage local documentation by creating an index of a project's html, it also builds a hoogle index. In both instances the project's transitive dependencies are included.


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.0, 0.2.0.0
Change log CHANGELOG
Dependencies base (>=4 && <5), blaze-html (>=0.9 && <0.10), blaze-markup (>=0.8 && <0.9), Cabal (>=3 && <4), directory (>=1.3 && <1.4), filepath (>=1.4 && <1.5), filepattern (>=0.1 && <0.2), hackage-db (>=2.1 && <2.2), hoogle (>=5 && <6), optparse-generic (>=1.4 && <1.5), parochial, posix-paths (>=0.2 && <0.3), protolude (<1), text (>=1.2 && <1.3), unix-compat (>=0.5 && <0.6) [details]
License AGPL-3.0-only
Copyright 2020 ­ Richard Heycock
Author Richard Heycock
Maintainer rgh@filterfish.org
Category Development, Documentation
Home page https://gitlab.com/filterfish/parochial
Bug tracker https://gitlab.com/filterfish/parochial/-/issues
Source repo head: git clone https://gitlab.com/filterfish/parochial
Uploaded by filterfish at 2020-12-26T04:39:49Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for parochial-0.1.0.0

[back to package description]

Parochial

Parochial is a tool for managing local haddocks and hoogle databases. I work in cafes and on the train plus I live in Australia where the internet speed is, err, somewhat variable. The other significant benefit I found when learning Haskell (and I'm very much still in that category) is knowing that I was reading the actual documentation of the installed library. For example if I searched for a function on Hoogle I wasn't sure if it was the correct function. In fact I still find this really useful.

The whole point behind Parochial is to group the documentation on a project by project basis. For the html documentation it simply builds a symlink farm to the installed documentation in $HOME/.cabal/... (you will need to set the -haddock ghc option or set it in $HOME/.cabal.broken/config to ensure the documentation is built) in a directory named after the current project. For the hoogle database it does much the same but instead of building a symlink farm it builds a hoogle database, again named after the project.

Benefits

Of course the downside is that if you don't have the library in your cabal file you won't have any documentation for it.

Limitations

This is still fairly raw and at an early stage of development but it's certainly usable and I will be adding to it over time.

Usage

Building the Documentation

parochial --help displays a help message.

If the project contains a single binary the following will work:

for haddock:

parochial haddock

and hoogle:

parochial hoogle

If the project containes a single library then you will need to provide the --state option:

for haddock:

parochial haddock --state $(find . -name setup-config)

and hoogle:

parochial hoogle --state $(find . -name setup-config)

It there is more than one library you will need to build each one separately (I want to fix this in the future):

for haddock:

find . -name setup-config | xargs -n1 parochial haddock --state

and hoogle:

find . -name setup-config | xargs -n1 parochial hoogle --state

Reading the Documentation

Serving up the html

I use caddy to serve up the target directory but you can choose whatever you like, it just needs to be able to serve up some files. The following Caddyfile should do the job:

localhost:80 {
  file_server browse
}

Either change the port number to above 1024 or set the following capability on the caddy binary. As root run:

setcap CAP_NET_BIND_SERVICE=ep $(which caddy)

Command line hoogle

You can specify the database on the command line, like so:

hoogle --database=/srv/parochial/parochial.hoo Functor

or write a simple wrapper script that infers the name of the database from the CWD or some other clue.

TODO