3

I frequently work in places in which I have no internet access. I am also about to move to a place in which I will have minimal internet access. Having documentation locally on my system is absolutely invaluable to me.

Using straight cabal, I'm able to do that just by enabling the documentation option in the configuration file.

How can I get the same effect with cabal-dev? Specifically, when I install a package using cabal-dev, I want the package documentation to be generated and the index.html file for the project's documentation directory to be updated to include that package.

update: My question is basically a duplicate of documentation for cabal-install configuration file

Community
  • 1
  • 1
Savanni D'Gerinel
  • 2,379
  • 17
  • 27

1 Answers1

3

Edit ~/.cabal/share/cabal-dev-$VERSION/admin/cabal-config.in and set the value of the documentation field to True. The cabal-config.in file is a template that is used for initialising cabal-dev/cabal.config when creating a new sandbox.

If you want to enable documentation for an already existing cabal-dev sandbox, just edit cabal-dev/cabal.config.


For the users of Cabal's native sandboxes: either enable documentation in ~/.cabal/config or create a file cabal.config in the same directory that your cabal.sandbox.config resides in with the following content:

documentation: True
Mikhail Glushenkov
  • 14,928
  • 3
  • 52
  • 65
  • That mostly does it, though it is not building the sandbox-wide index. I was hoping for that, too. It seems to be ignoring the doc-index-file command. – Savanni D'Gerinel Jul 25 '13 at 15:28
  • Yes, this is also a [problem for Cabal's native sandboxes](https://github.com/haskell/cabal/issues/1337). Has to do with how the code for generating the index is implemented. – Mikhail Glushenkov Jul 25 '13 at 15:37