mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-04 06:20:28 +00:00
Change to ?
for conditional definitions
This commit is contained in:
parent
0d78b3fa38
commit
5d413d3e2d
@ -35,7 +35,7 @@ Instantiate parse rule
|
||||
exports.init = function(parser) {
|
||||
this.parser = parser;
|
||||
// Regexp to match
|
||||
this.matchRegExp = /^\\(\+?)(function|procedure|widget)\s+([^(\s]+)(\(\s*([^)]*)\))?(\s*\r?\n)?/mg;
|
||||
this.matchRegExp = /^\\(\??)(function|procedure|widget)\s+([^(\s]+)(\(\s*([^)]*)\))?(\s*\r?\n)?/mg;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -91,7 +91,7 @@ exports.parse = function() {
|
||||
if(this.parser.configTrimWhiteSpace) {
|
||||
parseTreeNodes[0].configTrimWhiteSpace = true;
|
||||
}
|
||||
if(this.match[1] === "+") {
|
||||
if(this.match[1] === "?") {
|
||||
$tw.utils.addAttributeToParseTreeNode(parseTreeNodes[0],"conditional","yes");
|
||||
}
|
||||
return parseTreeNodes;
|
||||
|
@ -27,7 +27,7 @@ Instantiate parse rule
|
||||
exports.init = function(parser) {
|
||||
this.parser = parser;
|
||||
// Regexp to match
|
||||
this.matchRegExp = /^\\(\+?)define\s+([^(\s]+)\(\s*([^)]*)\)(\s*\r?\n)?/mg;
|
||||
this.matchRegExp = /^\\(\??)define\s+([^(\s]+)\(\s*([^)]*)\)(\s*\r?\n)?/mg;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -89,7 +89,7 @@ exports.parse = function() {
|
||||
}];
|
||||
$tw.utils.addAttributeToParseTreeNode(parseTreeNodes[0],"name",this.match[2]);
|
||||
$tw.utils.addAttributeToParseTreeNode(parseTreeNodes[0],"value",text);
|
||||
if(this.match[1] === "+") {
|
||||
if(this.match[1] === "?") {
|
||||
$tw.utils.addAttributeToParseTreeNode(parseTreeNodes[0],"conditional","yes");
|
||||
}
|
||||
return parseTreeNodes;
|
||||
|
@ -3,7 +3,7 @@ code_body: yes
|
||||
parameters: (tabsList,default,state:"$:/state/tab",class,template,buttonTemplate,retain,actions,explicitState)
|
||||
is-macro: yes
|
||||
|
||||
\+define tabs-button()
|
||||
\?define tabs-button()
|
||||
\whitespace trim
|
||||
<$button set=<<tabsState>> setTo=<<currentTab>> default=<<__default__>> selectedClass="tc-tab-selected" tooltip={{!!tooltip}}>
|
||||
<$tiddler tiddler=<<save-currentTiddler>>>
|
||||
@ -19,7 +19,7 @@ is-macro: yes
|
||||
</$button>
|
||||
\end
|
||||
|
||||
\+define tabs-tab()
|
||||
\?define tabs-tab()
|
||||
\whitespace trim
|
||||
<$set name="save-currentTiddler" value=<<currentTiddler>>>
|
||||
<$tiddler tiddler=<<currentTab>>>
|
||||
@ -28,14 +28,14 @@ is-macro: yes
|
||||
</$set>
|
||||
\end
|
||||
|
||||
\+define tabs-tab-list()
|
||||
\?define tabs-tab-list()
|
||||
\whitespace trim
|
||||
<$list filter=<<__tabsList__>> variable="currentTab" storyview="pop">
|
||||
<<tabs-tab>>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
\+define tabs-tab-body()
|
||||
\?define tabs-tab-body()
|
||||
\whitespace trim
|
||||
<$list filter=<<__tabsList__>> variable="currentTab">
|
||||
<$reveal type="match" state=<<tabsState>> text=<<currentTab>> default=<<__default__>> retain=<<__retain__>> tag="div">
|
||||
|
@ -14,7 +14,7 @@ title: $:/global/this-is-one
|
||||
|
||||
\whitespace trim
|
||||
|
||||
\+procedure example()
|
||||
\?procedure example()
|
||||
ONE
|
||||
\end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user