mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 02:07:58 +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()))
|
||||
.array.sort(function (a, b) String.localeCompare(a.name, b.name));
|
||||
|
||||
for (let obj in values(results))
|
||||
if (obj.helpTag in services["dactyl:"].HELP_TAGS)
|
||||
yield dactyl.generateHelp(obj, null, null, true);
|
||||
for (let obj in values(results)) {
|
||||
let res = 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("plugins", util.httpGet("dactyl://help/plugins").responseXML);
|
||||
|
||||
default xml namespace = NS;
|
||||
|
||||
@@ -799,7 +804,8 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
}</dl>, <>{"\n\n"}</>))) +
|
||||
'\n</overlay>'];
|
||||
|
||||
addTags("plugins", util.httpGet("dactyl://help/plugins").responseXML);
|
||||
addTags("index", util.httpGet("dactyl://help/index").responseXML);
|
||||
|
||||
this.helpInitialized = true;
|
||||
}
|
||||
},
|
||||
@@ -969,7 +975,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
template.linkifyHelp(obj.description ? obj.description.replace(/\.$/, "") : "", true)
|
||||
}</dd></res>;
|
||||
if (specOnly)
|
||||
return res.*;
|
||||
return res.elements();
|
||||
|
||||
res.* += <>
|
||||
<item>
|
||||
|
||||
@@ -12,7 +12,7 @@ Components.utils.import("resource://dactyl/bootstrap.jsm");
|
||||
defineModule("commands", {
|
||||
exports: ["ArgType", "Command", "Commands", "CommandOption", "Ex", "commands"],
|
||||
require: ["contexts"],
|
||||
use: ["config", "options", "template", "util"]
|
||||
use: ["config", "options", "services", "template", "util"]
|
||||
}, this);
|
||||
|
||||
/**
|
||||
@@ -1540,6 +1540,8 @@ var Commands = Module("commands", {
|
||||
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: {
|
||||
headings: ["Command", "Group", "Description"],
|
||||
description: function (cmd) template.linkifyHelp(cmd.description + (cmd.replacementText ? ": " + cmd.action : "")),
|
||||
|
||||
Reference in New Issue
Block a user