From 3d61dd1aa96013c04b205a5f52bfc4f8f998c673 Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Tue, 6 Jan 2015 21:18:28 +0100 Subject: [PATCH 01/25] documentation for #1330 heavily modified ListWidget extracted NestedLists added IteratorVariables --- .../tiddlers/demonstrations/NestedLists.tid | 45 +++++++ .../tiddlers/variables/IteratorVariables | 91 ++++++++++++++ .../tw5.com/tiddlers/widgets/ListWidget.tid | 119 +++++++++--------- 3 files changed, 199 insertions(+), 56 deletions(-) create mode 100644 editions/tw5.com/tiddlers/demonstrations/NestedLists.tid create mode 100644 editions/tw5.com/tiddlers/variables/IteratorVariables diff --git a/editions/tw5.com/tiddlers/demonstrations/NestedLists.tid b/editions/tw5.com/tiddlers/demonstrations/NestedLists.tid new file mode 100644 index 000000000..694aac663 --- /dev/null +++ b/editions/tw5.com/tiddlers/demonstrations/NestedLists.tid @@ -0,0 +1,45 @@ +title: NestedLists +tags: ListWidget +created: 20150106180000000 +modified: 20150106180000000 + + +The following sidebar tabs give examples of grouped lists created by nesting. + +!! Types Tab + +The list in the [[Types|$:/core/ui/MoreSideBar/Types]] tab is generated with this markup: + +``` +<$list filter="[!is[system]has[type]each[type]sort[type]]"> +
+<$view field="type"/> +<$list filter="[type{!!type}!is[system]sort[title]]"> +
+<$link to={{!!title}}><$view field="title"/> +
+ +
+ +``` + +The outer list filter selects each discrete value found in the `type` field. The inner list filter selects all the (non-system) tiddlers with that type. + +!! Recent Tab + +The list in the [[Recent|$:/core/ui/SideBar/Recent]] tab is generated with this markup: + +``` +<$list filter="[!is[system]has[modified]!sort[modified]limit[100]eachday[modified]]"> +
+<$view field="modified" format="date" template="DDth MMM YYYY"/> +<$list filter="[sameday{!!modified}!is[system]!sort[modified]]"> +
+<$link to={{!!title}}><$view field="title"/> +
+ +
+ +``` + +Here, the outer list filter selects each discrete day found in the `modified` field, while the inner list filter selects all the tiddlers dated the same day in the `modified` field. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/variables/IteratorVariables b/editions/tw5.com/tiddlers/variables/IteratorVariables new file mode 100644 index 000000000..d88f54e65 --- /dev/null +++ b/editions/tw5.com/tiddlers/variables/IteratorVariables @@ -0,0 +1,91 @@ +title: IteratorVariables +tags: ListWidget Variables +created: 20150106180000000 +modified: 20150106180000000 + +The ListWidget exposes the following iterator variables during list processing: + +; `<>` +: set to the current index, e.g. `1` +; `<>` +: set to `true` for an even index, otherwise `false` +; `<>` +: set to `true` for last index, otherwise `false` + +The ListWidget allows to declare an `iterator` attribute through which you can declare a custom iterator variable prefix: + +``` +<$list filter="[tag[foo]]" iterator="my-foo"> +... + +``` + +!!Using Iterator Variables + +You can use iterator variables with the RevealWidget to conditionally render output depending on the current index... + +''only show for item at index 1, i.e. the first item'' + +``` +<$reveal type=match default=1 text=<>> +... + +``` + +''show for all except first index'' + +``` +<$reveal type=nomatch default=1 text=<>> +... + +``` + +''only show at even indexes'' + +``` +<$reveal type=match default=true text=<>> +... + +``` + +''only show at uneven indexes'' + +``` +<$reveal type=nomatch default=true text=<>> +... + +``` + +''only show for last index'' + +``` +<$reveal type=match default=true text=<>> +... + +``` + +!! Live Example + +``` +
+<$list filter="one two three" iterator=foo> +
<>
+
`<>` = <>
+
`<>` = <>
+
`<>` = <>
+ +
+``` + +Displays as: + +<<< +
+<$list filter="one two three" iterator=foo> +
<>
+
`<>` = <>
+
`<>` = <>
+
`<>` = <>
+ +
+<<< \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/widgets/ListWidget.tid b/editions/tw5.com/tiddlers/widgets/ListWidget.tid index 07a745e06..7bb88cbce 100644 --- a/editions/tw5.com/tiddlers/widgets/ListWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/ListWidget.tid @@ -1,36 +1,85 @@ created: 201310241419 -modified: 20141027193838998 +modified: 20150106180000000 tags: Widgets title: ListWidget caption: list ! Introduction -The list widget displays a sequence of tiddlers that match a [[tiddler filter|Filters]]. It can be used for many purposes: +The list widget displays a sequence of tiddlers matching a [[filter|Filters]]. It is vital for a various use-cases, e.g.: -* Displaying custom lists of links, like in TiddlyWiki5's sidebar -* Custom lists, such as "all tiddlers tagged 'task' that are not tagged 'done'" -* Listing each of the tags applied to a tiddler +* Displaying custom lists, e.g. "all tiddlers tagged ''task'' not tagged ''done''" +* Listing the tags of a tiddler +* Displaying lists of links, like in the sidebar * Handling the main story river -The tiddlers are displayed by transcluding each in turn through a template. There are several ways to specify the template and for controlling the behaviour of the list. +! Examples + +''plain list'' + +``` +<$list filter="[tag[ListWidget]sort[title]]"/> +``` + +Displays as: + +<<< +<$list filter="[tag[ListWidget]sort[title]]"/> + +<<< + +''custom item output'' + +``` +<$list filter="[tag[ListWidget]sort[title]]"> +<> +{{||$:/core/ui/ViewTemplate/tags}} + +``` + +Displays as: + +<<< +<$list filter="[tag[ListWidget]sort[title]]"> +<> +{{||$:/core/ui/ViewTemplate/tags}} + +<<< + +''custom item template'' + +``` +<$list filter="[tag[ListWidget]sort[title]]" template="$:/core/ui/ViewTemplate/subtitle"/> +``` + +Displays as: + +<<< +<$list filter="[tag[ListWidget]sort[title]]" template="$:/core/ui/ViewTemplate/subtitle"/> + +<<< + +!! Grouped Lists + +See NestedLists for how to generate nested and grouped lists using the ListWidget. ! Content and Attributes -The content of the `<$list>` widget is an optional template to use for rendering each tiddler in the list. Alternatively, the template can be specified as a tiddler title in the ``template`` attribute. As a fallback, the default template just displays the tiddler title. +A number of options controll the list behaviour.... |!Attribute |!Description | |filter |The [[tiddler filter|Filters]] to display | -|template |The title of a template tiddler for rendering each tiddler in the list | -|editTemplate |An alternative template to use for DraftTiddlers in edit mode | -|variable |The [[widget variable|WidgetVariables]] name to be assigned the title of each tiddler in the list. Defaults to ''currentTiddler'' | +|template |The title of a template tiddler for transcluding each tiddler in the list. When no template is specified, the body of the ListWidget serves as the item template. With no body, a simple link to the tiddler is returned. | +|editTemplate |An alternative template to use for [[DraftTiddlers|DraftMechanism]] in edit mode | +|variable |The name for a [[variable|Variables]] in which the title of each listed tiddler is stored. Defaults to ''currentTiddler'' | +|iterator|a custom iterator prefix, see IteratorVariables| |emptyMessage |Message to be displayed when the list is empty | |storyview |Optional name of module responsible for animating/processing the list | |history |The title of the tiddler containing the navigation history | -!! Handling edit mode +!! Edit mode -The `<$list>` widget can optionally render draft tiddlers through a different template tiddler than ordinary tiddlers -- see DraftMechanism for a discussion of how this capability is used. +The `<$list>` widget can optionally render draft tiddlers through a different template to handle editing, see DraftMechanism. !! `storyview` attribute @@ -42,48 +91,6 @@ The `storyview` attribute specifies the name of an optional module that can anim In order for the storyviews to animate correctly each entry in the list should be a single block mode DOM element. -!! Handling history and navigation - -The optional `history` attribute specifies the name of a tiddler that is used to track the current tiddler for navigation purposes. When the history tiddler changes the list view responds by telling the listview to handle navigating to the new tiddler. See the NavigationMechanism for more details. - -! Examples - -!! Creating nested lists - -The ''types'' and ''recent'' tabs in the sidebar give two examples of a grouped list created by nesting. - -The ''types'' listing is performed with this markup: - -``` -<$list filter="[!is[system]has[type]each[type]sort[type]]"> -
-<$view field="type"/> -<$list filter="[type{!!type}!is[system]sort[title]]"> -
-<$link to={{!!title}}><$view field="title"/> -
- -
- - -``` - -The outer list filter selects each discrete value found in the `type` field. The inner list filter selects all the (non-system) tiddlers with that type. - -The ''recent'' listing is performed with this markup: - -``` -<$list filter="[!is[system]has[modified]!sort[modified]limit[100]eachday[modified]]"> -
-<$view field="modified" format="date" template="DDth MMM YYYY"/> -<$list filter="[sameday{!!modified}!is[system]!sort[modified]]"> -
-<$link to={{!!title}}><$view field="title"/> -
- -
- -``` - -Here the outer list filter selects each discrete day found in the `modified` field, while the inner list filter selects all the tiddlers dated the same day in the `modified` field. +!! History and navigation +The optional `history` attribute specifies the name of a tiddler that is used to track the current tiddler for navigation purposes. When the history tiddler changes the list view responds by telling the listview to handle navigating to the new tiddler. See HistoryMechanism for details. \ No newline at end of file From 2ff7e0c6c6aa488821e86d704891a6b41d332dee Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Tue, 6 Jan 2015 21:22:47 +0100 Subject: [PATCH 02/25] removed superfluous newline --- editions/tw5.com/tiddlers/demonstrations/NestedLists.tid | 1 - 1 file changed, 1 deletion(-) diff --git a/editions/tw5.com/tiddlers/demonstrations/NestedLists.tid b/editions/tw5.com/tiddlers/demonstrations/NestedLists.tid index 694aac663..b6142e7a6 100644 --- a/editions/tw5.com/tiddlers/demonstrations/NestedLists.tid +++ b/editions/tw5.com/tiddlers/demonstrations/NestedLists.tid @@ -3,7 +3,6 @@ tags: ListWidget created: 20150106180000000 modified: 20150106180000000 - The following sidebar tabs give examples of grouped lists created by nesting. !! Types Tab From 8ba3e8973e67eb09d131539eb0d2816b90216733 Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Thu, 8 Jan 2015 21:26:48 +0100 Subject: [PATCH 03/25] autolinks system tiddlers enhanced extlink parser to cover system tiddler links of course, only those without spaces in their title didn't want to open up an extra parser for this as extlink has all the basics --- .../parsers/wikiparser/rules/extlink.js | 38 +++++++++++++------ 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/core/modules/parsers/wikiparser/rules/extlink.js b/core/modules/parsers/wikiparser/rules/extlink.js index 539d0f11b..b9df988be 100644 --- a/core/modules/parsers/wikiparser/rules/extlink.js +++ b/core/modules/parsers/wikiparser/rules/extlink.js @@ -3,16 +3,20 @@ title: $:/core/modules/parsers/wikiparser/rules/extlink.js type: application/javascript module-type: wikirule -Wiki text inline rule for external links. For example: +Wiki text inline rule for external links and system tiddler links. +Can be suppressed preceding them with `~`. ``` -An external link: http://www.tiddlywiki.com/ +; system tiddler +: $:/config -A suppressed external link: ~http://www.tiddlyspace.com/ +; external link +: http://www.tiddlywiki.com/ + +; suppressed external link +: ~http://www.tiddlyspace.com/ ``` -External links can be suppressed by preceding them with `~`. - \*/ (function(){ @@ -26,29 +30,41 @@ exports.types = {inline: true}; exports.init = function(parser) { this.parser = parser; // Regexp to match - this.matchRegExp = /~?(?:file|http|https|mailto|ftp|irc|news|data|skype):[^\s<>{}\[\]`|'"\\^~]+(?:\/|\b)/mg; + this.matchRegExp = /~?(?:\$|file|http|https|mailto|ftp|irc|news|data|skype):[^\s<>{}\[\]`|'"\\^~]+(?:\/|\b)/mg; }; exports.parse = function() { + var match = this.match[0]; // Move past the match this.parser.pos = this.matchRegExp.lastIndex; // Create the link unless it is suppressed - if(this.match[0].substr(0,1) === "~") { - return [{type: "text", text: this.match[0].substr(1)}]; + if(match.substr(0,1) === "~") { + return [{type: "text", text: match.substr(1)}]; + } else if(match.substr(0,1) === "$") { + return [{ + type: "link", + attributes: { + to: {type: "string", value: match} + }, + children: [{ + type: "text", + text: match + }] + }]; } else { return [{ type: "element", tag: "a", attributes: { - href: {type: "string", value: this.match[0]}, + href: {type: "string", value: match}, "class": {type: "string", value: "tc-tiddlylink-external"}, target: {type: "string", value: "_blank"} }, children: [{ - type: "text", text: this.match[0] + type: "text", text: match }] }]; } }; -})(); +})(); \ No newline at end of file From 795a9291870d2fda636f22375cd841eb3e8b3257 Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Fri, 9 Jan 2015 23:51:07 +0100 Subject: [PATCH 04/25] create syslink.js, revert extlink.js introduces new parser for system links --- .../parsers/wikiparser/rules/extlink.js | 38 +++++----------- .../parsers/wikiparser/rules/syslink.js | 45 +++++++++++++++++++ 2 files changed, 56 insertions(+), 27 deletions(-) create mode 100644 core/modules/parsers/wikiparser/rules/syslink.js diff --git a/core/modules/parsers/wikiparser/rules/extlink.js b/core/modules/parsers/wikiparser/rules/extlink.js index b9df988be..539d0f11b 100644 --- a/core/modules/parsers/wikiparser/rules/extlink.js +++ b/core/modules/parsers/wikiparser/rules/extlink.js @@ -3,20 +3,16 @@ title: $:/core/modules/parsers/wikiparser/rules/extlink.js type: application/javascript module-type: wikirule -Wiki text inline rule for external links and system tiddler links. -Can be suppressed preceding them with `~`. +Wiki text inline rule for external links. For example: ``` -; system tiddler -: $:/config +An external link: http://www.tiddlywiki.com/ -; external link -: http://www.tiddlywiki.com/ - -; suppressed external link -: ~http://www.tiddlyspace.com/ +A suppressed external link: ~http://www.tiddlyspace.com/ ``` +External links can be suppressed by preceding them with `~`. + \*/ (function(){ @@ -30,41 +26,29 @@ exports.types = {inline: true}; exports.init = function(parser) { this.parser = parser; // Regexp to match - this.matchRegExp = /~?(?:\$|file|http|https|mailto|ftp|irc|news|data|skype):[^\s<>{}\[\]`|'"\\^~]+(?:\/|\b)/mg; + this.matchRegExp = /~?(?:file|http|https|mailto|ftp|irc|news|data|skype):[^\s<>{}\[\]`|'"\\^~]+(?:\/|\b)/mg; }; exports.parse = function() { - var match = this.match[0]; // Move past the match this.parser.pos = this.matchRegExp.lastIndex; // Create the link unless it is suppressed - if(match.substr(0,1) === "~") { - return [{type: "text", text: match.substr(1)}]; - } else if(match.substr(0,1) === "$") { - return [{ - type: "link", - attributes: { - to: {type: "string", value: match} - }, - children: [{ - type: "text", - text: match - }] - }]; + if(this.match[0].substr(0,1) === "~") { + return [{type: "text", text: this.match[0].substr(1)}]; } else { return [{ type: "element", tag: "a", attributes: { - href: {type: "string", value: match}, + href: {type: "string", value: this.match[0]}, "class": {type: "string", value: "tc-tiddlylink-external"}, target: {type: "string", value: "_blank"} }, children: [{ - type: "text", text: match + type: "text", text: this.match[0] }] }]; } }; -})(); \ No newline at end of file +})(); diff --git a/core/modules/parsers/wikiparser/rules/syslink.js b/core/modules/parsers/wikiparser/rules/syslink.js new file mode 100644 index 000000000..d38b6dcf3 --- /dev/null +++ b/core/modules/parsers/wikiparser/rules/syslink.js @@ -0,0 +1,45 @@ +/*\ +title: $:/core/modules/parsers/wikiparser/rules/syslink.js +type: application/javascript +module-type: wikirule + +Wiki text inline rule for system tiddler links. +Can be suppressed preceding them with `~`. +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +exports.name = "syslink"; +exports.types = {inline: true}; + +exports.init = function(parser) { + this.parser = parser; + // Regexp to match + this.matchRegExp = /~?(?:\$):[^\s<>{}\[\]`|'"\\^~]+(?:\/|\b)/mg; +}; + +exports.parse = function() { + var match = this.match[0]; + // Move past the match + this.parser.pos = this.matchRegExp.lastIndex; + // Create the link unless it is suppressed + if(match.substr(0,1) === "~") { + return [{type: "text", text: match.substr(1)}]; + } else { + return [{ + type: "link", + attributes: { + to: {type: "string", value: match} + }, + children: [{ + type: "text", + text: match + }] + }]; + } +}; + +})(); \ No newline at end of file From 048b50924f8bee0ac6b91ddb4003195a19be4825 Mon Sep 17 00:00:00 2001 From: dpdannemiller Date: Sat, 10 Jan 2015 14:38:37 -0600 Subject: [PATCH 05/25] Update Creating and editing tiddlers.tid Typo. --- .../tiddlers/workingwithtw/Creating and editing tiddlers.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editions/tw5.com/tiddlers/workingwithtw/Creating and editing tiddlers.tid b/editions/tw5.com/tiddlers/workingwithtw/Creating and editing tiddlers.tid index 5e69fbe7c..17ec20402 100644 --- a/editions/tw5.com/tiddlers/workingwithtw/Creating and editing tiddlers.tid +++ b/editions/tw5.com/tiddlers/workingwithtw/Creating and editing tiddlers.tid @@ -21,7 +21,7 @@ To edit an existing tiddler, click the {{$:/core/images/edit-button}} button at When you create a new tiddler or edit an existing one, the tiddler will go into draft mode. This presents a control panel for modifying the tiddler in various ways. It has several parts, from top to bottom: *''The title field'' - Use this to change the title of the tiddler -*''The tag selector'' - Use this to add or remove tags. As you type a tag name in the box, a dropdown list will show you any existing tags that match. You can pick from this list or create a completely new tag. Then click the ''add'' button to add the tag to the tiddler. Each tag is shown as a coloured pill. Clikc the "×" on a pill to remove that tag +*''The tag selector'' - Use this to add or remove tags. As you type a tag name in the box, a dropdown list will show you any existing tags that match. You can pick from this list or create a completely new tag. Then click the ''add'' button to add the tag to the tiddler. Each tag is shown as a coloured pill. Click the "×" on a pill to remove that tag *''The text area'' - Use this to edit the main content of the tiddler. Click the ''show preview'' button to see what your changes will look like *''The type selector'' - Use this when a tiddler needs to be displayed in a special way, such as an image. See ContentType for a list of the options. The default is `text/vnd.tiddlywiki`, which means the tiddler contains WikiText *''The field selector'' - Use this to add or remove fields on the tiddler. For example, if you are editing a tiddler that's being used to tag other tiddlers, you can add a [[''list'' field|ListField]] to change the order in which those tiddlers will be listed From ddb8daa15a97a998c8cb99dbd716f2fd55ae1563 Mon Sep 17 00:00:00 2001 From: James Welford Anderson Date: Sun, 11 Jan 2015 06:44:56 +0900 Subject: [PATCH 06/25] add noclean parameter deletes directory by default --- core/modules/commands/rendertiddlers.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/modules/commands/rendertiddlers.js b/core/modules/commands/rendertiddlers.js index d3ec0a44a..d513688c5 100644 --- a/core/modules/commands/rendertiddlers.js +++ b/core/modules/commands/rendertiddlers.js @@ -38,8 +38,11 @@ Command.prototype.execute = function() { pathname = path.resolve(this.commander.outputPath,this.params[2]), type = this.params[3] || "text/html", extension = this.params[4] || ".html", + deletedirectory = (this.params[5] || "") != "noclean", tiddlers = wiki.filterTiddlers(filter); - $tw.utils.deleteDirectory(pathname); + if(deletedirectory){ + $tw.utils.deleteDirectory(pathname); + } $tw.utils.createDirectory(pathname); $tw.utils.each(tiddlers,function(title) { var parser = wiki.parseTiddler(template), From 99499c0403e21bc89459b318aa93931abe125e80 Mon Sep 17 00:00:00 2001 From: James Welford Anderson Date: Sun, 11 Jan 2015 09:28:18 +0900 Subject: [PATCH 07/25] staticmeta --- core/templates/static.template.html.tid | 3 +++ core/templates/static.tiddler.html.tid | 3 +++ 2 files changed, 6 insertions(+) diff --git a/core/templates/static.template.html.tid b/core/templates/static.template.html.tid index ab824ea62..27a2e324d 100644 --- a/core/templates/static.template.html.tid +++ b/core/templates/static.template.html.tid @@ -12,6 +12,9 @@ type: text/vnd.tiddlywiki-html + + + {{$:/core/wiki/title}} diff --git a/core/templates/static.tiddler.html.tid b/core/templates/static.tiddler.html.tid index f2fc623b2..3c113d301 100644 --- a/core/templates/static.tiddler.html.tid +++ b/core/templates/static.tiddler.html.tid @@ -10,6 +10,9 @@ title: $:/core/templates/static.tiddler.html + + + From 9c7936413a8c50817044eb409661a575f7f97563 Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Sun, 11 Jan 2015 01:29:53 +0100 Subject: [PATCH 08/25] edit-tags-filter-tags-and-titles fixes #1333 extracts the tag-link into a component template... **$:/core/ui/Components/tag-link** ...so as to split the list in two, having two filters that list tiddlers in the add-tags popup to... 1. firstly, list matching used tags 2. secondly, list mathcing tiddler titles, thus availabe for tagging Does away with searching content as it is irrelevant if not distracting for tagging. Why two lists? Consider wanting to tag a tiddler with "Filters"... observe how the result would otherwise be way too far down because existing tiddler titles get in the way. Component templates are also desireable elsewhere, e.g. #1318 --- core/ui/Components/tag-link.tid | 9 +++++++++ core/ui/EditTemplate/tags.tid | 14 ++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 core/ui/Components/tag-link.tid diff --git a/core/ui/Components/tag-link.tid b/core/ui/Components/tag-link.tid new file mode 100644 index 000000000..088210d48 --- /dev/null +++ b/core/ui/Components/tag-link.tid @@ -0,0 +1,9 @@ +title: $:/core/ui/Components/tag-link + +<$link> +<$set name="backgroundColor" value={{!!color}}> +> class="tc-tag-label"> +<$view field="title" format="text"/> + + + \ No newline at end of file diff --git a/core/ui/EditTemplate/tags.tid b/core/ui/EditTemplate/tags.tid index f1490aec3..49bbd2efc 100644 --- a/core/ui/EditTemplate/tags.tid +++ b/core/ui/EditTemplate/tags.tid @@ -27,14 +27,12 @@ background-color:$(backgroundColor)$; <$reveal state=<> type="nomatch" text="" default="">
<$linkcatcher set="$:/temp/NewTagName" setTo="" message="tm-add-tag"> -<$list filter="[!is[shadow]tags[]search{$:/temp/NewTagName}sort[title]]"> -<$link> -<$set name="backgroundColor" value={{!!color}}> -> class="tc-tag-label"> -<$view field="title" format="text"/> - - - +<$list filter="[tags[]search:title{$:/temp/NewTagName}sort[]]"> +{{||$:/core/ui/Components/tag-link}} + +
+<$list filter="[!is[system]search:title{$:/temp/NewTagName}sort[]]"> +{{||$:/core/ui/Components/tag-link}}
From b43d4a33d6408d1855d1b410195083062ac64e9f Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Sun, 11 Jan 2015 11:04:02 +0100 Subject: [PATCH 09/25] simplified regexp Ok, I think I've got it now. The following matches all... 1. starting with a literal `$:` 2. then any number of character not a whitespace, `<` or `|` 3. closing with anything that is, again, not a whitespace, `<` or `|` Test here... http://tbdemo.tiddlyspot.com/#Autolink%20System%20Tiddlers --- core/modules/parsers/wikiparser/rules/syslink.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/parsers/wikiparser/rules/syslink.js b/core/modules/parsers/wikiparser/rules/syslink.js index d38b6dcf3..79c0a0df8 100644 --- a/core/modules/parsers/wikiparser/rules/syslink.js +++ b/core/modules/parsers/wikiparser/rules/syslink.js @@ -18,7 +18,7 @@ exports.types = {inline: true}; exports.init = function(parser) { this.parser = parser; // Regexp to match - this.matchRegExp = /~?(?:\$):[^\s<>{}\[\]`|'"\\^~]+(?:\/|\b)/mg; + this.matchRegExp = /~?\$:[^\s<|]+(?:[^\s<|])/mg; }; exports.parse = function() { From 80631b35ea68cb38e73230bf30784c405eb6870a Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Sun, 11 Jan 2015 11:55:22 +0100 Subject: [PATCH 10/25] updated NestedLists, renamed to GroupedLists added tw-code macro Didn't implement the codeblock widget as suggested here... https://github.com/Jermolene/TiddlyWiki5/pull/1332#discussion_r22762157 ...because it would only return `undefined`. --- .../tiddlers/demonstrations/GroupedLists.tid | 18 ++++++++ .../tiddlers/demonstrations/NestedLists.tid | 44 ------------------- .../tiddlers/system/wikitext-macros.tid | 10 +++++ .../tw5.com/tiddlers/widgets/ListWidget.tid | 2 +- 4 files changed, 29 insertions(+), 45 deletions(-) create mode 100644 editions/tw5.com/tiddlers/demonstrations/GroupedLists.tid delete mode 100644 editions/tw5.com/tiddlers/demonstrations/NestedLists.tid diff --git a/editions/tw5.com/tiddlers/demonstrations/GroupedLists.tid b/editions/tw5.com/tiddlers/demonstrations/GroupedLists.tid new file mode 100644 index 000000000..d656ecbe9 --- /dev/null +++ b/editions/tw5.com/tiddlers/demonstrations/GroupedLists.tid @@ -0,0 +1,18 @@ +title: GroupedLists +tags: ListWidget +created: 20150106180000000 +modified: 20150106180000000 + +The following sidebar tabs give examples of grouped lists created by nesting. + +!! Types Tab + +For the [[Types|$:/core/ui/MoreSideBar/Types]] tab, the outer list filter as shown below selects each discrete value found in the `type` field. The inner list filter selects all the (non-system) tiddlers with that type. + +<> + +!! Recent Tab + +The list in the [[Recent|$:/core/ui/SideBar/Recent]] tab is generated using the TimelineMacro. Here, the outer list filter selects each discrete day found in the `modified` field, while the inner list filter selects all the tiddlers dated the same day in the `modified` field. + +<> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/demonstrations/NestedLists.tid b/editions/tw5.com/tiddlers/demonstrations/NestedLists.tid deleted file mode 100644 index b6142e7a6..000000000 --- a/editions/tw5.com/tiddlers/demonstrations/NestedLists.tid +++ /dev/null @@ -1,44 +0,0 @@ -title: NestedLists -tags: ListWidget -created: 20150106180000000 -modified: 20150106180000000 - -The following sidebar tabs give examples of grouped lists created by nesting. - -!! Types Tab - -The list in the [[Types|$:/core/ui/MoreSideBar/Types]] tab is generated with this markup: - -``` -<$list filter="[!is[system]has[type]each[type]sort[type]]"> -
-<$view field="type"/> -<$list filter="[type{!!type}!is[system]sort[title]]"> -
-<$link to={{!!title}}><$view field="title"/> -
- -
- -``` - -The outer list filter selects each discrete value found in the `type` field. The inner list filter selects all the (non-system) tiddlers with that type. - -!! Recent Tab - -The list in the [[Recent|$:/core/ui/SideBar/Recent]] tab is generated with this markup: - -``` -<$list filter="[!is[system]has[modified]!sort[modified]limit[100]eachday[modified]]"> -
-<$view field="modified" format="date" template="DDth MMM YYYY"/> -<$list filter="[sameday{!!modified}!is[system]!sort[modified]]"> -
-<$link to={{!!title}}><$view field="title"/> -
- -
- -``` - -Here, the outer list filter selects each discrete day found in the `modified` field, while the inner list filter selects all the tiddlers dated the same day in the `modified` field. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/system/wikitext-macros.tid b/editions/tw5.com/tiddlers/system/wikitext-macros.tid index f919d3fce..78705fc24 100644 --- a/editions/tw5.com/tiddlers/system/wikitext-macros.tid +++ b/editions/tw5.com/tiddlers/system/wikitext-macros.tid @@ -28,3 +28,13 @@ Renders as: $src$ \end + +\define tw-code(tiddler) +
<$view tiddler="$tiddler$" format="text"/>
+\end + +\define tw-code-link(tiddler) +[[$tiddler$]]: + +<> +\end \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/widgets/ListWidget.tid b/editions/tw5.com/tiddlers/widgets/ListWidget.tid index 7bb88cbce..3894c9170 100644 --- a/editions/tw5.com/tiddlers/widgets/ListWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/ListWidget.tid @@ -61,7 +61,7 @@ Displays as: !! Grouped Lists -See NestedLists for how to generate nested and grouped lists using the ListWidget. +See GroupedLists for how to generate nested and grouped lists using the ListWidget. ! Content and Attributes From f1ca5936e3a165d99066595c75547eed49fdaa9b Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sun, 11 Jan 2015 15:19:50 +0000 Subject: [PATCH 11/25] Move new editions/editiondescription filter docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Might as well put them in tw5.com because we can’t build it with 5.1.17 any more anyway. --- .../tiddlers/filters}/FilterOperator editiondescription.tid | 0 .../tiddlers/filters}/FilterOperator editions.tid | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename editions/{prerelease/tiddlers => tw5.com/tiddlers/filters}/FilterOperator editiondescription.tid (100%) rename editions/{prerelease/tiddlers => tw5.com/tiddlers/filters}/FilterOperator editions.tid (100%) diff --git a/editions/prerelease/tiddlers/FilterOperator editiondescription.tid b/editions/tw5.com/tiddlers/filters/FilterOperator editiondescription.tid similarity index 100% rename from editions/prerelease/tiddlers/FilterOperator editiondescription.tid rename to editions/tw5.com/tiddlers/filters/FilterOperator editiondescription.tid diff --git a/editions/prerelease/tiddlers/FilterOperator editions.tid b/editions/tw5.com/tiddlers/filters/FilterOperator editions.tid similarity index 100% rename from editions/prerelease/tiddlers/FilterOperator editions.tid rename to editions/tw5.com/tiddlers/filters/FilterOperator editions.tid From df719e32951d2416dcb1745941689debbd0b59ea Mon Sep 17 00:00:00 2001 From: David P Dannemiller Date: Sun, 11 Jan 2015 10:00:49 -0600 Subject: [PATCH 12/25] Update cla-individual.md Signed CLA-individual --- licenses/cla-individual.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/licenses/cla-individual.md b/licenses/cla-individual.md index fb20c633f..f1fb85cd0 100644 --- a/licenses/cla-individual.md +++ b/licenses/cla-individual.md @@ -204,3 +204,5 @@ Evgeniy Gryaznov, @evgeniy-gryaznov, 2014/12/23 Andrew Harrison, @infurnoape, 2014/12/27 Arlen Beiler, @arlen22, 2014/12/30 + +David P Dannemiller, @dpdannemiller, 2015/01/10 From 88cf991ec54a8ff53aa7b61685e8ace57fa4f26a Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sun, 11 Jan 2015 16:19:50 +0000 Subject: [PATCH 13/25] Updated release note --- .../prerelease/tiddlers/Release 5.1.8.tid | 46 +++++++++++++------ 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/editions/prerelease/tiddlers/Release 5.1.8.tid b/editions/prerelease/tiddlers/Release 5.1.8.tid index 79d9729d1..d07d21bff 100644 --- a/editions/prerelease/tiddlers/Release 5.1.8.tid +++ b/editions/prerelease/tiddlers/Release 5.1.8.tid @@ -1,28 +1,44 @@ caption: 5.1.8 -created: 20141219225007260 -modified: 20141219225007260 +created: 20150111154632954 +modified: 20150111154632954 tags: ReleaseNotes title: Release 5.1.8 type: text/vnd.tiddlywiki //[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.1.7...v5.1.8]]// +This release includes many improvements to the documentation for TiddlyWiki. Many thanks to everyone who has helped out, but especially to our prodigious new contributor Astrid Elocson. + !! Translation Improvements -* +* Improvements to French, Chinese and Japanese translations + +* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/5d947ed582fb9d68c01d82a334ab75498a8724ef]] Spanish translation +* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/cb8caf6a01aeeac480bf28661888961657b0dbd8]] Czech translation + +!! Usability Improvements + +* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/ea6e60e66983ee1184f09c5796ef6c8bceae703a]] automatic focusing of the search box at startup +* [[Introduced|https://github.com/Jermolene/TiddlyWiki5/commit/4f3cb8b9aebfc4f65f40c96ef99730887d746b41]] the [[Railroad Plugin]] by Astrid Elocson (see it in action in the new [[Filter Syntax]] documentation) +* [[Migrated|https://github.com/Jermolene/TiddlyWiki5/commit/230066eeae9ace8336612e02c78f8cdaa3f717e4]] functionality of "Sticky Titles" theme into "Vanilla"/"Snow White". This means that tiddler titles will stick to the top of the window during scrolling on browsers that support `position: sticky` (such as Safari and Firefox) +* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/8cb7090c40489c81e8c5dfb8cbbdee2c60998c3e]] icons to [[$:/AdvancedSearch]], [[$:/ControlPanel]] and [[$:/TagManager]] +* [[Changed|https://github.com/Jermolene/TiddlyWiki5/commit/b9129d77e99970579074bdb4f9c2ef4b77b812c6]] wording of tiddler "save" button to "store" + !! Hackability Improvements -* +* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/a1ca53fa9bab218719b582bd553a578a477666c9]] IteratorVariables to the ListWidget !! Bug Fixes -* +* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/pull/1249]] version number compatibility checks for plugins +* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/1adfe20508116da0ee4b5c9e72ea9742f24b60c9]] problem with repeatedly cancelling a draft !! Node.js Changes //These changes are only relevant to people using TiddlyWiki under Node.js// -* +* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/cc85368fd48f1e5878018a4e00b6c17d436e67a9]] [[Highlight Plugin]] to work when generating static files under Node.js +* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/c296f14210545374124df5d4ae9ffb402ed73561]] problem with case-insensitive filing systems (eg Windows) !! Changes affecting plugin authors @@ -32,13 +48,17 @@ type: text/vnd.tiddlywiki [[@Jermolene|https://github.com/Jermolene]] would like to thank the contributors to this release who have generously given their time to help improve TiddlyWiki: -* [[@anavarre|https://github.com/anavarre]] + +* [[@aelocson|https://github.com/aelocson]] +* [[@Arlen22|https://github.com/Arlen22]] +* [[@BramChen|https://github.com/BramChen]] * [[@Drakor|https://github.com/Drakor]] -* [[@dullroar|https://github.com/dullroar]] -* [[@erwanm|https://github.com/erwanm]] -* [[@malgam|https://github.com/malgam]] -* [[@nameanyone|https://github.com/nameanyone]] -* [[@pekopeko1|https://github.com/pekopeko1]] -* [[@Spangenhelm|https://github.com/Spangenhelm]] +* [[@evgeniy-gryaznov|https://github.com/evgeniy-gryaznov]] +* [[@felixhayashi|https://github.com/felixhayashi]] +* [[@gernert|https://github.com/gernert]] +* [[@Infurnoape|https://github.com/Infurnoape]] +* [[@Jc-L|https://github.com/Jc-L]] * [[@tobibeer|https://github.com/tobibeer]] +* [[@twMat|https://github.com/twMat]] +* [[@welford|https://github.com/welford]] * [[@xcazin|https://github.com/xcazin]] From c44a349f1e2426ccd5a9b2c47a6eb97f8652f6c5 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sun, 11 Jan 2015 16:26:29 +0000 Subject: [PATCH 14/25] Release note updates --- editions/prerelease/tiddlers/Release 5.1.8.tid | 2 ++ 1 file changed, 2 insertions(+) diff --git a/editions/prerelease/tiddlers/Release 5.1.8.tid b/editions/prerelease/tiddlers/Release 5.1.8.tid index d07d21bff..aa14e9422 100644 --- a/editions/prerelease/tiddlers/Release 5.1.8.tid +++ b/editions/prerelease/tiddlers/Release 5.1.8.tid @@ -23,6 +23,7 @@ This release includes many improvements to the documentation for TiddlyWiki. Man * [[Migrated|https://github.com/Jermolene/TiddlyWiki5/commit/230066eeae9ace8336612e02c78f8cdaa3f717e4]] functionality of "Sticky Titles" theme into "Vanilla"/"Snow White". This means that tiddler titles will stick to the top of the window during scrolling on browsers that support `position: sticky` (such as Safari and Firefox) * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/8cb7090c40489c81e8c5dfb8cbbdee2c60998c3e]] icons to [[$:/AdvancedSearch]], [[$:/ControlPanel]] and [[$:/TagManager]] * [[Changed|https://github.com/Jermolene/TiddlyWiki5/commit/b9129d77e99970579074bdb4f9c2ef4b77b812c6]] wording of tiddler "save" button to "store" +* [[Added|https://github.com/Jermolene/TiddlyWiki5/issues/1103]] automatic linking of system tiddlers such as $:/ControlPanel !! Hackability Improvements @@ -53,6 +54,7 @@ This release includes many improvements to the documentation for TiddlyWiki. Man * [[@Arlen22|https://github.com/Arlen22]] * [[@BramChen|https://github.com/BramChen]] * [[@Drakor|https://github.com/Drakor]] +* [[@dpdannemiller|https://github.com/dpdannemiller]] * [[@evgeniy-gryaznov|https://github.com/evgeniy-gryaznov]] * [[@felixhayashi|https://github.com/felixhayashi]] * [[@gernert|https://github.com/gernert]] From f16f66cc5b873eaafa7977e183fddd234723afcd Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sun, 11 Jan 2015 16:32:30 +0000 Subject: [PATCH 15/25] Release note update --- editions/prerelease/tiddlers/Release 5.1.8.tid | 2 ++ 1 file changed, 2 insertions(+) diff --git a/editions/prerelease/tiddlers/Release 5.1.8.tid b/editions/prerelease/tiddlers/Release 5.1.8.tid index aa14e9422..aca15a9a4 100644 --- a/editions/prerelease/tiddlers/Release 5.1.8.tid +++ b/editions/prerelease/tiddlers/Release 5.1.8.tid @@ -18,6 +18,7 @@ This release includes many improvements to the documentation for TiddlyWiki. Man !! Usability Improvements +* [[Improved|https://github.com/Jermolene/TiddlyWiki5/pull/1353]] behaviour of the tag dropdown in the edit template * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/ea6e60e66983ee1184f09c5796ef6c8bceae703a]] automatic focusing of the search box at startup * [[Introduced|https://github.com/Jermolene/TiddlyWiki5/commit/4f3cb8b9aebfc4f65f40c96ef99730887d746b41]] the [[Railroad Plugin]] by Astrid Elocson (see it in action in the new [[Filter Syntax]] documentation) * [[Migrated|https://github.com/Jermolene/TiddlyWiki5/commit/230066eeae9ace8336612e02c78f8cdaa3f717e4]] functionality of "Sticky Titles" theme into "Vanilla"/"Snow White". This means that tiddler titles will stick to the top of the window during scrolling on browsers that support `position: sticky` (such as Safari and Firefox) @@ -40,6 +41,7 @@ This release includes many improvements to the documentation for TiddlyWiki. Man * [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/cc85368fd48f1e5878018a4e00b6c17d436e67a9]] [[Highlight Plugin]] to work when generating static files under Node.js * [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/c296f14210545374124df5d4ae9ffb402ed73561]] problem with case-insensitive filing systems (eg Windows) +* [[Added|https://github.com/Jermolene/TiddlyWiki5/pull/1354]] mobile metadata to static page templates !! Changes affecting plugin authors From 9e167dc468d7e6aac6c7b9defff6796fc4a91def Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sun, 11 Jan 2015 16:44:51 +0000 Subject: [PATCH 16/25] Adjust tests for system tiddler linking (#1103) --- editions/test/tiddlers/tests/test-filters.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/editions/test/tiddlers/tests/test-filters.js b/editions/test/tiddlers/tests/test-filters.js index 7946b79b0..d27fc0ab0 100644 --- a/editions/test/tiddlers/tests/test-filters.js +++ b/editions/test/tiddlers/tests/test-filters.js @@ -175,12 +175,12 @@ describe("Filter tests", function() { }); it("should handle the links operator", function() { - expect(wiki.filterTiddlers("[!is[shadow]links[]sort[title]]").join(",")).toBe("a fourth tiddler,one,Tiddler Three,TiddlerSix,TiddlerTwo,TiddlerZero"); + expect(wiki.filterTiddlers("[!is[shadow]links[]sort[title]]").join(",")).toBe("$:/TiddlerTwo,a fourth tiddler,one,Tiddler Three,TiddlerSix,TiddlerZero"); expect(wiki.filterTiddlers("[all[shadows]links[]sort[title]]").join(",")).toBe("TiddlerOne"); }); it("should handle the backlinks operator", function() { - expect(wiki.filterTiddlers("[!is[shadow]backlinks[]sort[title]]").join(",")).toBe("a fourth tiddler,one"); + expect(wiki.filterTiddlers("[!is[shadow]backlinks[]sort[title]]").join(",")).toBe("a fourth tiddler,one,TiddlerOne"); expect(wiki.filterTiddlers("[all[shadows]backlinks[]sort[title]]").join(",")).toBe("Tiddler Three"); }); @@ -248,7 +248,7 @@ describe("Filter tests", function() { }); it("should handle the '[is[missing]]' operator", function() { - expect(wiki.filterTiddlers("[all[missing]]").join(",")).toBe("TiddlerZero,TiddlerTwo"); + expect(wiki.filterTiddlers("[all[missing]]").join(",")).toBe("TiddlerZero"); expect(wiki.filterTiddlers("[!is[missing]sort[title]]").join(",")).toBe("$:/TiddlerTwo,a fourth tiddler,one,Tiddler Three,TiddlerOne"); expect(wiki.filterTiddlers("[[TiddlerOne]is[missing]]").join(",")).toBe(""); expect(wiki.filterTiddlers("[[TiddlerZero]is[missing]]").join(",")).toBe("TiddlerZero"); From 557d1e9207849a3b2b8815aa75ed8958f46d2615 Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Sun, 11 Jan 2015 18:15:27 +0100 Subject: [PATCH 17/25] updated tw-code macro to use codeblock widget As per fix.... https://github.com/Jermolene/TiddlyWiki5/pull/1332#issuecomment-69499836 Tested, working. --- editions/tw5.com/tiddlers/system/wikitext-macros.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editions/tw5.com/tiddlers/system/wikitext-macros.tid b/editions/tw5.com/tiddlers/system/wikitext-macros.tid index 78705fc24..8a0fe87c4 100644 --- a/editions/tw5.com/tiddlers/system/wikitext-macros.tid +++ b/editions/tw5.com/tiddlers/system/wikitext-macros.tid @@ -30,7 +30,7 @@ $src$ \end \define tw-code(tiddler) -
<$view tiddler="$tiddler$" format="text"/>
+<$codeblock language={{$tiddler$!!type}} code={{$tiddler$}}/> \end \define tw-code-link(tiddler) From e87dadd61d39f057199c342c9cd08b67f83abc1f Mon Sep 17 00:00:00 2001 From: James Welford Anderson Date: Mon, 12 Jan 2015 02:55:42 +0900 Subject: [PATCH 18/25] update docs change var name --- core/language/en-GB/Help/rendertiddlers.tid | 4 ++-- core/modules/commands/rendertiddlers.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/language/en-GB/Help/rendertiddlers.tid b/core/language/en-GB/Help/rendertiddlers.tid index 158872f23..cb982efb3 100644 --- a/core/language/en-GB/Help/rendertiddlers.tid +++ b/core/language/en-GB/Help/rendertiddlers.tid @@ -4,7 +4,7 @@ description: Render tiddlers matching a filter to a specified ContentType Render a set of tiddlers matching a filter to separate files of a specified ContentType (defaults to `text/html`) and extension (defaults to `.html`). ``` ---rendertiddlers