Multi-site haddock documentation with proper links?

Hello cafe, For various reasons, some packages don't build documentation on hackage: http://hackage.haskell.org/package/accelerate Therefore I want to locally install documentation for a set of packages like this and host them on a separate website. I want all of these ~ten packages' haddock documentation to be properly interlinked with eachother, but also to link to Hackage for types and classes defined in other modules. Is this possible? Hackage haddocks are all interlinked, but that is simply because hackage is one giant local install, right? If it's not possible (and it seems not) do any haddock devs have pointers on how to implement this? Thanks, -Ryan P.S. Someone recommended to me the following simple hack -- just use sed to rewrite the links after haddock generates the html. I think I'll do that for the time being unless someone has a better suggestion.

This is sort of related to ticket #130:
http://trac.haskell.org/haddock/ticket/130
And this one seems to hint at a solution to the problem in the more
extensive syntax for --read-interface.
http://hackage.haskell.org/trac/ghc/ticket/3810
(My local haddock-2.10.0 --help doesn't mention this. But I'll give it a
whirl.)
On Tue, Apr 24, 2012 at 8:34 PM, Ryan Newton
Hello cafe,
For various reasons, some packages don't build documentation on hackage:
http://hackage.haskell.org/package/accelerate
Therefore I want to locally install documentation for a set of packages like this and host them on a separate website. I want all of these ~ten packages' haddock documentation to be properly interlinked with eachother, but also to link to Hackage for types and classes defined in other modules.
Is this possible? Hackage haddocks are all interlinked, but that is simply because hackage is one giant local install, right?
If it's not possible (and it seems not) do any haddock devs have pointers on how to implement this?
Thanks, -Ryan
P.S. Someone recommended to me the following simple hack -- just use sed to rewrite the links after haddock generates the html. I think I'll do that for the time being unless someone has a better suggestion.

One more update:
"cabal haddock" exposes a --html-location flag which is useful:
http://www.haskell.org/cabal/users-guide/installing-packages.html#setup-hadd...
Another way of invoking haddock is through "cabal install". It looks like
"cabal install --enable-documentation" and "cabal install --haddock" are
not documented here, but they work:
http://www.haskell.org/cabal/users-guide/installing-packages.html#paths-in-t...
With cabal 0.14.0 and haddock 2.10.0, they work even when installing
multiple packages at once using trailing slashes ("cabal install foo/ bar/
baz/").
We can then achieve the effect of "haddock --html-location=URL" with
the --haddock-html-location=URL flag to "cabal install". (There is also an
"--htmldir" flag available but its effect is somewhat confusing. As far as
I can tell it seems to affect where the ".haddock" files are put, not where
the .html in installed or where the links point to. )
So that's it. The result is that it's easy to build ONE package's
documentation and host it on a different server but with all links to other
modules pointing to hackage. Regarding the original goal it looks like a
"sed" style hack will still be required to allow a set of sibling packages
to point to one another.
-Ryan
On Tue, Apr 24, 2012 at 8:51 PM, Ryan Newton
This is sort of related to ticket #130:
http://trac.haskell.org/haddock/ticket/130
And this one seems to hint at a solution to the problem in the more extensive syntax for --read-interface.
http://hackage.haskell.org/trac/ghc/ticket/3810
(My local haddock-2.10.0 --help doesn't mention this. But I'll give it a whirl.)
On Tue, Apr 24, 2012 at 8:34 PM, Ryan Newton
wrote: Hello cafe,
For various reasons, some packages don't build documentation on hackage:
http://hackage.haskell.org/package/accelerate
Therefore I want to locally install documentation for a set of packages like this and host them on a separate website. I want all of these ~ten packages' haddock documentation to be properly interlinked with eachother, but also to link to Hackage for types and classes defined in other modules.
Is this possible? Hackage haddocks are all interlinked, but that is simply because hackage is one giant local install, right?
If it's not possible (and it seems not) do any haddock devs have pointers on how to implement this?
Thanks, -Ryan
P.S. Someone recommended to me the following simple hack -- just use sed to rewrite the links after haddock generates the html. I think I'll do that for the time being unless someone has a better suggestion.

It is possible. I have done it for http://projects.haskell.org/diagrams/doc/index.html But it is not fun, and it took me several days of work (spread over two weeks) to figure out the proper magic incantations to get everything to work properly. I really ought to write up a blog post with instructions; I'll try to do that soon. -Brent On Tue, Apr 24, 2012 at 08:34:53PM -0400, Ryan Newton wrote:
Hello cafe,
For various reasons, some packages don't build documentation on hackage:
http://hackage.haskell.org/package/accelerate
Therefore I want to locally install documentation for a set of packages like this and host them on a separate website. I want all of these ~ten packages' haddock documentation to be properly interlinked with eachother, but also to link to Hackage for types and classes defined in other modules.
Is this possible? Hackage haddocks are all interlinked, but that is simply because hackage is one giant local install, right?
If it's not possible (and it seems not) do any haddock devs have pointers on how to implement this?
Thanks, -Ryan
P.S. Someone recommended to me the following simple hack -- just use sed to rewrite the links after haddock generates the html. I think I'll do that for the time being unless someone has a better suggestion.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (2)
-
Brent Yorgey
-
Ryan Newton