6

Where does stack haddock (or stack build --haddock) place the documentation that it generates?

orome
  • 45,163
  • 57
  • 202
  • 418

2 Answers2

7

That depends on where the package that the haddocks are generated for "belongs". Haddocks for "local" packages, that are part of a stack project, will be placed inside the .stack-work directory inside the project directory. Haddocks for snapshot packages will be placed in the stack root directory, typically ~/.stack.

The easiest way to discover the exact path is stack haddock --open. For example, run stack haddock --open base or stack haddock --open my-pkg in a project that contains a package with that name.

sjakobi
  • 3,546
  • 1
  • 25
  • 43
0

The command (non-trivial, does not default to the current package) returns the location which the user then has to copy-paste into an open browser. Not much simpler than navigating to the (deeply hidden address)! Suggestion: could the stack community add a link in .stack-work to the index.html files produced? Easy to find and can be opened with a double-click!

user855443
  • 2,596
  • 3
  • 25
  • 37