>
> Suggestions on the best way to do it?
I think follwing the proposed syntax for the next javascript would be
a good idea (
http://wiki.ecmascript.org/doku.php?
id=proposals:type_parameters). On quick reading that is the angle
brackets approach.
I think a simpler approach might be better and more flexible however.
Currently it is possible to specify as a type something like
'A.MyGenericClass[B.AnotherClass]' (angle brackets are currently
discarded I think) and it appears fine in the docs, except for linking
the types. Maybe it would be good to not parse the type, but instead
to link anything that can be linked to? (Of course, I say this without
even partially digging into whether this is possible ;) ).
The second approach would automatically allow specification of types
like: '[A.ClassOne, B.ClassTwo]' for tuple types, or something like
'{A.KeyClass, A.ValueClass}' to be used for Hash types. So, I guess
the on the pro side it allows great flexibility and allows the
documenter to decide on the best way to describe a type, but on the
con side, it means there is no standard way of documenting these
types.
Another unrelated question: Is there a 'best practice' for documenting
monkey patching functions? e.g., documenting something like
Array.extend({customMethod : function() {... }}) which adds a method
to the native Array class?