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