tables for arguments, constructors, fields, and instances

Mark Lentczner markl at glyphic.com
Wed Jul 21 01:53:37 EDT 2010


> I was wondering whether really want to keep the table in the argument list.
This whole discussion applies equally to arguments, constructors. fields, and instances. These four constructs use tables to achieve side-by-side layout of the declarations in one column and their documentation in second, aligned column.

> On the one hand it allows a very compact and neat layout when all the argument types are short.  However, when the argument names get longer
I'm quite a fan of compact and neat! I like the side-by-side presentation given much more than separate lines for everything which takes up twice as much vertical space. I like to see as much interface at a time as I can!

It is true, XHTML/CSS just doesn't have enough oomph to style this in a way that works in the rather large variety of cases we find in the field. That said, seems like most Haddock doc looks good with the side-by-side layout for. 

One idea is to have to code make a heuristic judgement: arguments, etc. whose lengths are greater than 125%(?) of the average have their documentation moved to a new row in the table.

> I think I like it. Google does something similar [argument documentation on a separate line] in its API docs. For examples, see:
Indeed, the documentation on that page takes quite a bit of room for what it does!

> Changing from tables would mean that we intend to launch the improved haddock with a new stylesheet as the old style would be hard to emulate without using tables.
...
> I suppose you could hack something up using display:table-cell etc, but I don't think it's very portable.
It would not be. In fact, if you go back to definition lists for these things, then you can't style it as a table even on CSS3 conforming browsers: There is no element to hang the display:table-row on.

	- Mark




More information about the Haddock mailing list