1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 02:19:55 +00:00

Improvements to parser rule configuration

* Ignore parser rule configuration in safe mode
* Made text translatable
* Added new setting for camelcase links
* Added warning on parser rule configuration tab

See #1875
This commit is contained in:
Jermolene 2015-07-31 13:33:33 +01:00
parent d5e690a06d
commit 58188cf805
5 changed files with 34 additions and 11 deletions

View File

@ -38,6 +38,11 @@ Palette/Editor/Reset/Caption: reset
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 paser rules can prevent ~TiddlyWiki functioning correctly (you can restore normal operation with [[safe mode|http://tiddlywiki.com/#SafeMode]] )
Parsing/Block/Caption: Block Parse Rules
Parsing/Inline/Caption: Inline Parse Rules
Parsing/Pragma/Caption: Pragma Parse Rules
Plugins/Add/Hint: Install plugins from the official library
Plugins/Add/Caption: Get more plugins
Plugins/Caption: Plugins
@ -71,6 +76,9 @@ Settings/AutoSave/Caption: Autosave
Settings/AutoSave/Disabled/Description: Do not save changes automatically
Settings/AutoSave/Enabled/Description: Save changes automatically
Settings/AutoSave/Hint: Automatically save changes during editing
Settings/CamelCase/Caption: Camel Case Wiki Links
Settings/CamelCase/Hint: You can globally disable automatic linking of ~CamelCase phrases. Requires reload to take effect
Settings/CamelCase/Description: Enable automatic ~CamelCase linking
Settings/Caption: Settings
Settings/Hint: These settings let you customise the behaviour of TiddlyWiki.
Settings/NavigationAddressBar/Caption: Navigation Address Bar

View File

@ -66,12 +66,13 @@ var WikiParser = function(type,text,options) {
*/
WikiParser.prototype.setupRules = function(proto,configPrefix) {
var self = this;
$tw.utils.each(proto,function(object,name) {
if(self.wiki.getTiddlerText(configPrefix + name,"enable") !== "enable") {
delete proto[name];
console.log("deleting",name)
}
});
if(!$tw.safemode) {
$tw.utils.each(proto,function(object,name) {
if(self.wiki.getTiddlerText(configPrefix + name,"enable") !== "enable") {
delete proto[name];
}
});
}
};
/*

View File

@ -1,6 +1,8 @@
title: $:/core/ui/ControlPanel/Parsing
tags: $:/tags/ControlPanel
caption: Parsing
tags: $:/tags/ControlPanel/Advanced
caption: {{$:/language/ControlPanel/Parsing/Caption}}
\define lingo-base() $:/language/ControlPanel/Parsing/
\define parsing-inner(typeCap)
<li>
@ -16,14 +18,16 @@ caption: Parsing
</ul>
\end
! Pragma Parse Rules
<<lingo Hint>>
! <<lingo Pragma/Caption>>
<<parsing-outer typeLower:"pragma" typeCap:"Pragma">>
! Inline Parse Rules
! <<lingo Inline/Caption>>
<<parsing-outer typeLower:"inline" typeCap:"Inline">>
! Block Parse Rules
! <<lingo Block/Caption>>
<<parsing-outer typeLower:"block" typeCap:"Block">>

View File

@ -0,0 +1,8 @@
title: $:/core/ui/ControlPanel/Settings/CamelCase
tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/CamelCase/Caption}}
\define lingo-base() $:/language/ControlPanel/Settings/CamelCase/
<<lingo Hint>>
<$checkbox tiddler="$:/config/WikiParserRules/Inline/wikilink" field="text" checked="enable" unchecked="disable" default="enable"> <$link to="$:/config/WikiParserRules/Inline/wikilink"><<lingo Description>></$link> </$checkbox>

View File

@ -20,5 +20,7 @@ Safe mode triggers two changes:
* All plugins are temporarily disabled. You can use the control panel to disable individual plugins
* Any tiddlers that override shadow tiddlers are renamed to give them the prefix `SAFE: `, thus restoring the underlying shadow tiddler
* Certain configuration options are ignored, and the default settings used instead:
** WikiParserRuleConfiguration
A report tiddler is displayed that allows you to inspect the tiddlers that were renamed.