1

I'm lost. I do not get how I generate docs locally with cabal. What I want is cabal install gtk3 which does generate the documenation also. Or well if that does not work how to I generate the docs locally?

I've put that into my .config file from cabal: -- documentation: True

But do not good end, no docs to be found

I guess it's simple thing I simply do no see....

Ok with the help of some comments I got a bit further. Anyway cabal just does a local install for me as user and it gives me a warning that global is not recommended. Here I found https://wiki.haskell.org/Cabal-Install

what I'm supposed to to for global installation and the like, but if I'm not using it I get warnings about that global should not be used and even with documentation set do documentation: True I do not get an update for the haskell Platform docs.

So I'm not supposed to use cabal for a global installation of files?

Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
Friedrich
  • 5,916
  • 25
  • 45

2 Answers2

5

I believe you are looking for cabal haddock or if you are using the new commands, cabal new-haddock. Observe:

% cabal unpack gps
Unpacking to gps-1.2/
% cd gps-1.2
% cabal --help | grep document
  upload           Uploads source packages or documentation to Hackage.
  haddock          Generate Haddock HTML documentation.
  new-haddock      Build Haddock documentation
% cabal haddock
Resolving dependencies...
Configuring gps-1.2...
Preprocessing library for gps-1.2..
Running Haddock on library for gps-1.2..
... snip ...
Documentation created: dist/doc/html/gps/index.html
cabal haddock  3.42s user 1.00s system 92% cpu 4.784 total
Thomas M. DuBuisson
  • 64,245
  • 7
  • 109
  • 166
0

Well it took me some time and some posts here pointed me into the right direction.

At first, my fault. I did replace False with True under documentation but did not uncomment the line, so the default took place that is not to generate docs (can't see this as a good default - YMMV)

Then cabal does work locally normally, there is a flag --global to change that or you can change int in ~/.cabal/config

Now what happens with the documentation is the following. The doc are generated in the home directory but they all the docs are linked into the new genarated index.html file. So you get the docs from the global install and from the local install.

Now I'm still not getting a few things. I' do not know why cabal ist not supposed to be uses globally for installing all the fille into a global location.

And yes I stumbled upon stack, sandboxes and the new-xxxx (commands) I still have no idea what to make out of them.... But that's another question I guess.

Friedrich
  • 5,916
  • 25
  • 45
  • Why does installing the documentation globally seem better to you than installing it to your home directory? Are you really planning to share these docs with other users on the same machine? (That is by far the less common situation, and more dangerous as it requires root powers, and these two things together motivate the default to install locally.) – Daniel Wagner Apr 11 '18 at 13:34
  • I think it's good if anyone could see the docs, but in the end I can live with the local installed stuff, because I'm the only programmmer interested in it... What am I supposed to use if I would haver more progarmmers, why do everyone have to install the Haskell development tools for himself? – Friedrich Apr 13 '18 at 09:43
  • If you plan to share packages with other developers, then it can make sense to install the package and the documentation globally. But one must exercise some care; cabal hell is very real, and both the symptoms and the cure are exacerbated by global installs. – Daniel Wagner Apr 13 '18 at 11:23