13

Some packages (the Haddock documentation for example Data.String.Utils) have a menubar that includes a "Style" menu that allows choosing among styles used to display the documentation:

enter image description here

How do I get this menu in the documentation for my own packages? What setting should I use to include it, and how do I specify which styles are offered?

I've tried things like

haddock
  -- ...
  css: /path/to/mystuff.css, Default, Ocean
  -- ...

and

haddock

  -- ...
  css: Default
  css: Ocean
  css: /path/to/mystuff.css
  -- ...

In my ~/.cabal/config; but the former fails and the latter just formats using the last-listed css entry, with no "Style" menu.

Towkir
  • 3,889
  • 2
  • 22
  • 41
orome
  • 45,163
  • 57
  • 202
  • 418

1 Answers1

1

This feature is implemented with the --theme flag to Haddock: https://haskell-haddock.readthedocs.io/en/latest/invoking.html#cmdoption-theme

Ari Fordsham
  • 2,437
  • 7
  • 28
  • That seems to do the trick locally, but how do I enforce that on [Hackage](https://hackage.haskell.org/package/crypto-enigma-0.1.1.6/docs/Crypto-Enigma.html) and [Stackage](https://www.stackage.org/haddock/lts-16.15/crypto-enigma-0.1.1.6/Crypto-Enigma.html)? I don't see where I can specify `--theme` for either. – orome Sep 21 '20 at 16:32