mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 08:07:59 +01:00
Automagically tagify index entries without existing help tags rather than eliding them entirely.
This commit is contained in:
@@ -213,9 +213,13 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
let results = array((params.iterateIndex || params.iterate).call(params, commands.get(name).newArgs()))
|
let results = array((params.iterateIndex || params.iterate).call(params, commands.get(name).newArgs()))
|
||||||
.array.sort(function (a, b) String.localeCompare(a.name, b.name));
|
.array.sort(function (a, b) String.localeCompare(a.name, b.name));
|
||||||
|
|
||||||
for (let obj in values(results))
|
for (let obj in values(results)) {
|
||||||
if (obj.helpTag in services["dactyl:"].HELP_TAGS)
|
let res = dactyl.generateHelp(obj, null, null, true);
|
||||||
yield dactyl.generateHelp(obj, null, null, true);
|
if (!set.has(services["dactyl:"].HELP_TAGS, obj.helpTag))
|
||||||
|
res[1].@tag = obj.helpTag;
|
||||||
|
|
||||||
|
yield res;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -786,6 +790,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
addTags("versions", util.httpGet("dactyl://help/versions").responseXML);
|
addTags("versions", util.httpGet("dactyl://help/versions").responseXML);
|
||||||
|
addTags("plugins", util.httpGet("dactyl://help/plugins").responseXML);
|
||||||
|
|
||||||
default xml namespace = NS;
|
default xml namespace = NS;
|
||||||
|
|
||||||
@@ -799,7 +804,8 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
}</dl>, <>{"\n\n"}</>))) +
|
}</dl>, <>{"\n\n"}</>))) +
|
||||||
'\n</overlay>'];
|
'\n</overlay>'];
|
||||||
|
|
||||||
addTags("plugins", util.httpGet("dactyl://help/plugins").responseXML);
|
addTags("index", util.httpGet("dactyl://help/index").responseXML);
|
||||||
|
|
||||||
this.helpInitialized = true;
|
this.helpInitialized = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -969,7 +975,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
template.linkifyHelp(obj.description ? obj.description.replace(/\.$/, "") : "", true)
|
template.linkifyHelp(obj.description ? obj.description.replace(/\.$/, "") : "", true)
|
||||||
}</dd></res>;
|
}</dd></res>;
|
||||||
if (specOnly)
|
if (specOnly)
|
||||||
return res.*;
|
return res.elements();
|
||||||
|
|
||||||
res.* += <>
|
res.* += <>
|
||||||
<item>
|
<item>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ Components.utils.import("resource://dactyl/bootstrap.jsm");
|
|||||||
defineModule("commands", {
|
defineModule("commands", {
|
||||||
exports: ["ArgType", "Command", "Commands", "CommandOption", "Ex", "commands"],
|
exports: ["ArgType", "Command", "Commands", "CommandOption", "Ex", "commands"],
|
||||||
require: ["contexts"],
|
require: ["contexts"],
|
||||||
use: ["config", "options", "template", "util"]
|
use: ["config", "options", "services", "template", "util"]
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1540,6 +1540,8 @@ var Commands = Module("commands", {
|
|||||||
cmd.hive == commands.builtin ? "" : <span highlight="Object" style="padding-right: 1em;">{cmd.hive.name}</span>
|
cmd.hive == commands.builtin ? "" : <span highlight="Object" style="padding-right: 1em;">{cmd.hive.name}</span>
|
||||||
]
|
]
|
||||||
})),
|
})),
|
||||||
|
iterateIndex: function (args) let (tags = services["dactyl:"].HELP_TAGS)
|
||||||
|
this.iterate(args).filter(function (cmd) cmd.hive === commands.builtin || set.has(cmd.helpTag)),
|
||||||
format: {
|
format: {
|
||||||
headings: ["Command", "Group", "Description"],
|
headings: ["Command", "Group", "Description"],
|
||||||
description: function (cmd) template.linkifyHelp(cmd.description + (cmd.replacementText ? ": " + cmd.action : "")),
|
description: function (cmd) template.linkifyHelp(cmd.description + (cmd.replacementText ? ": " + cmd.action : "")),
|
||||||
|
|||||||
Reference in New Issue
Block a user