Jason
Jason

Reputation: 51

Can I generate a "fully exposed" and "normal" version of Haddock docs without recompiling?

I am using Haddock (w/ Stack) to generate documentation for a software suite I'm working on. I would like to generate 2 variants of the Haddock docs; one normally (e.g., vanilla stack haddock), and one with fully exposed modules (e.g., stack haddock --haddock-arguments "--show-all"). However, I've found that I needed to run stack clean in-between haddock generation, or else the second command that I run would not generate anything. We would like to try to avoid this stack clean (which results in needing a recompilation of the entire software suite).

Expected steps (not working):

  1. stack haddock
  2. ... copy over the docs to our local folders for public posting ...
  3. stack haddock --haddock-arguments "--show-all"
  4. ... copy over the fully exposed docs to our local folders for public posting ...

The problem here with the above steps is that the second stack haddock will just default to using the haddock docs that were already built, ignoring the "--show-all" change. We can fix this by adding a stack clean in-between runs:

Working steps:

  1. stack haddock
  2. ... copy over the docs to our local folders for public posting ...
  3. stack clean
  4. stack haddock --haddock-arguments "--show-all"
  5. ... copy over the fully exposed docs to our local folders for public posting ...

However, adding this stack clean step results in an extra recompilation of the entire software suite for step 4. Is there anyway that I can get around needing this step? I've already tried to manually delete the $(stack path --local-install-root)/doc folder before the second docs generation, but this didn't work without a full clean.

My Stack version is Version 2.7.3, Git revision 7927a3aec32e2b2e5e4fb5be76d0d50eddcc197f x86_64 hpack-0.34.4.

Upvotes: 5

Views: 89

Answers (0)

Related Questions