From f575389d891f6f640072c75687d535be1517b9b5 Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Sat, 8 Oct 2016 14:04:11 +0200 Subject: [PATCH] Update wikiparserrules operator for no operand (#2193) * 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. --- core/language/en-GB/ControlPanel.multids | 2 +- core/modules/filters/wikiparserrules.js | 5 +-- core/ui/ControlPanel/Parsing.tid | 40 ++++++++++++------------ 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/core/language/en-GB/ControlPanel.multids b/core/language/en-GB/ControlPanel.multids index e414a636c..5204d62aa 100644 --- a/core/language/en-GB/ControlPanel.multids +++ b/core/language/en-GB/ControlPanel.multids @@ -52,7 +52,7 @@ Palette/HideEditor/Caption: hide editor Palette/Prompt: Current palette: Palette/ShowEditor/Caption: show editor Parsing/Caption: Parsing -Parsing/Hint: Here you can globally disable individual wiki parser rules. Take care as disabling some parser rules can prevent ~TiddlyWiki functioning correctly (you can restore normal operation with [[safe mode|http://tiddlywiki.com/#SafeMode]] ) +Parsing/Hint: Here you can globally disable/enable wiki parser rules. For changes to take effect, save and reload your wiki. Disabling certain parser rules can prevent <$text text="TiddlyWiki"/> from functioning correctly. Use [[safe mode|http://tiddlywiki.com/#SafeMode]] to restore normal operation. Parsing/Block/Caption: Block Parse Rules Parsing/Inline/Caption: Inline Parse Rules Parsing/Pragma/Caption: Pragma Parse Rules diff --git a/core/modules/filters/wikiparserrules.js b/core/modules/filters/wikiparserrules.js index ee57113c8..213298515 100644 --- a/core/modules/filters/wikiparserrules.js +++ b/core/modules/filters/wikiparserrules.js @@ -16,10 +16,11 @@ Filter operator for returning the names of the wiki parser rules in this wiki Export our filter function */ exports.wikiparserrules = function(source,operator,options) { - var results = []; + var results = [], + operand = operator.operand; $tw.utils.each($tw.modules.types.wikirule,function(mod) { var exp = mod.exports; - if(exp.types[operator.operand]) { + if(!operand || exp.types[operand]) { results.push(exp.name); } }); diff --git a/core/ui/ControlPanel/Parsing.tid b/core/ui/ControlPanel/Parsing.tid index de027f9c3..4ba0f0ae1 100644 --- a/core/ui/ControlPanel/Parsing.tid +++ b/core/ui/ControlPanel/Parsing.tid @@ -4,30 +4,30 @@ caption: {{$:/language/ControlPanel/Parsing/Caption}} \define lingo-base() $:/language/ControlPanel/Parsing/ -\define parsing-inner(typeCap) -
  • -<$checkbox tiddler="""$:/config/WikiParserRules/$typeCap$/$(currentTiddler)$""" field="text" checked="enable" unchecked="disable" default="enable"> ''<$text text=<>/>'': -
  • +\define toggle(Type) +<$checkbox +tiddler="""$:/config/WikiParserRules/$Type$/$(rule)$""" +field="text" +checked="enable" +unchecked="disable" +default="enable"> +<> + \end -\define parsing-outer(typeLower,typeCap) - \end <> -! <> - -<> - -! <> - -<> - -! <> - -<> +
    +
    <>
    +<> +
    <>
    +<> +
    <>
    +<> +
    \ No newline at end of file