5

Is there any way to build haddock docs for specific packages? I'm trying to build haddocks for my package/app alone, but the following command seems to be doing this for all dependencies, as well:

stack haddock webservice

(where webservice is the name of my package/app)

sjakobi
  • 3,546
  • 1
  • 25
  • 43
Saurabh Nanda
  • 6,373
  • 5
  • 31
  • 60
  • There's a good reason to also build the docs for all dependencies: it makes sure the links will actually work! Cabal-install doesn't do this, which is not always a blessing. – leftaroundabout May 04 '18 at 16:56

1 Answers1

5

The flag you're looking for is --no-haddock-deps as in

stack haddock --no-haddock-deps webservice
sjakobi
  • 3,546
  • 1
  • 25
  • 43
  • Thanks, this seems to be working. Does it also build the package itself, along with generating the docs? It seems the compiling everything to `.o` files. Any way to avoid that and generate JUST the docs? – Saurabh Nanda May 05 '18 at 12:40
  • I don't think that's possible with stack. I'm not sure if there are other ways to achieve that. – sjakobi May 05 '18 at 13:17
  • This command ends with a bunch of `Missing documentation for` warnings; reports `Completed 25 action(s).`; but then also says `Process exited with code: ExitFailure 1`. In `.stack-work/install/x86_64-osx/lts-9.0/8.0.2/doc/webservice-0.1.0.0` the only file is `LICENSE`. A few other packages have documentation in `.stack-work/install/x86_64-osx/lts-9.0/8.0.2/doc/` which seems to be completely generated. Any idea what I'm doing wrong? – Saurabh Nanda May 05 '18 at 13:28
  • The warnings aren't unusual. Is there no error message somewhere that could be connected to the ExitFailure? Also: did you start with a clean project, i.e. no `.stack-work`? If you could tell me how to reproduce the issue, I could possibly say more… – sjakobi May 05 '18 at 13:43