From 40f44d7bd3afb519fb92297cf03aa52db2844eda Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 25 Mar 2004 15:17:24 +0000 Subject: [haddock @ 2004-03-25 15:17:23 by simonmar] Add support for collaspible parts of the page, with a +/- button and a bit of JavaScript. Make the instances collapsible, and collapse them by default. This makes documentation with long lists of instances (eg. the Prelude) much easier to read. Maybe we should give other documentation sections the same treatment. --- html/haddock.css | 2 ++ html/haddock.js | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 html/haddock.js (limited to 'html') diff --git a/html/haddock.css b/html/haddock.css index 927d1ecd..b853bf76 100644 --- a/html/haddock.css +++ b/html/haddock.css @@ -35,6 +35,8 @@ TD.s15 { height: 15px; } SPAN.keyword { text-decoration: underline; } +BUTTON.coll { width : 2em; } + /* --------- Documentation elements ---------- */ TD.children { diff --git a/html/haddock.js b/html/haddock.js new file mode 100644 index 00000000..4f6a2e44 --- /dev/null +++ b/html/haddock.js @@ -0,0 +1,11 @@ +// Haddock JavaScript utilities +function toggle(button,id) { + var n = document.getElementById(id).style; + if (n.display == "none") { + button.childNodes[0].data = "-"; + n.display = "inline"; + } else { + button.childNodes[0].data = "+"; + n.display = "none"; + } +} -- cgit v1.2.3