mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Change widget syntax to $
instead of underscore
eg `<$list>`
This commit is contained in:
parent
dbd123675a
commit
300b6cc485
@ -10,9 +10,9 @@ Wiki rule for HTML elements and widgets. For example:
|
||||
This is an HTML5 aside element
|
||||
</aside>
|
||||
|
||||
<_slider target="MyTiddler">
|
||||
<$slider target="MyTiddler">
|
||||
This is a widget invocation
|
||||
</_slider>
|
||||
</$slider>
|
||||
|
||||
}}}
|
||||
|
||||
@ -31,7 +31,7 @@ var voidElements = "area,base,br,col,command,embed,hr,img,input,keygen,link,meta
|
||||
exports.init = function(parser) {
|
||||
this.parser = parser;
|
||||
// Regexp to match
|
||||
this.matchRegExp = /<(_)?([A-Za-z]+)(\s*[^>]*?)(\/)?>/mg;
|
||||
this.matchRegExp = /<(\$)?([A-Za-z]+)(\s*[^>]*?)(\/)?>/mg;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -78,7 +78,7 @@ exports.parse = function() {
|
||||
isBlock = false;
|
||||
}
|
||||
if(!isSelfClosing && (isWidget || voidElements.indexOf(tagName) === -1)) {
|
||||
var reEndString = "(</" + (isWidget ? "_" : "") + tagName + ">)",
|
||||
var reEndString = "(</" + (isWidget ? "\\$" : "") + tagName + ">)",
|
||||
reEnd = new RegExp(reEndString,"mg"),
|
||||
content;
|
||||
if(isBlock) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
title: $:/templates/PageTemplate
|
||||
|
||||
<!-- The navigator catches navigation events and updates the story and history tiddlers -->
|
||||
<_navigator story="$:/StoryList" history="$:/HistoryList">
|
||||
<$navigator story="$:/StoryList" history="$:/HistoryList">
|
||||
|
||||
<!-- The top navigation bar -->
|
||||
<div class="navbar navbar-fixed-top">
|
||||
@ -23,15 +23,15 @@ title: $:/templates/PageTemplate
|
||||
<div class="span2">
|
||||
<div style="position:fixed;">
|
||||
<!-- The navigation menu -->
|
||||
<_list filter="[list[$:/StoryList]]" history="$:/HistoryList" editTemplate="$:/templates/EditTemplate" listview=classic itemClass="tw-menu-list-item"/>
|
||||
<$list filter="[list[$:/StoryList]]" history="$:/HistoryList" editTemplate="$:/templates/EditTemplate" listview=classic itemClass="tw-menu-list-item"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span10">
|
||||
<!-- The main display -->
|
||||
<_list filter="[list[$:/StoryList]]" history="$:/HistoryList" template="$:/templates/ViewTemplate" editTemplate="$:/templates/EditTemplate" listview=classic itemClass="tw-tiddler-frame"/>
|
||||
<$list filter="[list[$:/StoryList]]" history="$:/HistoryList" template="$:/templates/ViewTemplate" editTemplate="$:/templates/EditTemplate" listview=classic itemClass="tw-tiddler-frame"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</_navigator>
|
||||
</$navigator>
|
||||
|
||||
|
@ -2,6 +2,6 @@ title: $:/templates/StaticContent
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<!-- For Google, and people without JavaScript-->
|
||||
<_list filter="[!is[shadow]sort[title]]" >
|
||||
<_view field="title" format="text"></_view>
|
||||
</_list>
|
||||
<$list filter="[!is[shadow]sort[title]]" >
|
||||
<$view field="title" format="text"></$view>
|
||||
</$list>
|
||||
|
@ -1,5 +1,5 @@
|
||||
title: $:/templates/TagTemplate
|
||||
|
||||
@@.label
|
||||
<_view field="title" format="text" />
|
||||
<$view field="title" format="text" />
|
||||
@@
|
||||
|
@ -2,18 +2,18 @@ title: $:/templates/ViewTemplate
|
||||
modifier: JeremyRuston
|
||||
|
||||
<span class="title">
|
||||
<_view field="title"/>
|
||||
<_button message="tw-close">close</_button>
|
||||
<$view field="title"/>
|
||||
<$button message="tw-close">close</$button>
|
||||
</span>
|
||||
|
||||
<div class="small">
|
||||
<_view field="modifier" format="link"/>
|
||||
<_view field="modified" format="date"/>
|
||||
<$view field="modifier" format="link"/>
|
||||
<$view field="modified" format="date"/>
|
||||
</div>
|
||||
|
||||
@@.tw-tags-wrapper <_list filter="[is[current]tags[]]" template="$:/templates/TagTemplate" />@@
|
||||
@@.tw-tags-wrapper <$list filter="[is[current]tags[]]" template="$:/templates/TagTemplate" />@@
|
||||
|
||||
<div class="body">
|
||||
<_view field="text" format="wikified">
|
||||
</_view>
|
||||
<$view field="text" format="wikified">
|
||||
</$view>
|
||||
</div>
|
||||
|
@ -4,4 +4,4 @@ title: $:/core/templates/css-tiddler
|
||||
|
||||
This template is used for saving CSS tiddlers as a style tag with data attributes representing the tiddler fields.
|
||||
|
||||
-->`<style`<_fields template=' data-tiddler-$name$="$encoded_value$"'></_fields>` type="text/css">`<_view field="text" format="text" />`</style>`
|
||||
-->`<style`<$fields template=' data-tiddler-$name$="$encoded_value$"'></$fields>` type="text/css">`<$view field="text" format="text" />`</style>`
|
@ -4,6 +4,6 @@ title: $:/core/templates/html-div-tiddler
|
||||
|
||||
This template is used for saving tiddlers as an HTML DIV tag with attributes representing the tiddler fields.
|
||||
|
||||
-->`<div`<_fields template=' $name$="$encoded_value$"'></_fields>`>
|
||||
<pre>`<_view field="text" format="htmlencoded" />`</pre>
|
||||
-->`<div`<$fields template=' $name$="$encoded_value$"'></$fields>`>
|
||||
<pre>`<$view field="text" format="htmlencoded" />`</pre>
|
||||
</div>`
|
||||
|
@ -4,4 +4,4 @@ title: $:/core/templates/html-tiddler
|
||||
|
||||
This template is used for saving tiddlers as raw HTML
|
||||
|
||||
--><_view field="text" format="htmlwikified" />
|
||||
--><$view field="text" format="htmlwikified" />
|
@ -4,4 +4,4 @@ title: $:/core/templates/javascript-tiddler
|
||||
|
||||
This template is used for saving JavaScript tiddlers as a script tag with data attributes representing the tiddler fields.
|
||||
|
||||
-->`<script`<_fields template=' data-tiddler-$name$="$encoded_value$"'></_fields>` type="text/javascript">`<_view field="text" format="text" />`</script>`
|
||||
-->`<script`<$fields template=' data-tiddler-$name$="$encoded_value$"'></$fields>` type="text/javascript">`<$view field="text" format="text" />`</script>`
|
@ -4,5 +4,5 @@ title: $:/core/templates/module-tiddler
|
||||
|
||||
This template is used for saving JavaScript tiddlers as a script tag with data attributes representing the tiddler fields. The body of the tiddler is wrapped in a call to the `$tw.modules.define` function in order to define the body of the tiddler as a module
|
||||
|
||||
-->`<script`<_fields template=' data-tiddler-$name$="$encoded_value$"'></_fields>` type="text/javascript" data-module="yes">$tw.modules.define("`<_view field="title" format="jsencoded" />`","`<_view field="module-type" format="jsencoded" />`",function(module,exports,require) {`<_view field="text" format="text" />`});
|
||||
-->`<script`<$fields template=' data-tiddler-$name$="$encoded_value$"'></$fields>` type="text/javascript" data-module="yes">$tw.modules.define("`<$view field="title" format="jsencoded" />`","`<$view field="module-type" format="jsencoded" />`",function(module,exports,require) {`<$view field="text" format="text" />`});
|
||||
</script>`
|
@ -1,3 +1,3 @@
|
||||
title: $:/core/templates/plain-text-tiddler
|
||||
|
||||
<_view field="text" format="text" />
|
||||
<$view field="text" format="text" />
|
Loading…
Reference in New Issue
Block a user