[Haddock] Remember collapsed sections in index.html / haddock-util.js

Liyang HU inbox at liyang.hu
Tue Apr 12 03:37:29 BST 2011

Hi all,

This is an itch that's been scratching me for a while now. I open up
the index.html for base and other packages in the Firefox sidebar for
easy access, but every time I switch between packages, it forgets
which sections I've collapsed. This is particularly problematic with
base, which has quite a few large hierarchies that I don't really use,
e.g. Distribution.*.

This patch to haddock-util.js remembers which sections have been
collapsed in a cookie, and restores them on the next load. It works
correctly even when the docs for multiple packages are hosted at the
same domain. (Doesn't set path=/ for the cookie.) Every section is
expanded by default when viewed for the first time, in line with
existing behaviour.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: persistent-collapsed.darcs
Type: application/octet-stream
Size: 4586 bytes
Desc: not available
URL: <http://projects.haskell.org/pipermail/haddock/attachments/20110412/9c7dd601/attachment.obj>

More information about the Haddock mailing list