orome
orome

Reputation: 48576

How do I get a "Style" menu in my Haddock documentation?

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.

Upvotes: 13

Views: 350

Answers (1)

Ari Fordsham
Ari Fordsham

Reputation: 2515

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

Upvotes: 1

Related Questions