mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-08-19 22:26:18 +00:00
![Tobias Beer](/assets/img/avatar_default.png)
* return all wikiparserrules w/o operand * simpler layout & code / updated instruction details Also wanted to link each rule to the official docs using a dictionary at `$:/language/Docs/ParserRules/`. However, without #2194 this is not doable.
32 lines
632 B
JavaScript
32 lines
632 B
JavaScript
/*\
|
|
title: $:/core/modules/filters/wikiparserrules.js
|
|
type: application/javascript
|
|
module-type: filteroperator
|
|
|
|
Filter operator for returning the names of the wiki parser rules in this wiki
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
/*
|
|
Export our filter function
|
|
*/
|
|
exports.wikiparserrules = function(source,operator,options) {
|
|
var results = [],
|
|
operand = operator.operand;
|
|
$tw.utils.each($tw.modules.types.wikirule,function(mod) {
|
|
var exp = mod.exports;
|
|
if(!operand || exp.types[operand]) {
|
|
results.push(exp.name);
|
|
}
|
|
});
|
|
results.sort();
|
|
return results;
|
|
};
|
|
|
|
})();
|