summaryrefslogtreecommitdiff
path: root/common/modules/template.jsm
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2011-01-19 14:40:47 -0500
committerKris Maglione <maglione.k@gmail.com>2011-01-19 14:40:47 -0500
commit807c7a4aba5ed1298a28168a97b6fd1e2e81288d (patch)
treee8f0e83effc93bd0c67428ad6d80e1da771ef70e /common/modules/template.jsm
parentd41b41417107b85cf84348bc380504b3cda4fa85 (diff)
downloadpentadactyl-807c7a4aba5ed1298a28168a97b6fd1e2e81288d.tar.gz
Update :listkeys for :mapgroups.
Diffstat (limited to 'common/modules/template.jsm')
-rw-r--r--common/modules/template.jsm21
1 files changed, 18 insertions, 3 deletions
diff --git a/common/modules/template.jsm b/common/modules/template.jsm
index 4ce6a31f..2f50fc91 100644
--- a/common/modules/template.jsm
+++ b/common/modules/template.jsm
@@ -319,8 +319,9 @@ var Template = Module("Template", {
usage: function usage(iter, format) {
XML.ignoreWhitespace = false; XML.prettyPrinting = false;
- let desc = format && format.description || function (item) template.linkifyHelp(item.description);
- let help = format && format.help || function (item) item.name;
+ format = format || {};
+ let desc = format.description || function (item) template.linkifyHelp(item.description);
+ let help = format.help || function (item) item.name;
function sourceLink(frame) {
let source = template.sourceLink(frame);
source.@NS::hint = source.text();
@@ -328,6 +329,20 @@ var Template = Module("Template", {
}
// <e4x>
return <table>
+ { format.headings ?
+ <tr highlight="Title" align="left">
+ {
+ this.map(format.headings, function (h) <th>{h}</th>)
+ }
+ </tr> : ""
+ }
+ { format.columns ?
+ <colgroup>
+ {
+ this.map(format.columns, function (c) <col style={c}/>)
+ }
+ </colgroup> : ""
+ }
{
this.map(iter, function (item)
<tr>
@@ -339,7 +354,7 @@ var Template = Module("Template", {
<span highlight="LinkInfo" xmlns:dactyl={NS}>Defined at {sourceLink(frame)}</span>
}</span>
</td>
- { template.map(item.columns, function (c) <td>{c}</td>) }
+ { item.columns ? template.map(item.columns, function (c) <td>{c}</td>) : "" }
<td>{desc(item)}</td>
</tr>)
}