\ No newline at end of file
diff --git a/editions/tw5.com/tiddlers/filters/decodebase64 Operator.tid b/editions/tw5.com/tiddlers/filters/decodebase64 Operator.tid
new file mode 100644
index 000000000..6760af8d3
--- /dev/null
+++ b/editions/tw5.com/tiddlers/filters/decodebase64 Operator.tid
@@ -0,0 +1,16 @@
+caption: decodebase64
+op-input: a [[selection of titles|Title Selection]]
+op-output: the input with base 64 decoding applied
+op-parameter:
+op-parameter-name:
+op-purpose: apply base 64 decoding to a string
+tags: [[Filter Operators]] [[String Operators]]
+title: decodebase64 Operator
+type: text/vnd.tiddlywiki
+from-version: 5.2.6
+
+See Mozilla Developer Network for details of [[base 64 encoding|https://developer.mozilla.org/en-US/docs/Glossary/Base64]]. TiddlyWiki uses [[library code from @nijikokun|https://gist.github.com/Nijikokun/5192472]] to handle the conversion.
+
+The input strings must be base64 encoded. The output strings are binary data.
+
+<<.operator-examples "decodebase64">>
diff --git a/editions/tw5.com/tiddlers/filters/encodebase64 Operator.tid b/editions/tw5.com/tiddlers/filters/encodebase64 Operator.tid
new file mode 100644
index 000000000..ddbc73078
--- /dev/null
+++ b/editions/tw5.com/tiddlers/filters/encodebase64 Operator.tid
@@ -0,0 +1,16 @@
+caption: encodebase64
+op-input: a [[selection of titles|Title Selection]]
+op-output: the input with base 64 encoding applied
+op-parameter:
+op-parameter-name:
+op-purpose: apply base 64 encoding to a string
+tags: [[Filter Operators]] [[String Operators]]
+title: encodebase64 Operator
+type: text/vnd.tiddlywiki
+from-version: 5.2.6
+
+See Mozilla Developer Network for details of [[base 64 encoding|https://developer.mozilla.org/en-US/docs/Glossary/Base64]]. TiddlyWiki uses [[library code from @nijikokun|https://gist.github.com/Nijikokun/5192472]] to handle the conversion.
+
+The input strings are interpreted as binary data. The output strings are base64 encoded.
+
+<<.operator-examples "encodebase64">>
From 3da3318396b7495d8e2435145758275651a5c8c6 Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Fri, 3 Feb 2023 19:22:43 +0000
Subject: [PATCH 02/83] Node.js: Prefer .tid format when a _canonical_uri field
present
Fixes #7238
---
core/modules/utils/filesystem.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/modules/utils/filesystem.js b/core/modules/utils/filesystem.js
index cb542493f..1ba34323e 100644
--- a/core/modules/utils/filesystem.js
+++ b/core/modules/utils/filesystem.js
@@ -238,7 +238,7 @@ exports.generateTiddlerFileInfo = function(tiddler,options) {
} else {
// Save as a .tid or a text/binary file plus a .meta file
var tiddlerType = tiddler.fields.type || "text/vnd.tiddlywiki";
- if(tiddlerType === "text/vnd.tiddlywiki") {
+ if(tiddlerType === "text/vnd.tiddlywiki" || tiddler.hasField("_canonical_uri")) {
// Save as a .tid file
fileInfo.type = "application/x-tiddler";
fileInfo.hasMetaFile = false;
From 8567c48be8c41a35bef58bd0d3208e4c95337eb6 Mon Sep 17 00:00:00 2001
From: TonyM <31584658+AnthonyMuscio@users.noreply.github.com>
Date: Sat, 4 Feb 2023 06:25:23 +1100
Subject: [PATCH 03/83] Update BrowseWidget.tid (#7231)
* Update BrowseWidget.tid
Made sure all references to use of the `<$browse>` widget were changed to `<$browse/>`
Which possibly caused this problem, now closed https://github.com/Jermolene/TiddlyWiki5/issues/7223
If not closed other widgets may work
* To documentation standard
Replaced `The content of the `<$browse>` widget is ignored.`
`The content of the <<.wid BrowseWidget>> widget is ignored.`
To restore documentation standards as per @Jermolene
---
editions/tw5.com/tiddlers/widgets/BrowseWidget.tid | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/editions/tw5.com/tiddlers/widgets/BrowseWidget.tid b/editions/tw5.com/tiddlers/widgets/BrowseWidget.tid
index 83953c26b..28012bd68 100644
--- a/editions/tw5.com/tiddlers/widgets/BrowseWidget.tid
+++ b/editions/tw5.com/tiddlers/widgets/BrowseWidget.tid
@@ -11,7 +11,7 @@ The browse widget displays an HTML file browser button that allows the user to c
! Content and Attributes
-The content of the `<$browse>` widget is ignored.
+The content of the <<.wid BrowseWidget>> widget is ignored.
|!Attribute |!Description |
|multiple |Set to "multiple" to select multiple file upload |
@@ -26,10 +26,10 @@ On iPhone/iPad choosing the multiple option will remove the ability to take phot
''e.g.''
```
-<$browse>
+<$browse/>
```
renders as:
-<$browse>
+<$browse/>
From 81f514116657d0d567be7a4c45762a85beaa8bc0 Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Fri, 10 Feb 2023 09:00:52 +0000
Subject: [PATCH 04/83] Dynannotate: Don't crash when used in the fake DOM
Fixes #7258
---
.../dynannotate/modules/dynannotate.js | 39 +++++++++++--------
1 file changed, 23 insertions(+), 16 deletions(-)
diff --git a/plugins/tiddlywiki/dynannotate/modules/dynannotate.js b/plugins/tiddlywiki/dynannotate/modules/dynannotate.js
index cd47c07c7..12d8f7155 100644
--- a/plugins/tiddlywiki/dynannotate/modules/dynannotate.js
+++ b/plugins/tiddlywiki/dynannotate/modules/dynannotate.js
@@ -38,23 +38,28 @@ DynannotateWidget.prototype.render = function(parent,nextSibling) {
// Create our DOM nodes
var isSnippetMode = this.isSnippetMode();
this.domContent = $tw.utils.domMaker("div",{
- "class": "tc-dynannotation-selection-container"
+ "class": "tc-dynannotation-selection-container",
+ document: this.document
});
if(isSnippetMode) {
- this.domContent.setAttribute("hidden","hidden");
+ this.domContent.setAttribute("hidden","hidden");
}
this.domAnnotations = $tw.utils.domMaker("div",{
- "class": "tc-dynannotation-annotation-wrapper"
+ "class": "tc-dynannotation-annotation-wrapper",
+ document: this.document
});
this.domSnippets = $tw.utils.domMaker("div",{
- "class": "tc-dynannotation-snippet-wrapper"
+ "class": "tc-dynannotation-snippet-wrapper",
+ document: this.document
});
this.domSearches = $tw.utils.domMaker("div",{
- "class": "tc-dynannotation-search-wrapper"
+ "class": "tc-dynannotation-search-wrapper",
+ document: this.document
});
this.domWrapper = $tw.utils.domMaker("div",{
"class": "tc-dynannotation-wrapper",
- children: [this.domContent,this.domAnnotations,this.domSnippets,this.domSearches]
+ children: [this.domContent,this.domAnnotations,this.domSnippets,this.domSearches],
+ document: this.document
})
parent.insertBefore(this.domWrapper,nextSibling);
this.domNodes.push(this.domWrapper);
@@ -64,16 +69,18 @@ DynannotateWidget.prototype.render = function(parent,nextSibling) {
}
// Render our child widgets
this.renderChildren(this.domContent,null);
- if(isSnippetMode) {
- // Apply search snippets
- this.applySnippets();
- } else {
- // Get the list of annotation tiddlers
- this.getAnnotationTiddlers();
- // Apply annotations
- this.applyAnnotations();
- // Apply search overlays
- this.applySearch();
+ if(!this.document.isTiddlyWikiFakeDom) {
+ if(isSnippetMode) {
+ // Apply search snippets
+ this.applySnippets();
+ } else {
+ // Get the list of annotation tiddlers
+ this.getAnnotationTiddlers();
+ // Apply annotations
+ this.applyAnnotations();
+ // Apply search overlays
+ this.applySearch();
+ }
}
// Save the width of the wrapper so that we can tell when it changes
this.wrapperWidth = this.domWrapper.offsetWidth;
From 028dfe39b70dd0b8f901a8b2cb2a5d6c25755cb7 Mon Sep 17 00:00:00 2001
From: Cameron Fischer
Date: Fri, 10 Feb 2023 05:17:32 -0500
Subject: [PATCH 05/83] Fixed issue where $genesis didn't pass isBlock (#7230)
* Fixed issue where $genesis didn't pass isBlock
* Added $mode attribute for genesis
* Added documentation for $mode attribute
---
core/modules/widgets/genesis.js | 2 ++
.../tests/data/genesis-widget/Block.tid | 30 +++++++++++++++++++
.../tiddlers/widgets/GenesisWidget.tid | 1 +
3 files changed, 33 insertions(+)
create mode 100644 editions/test/tiddlers/tests/data/genesis-widget/Block.tid
diff --git a/core/modules/widgets/genesis.js b/core/modules/widgets/genesis.js
index 6d30f3c36..c8403a3d4 100644
--- a/core/modules/widgets/genesis.js
+++ b/core/modules/widgets/genesis.js
@@ -46,6 +46,7 @@ GenesisWidget.prototype.execute = function() {
this.genesisRemappable = this.getAttribute("$remappable","yes") === "yes";
this.genesisNames = this.getAttribute("$names","");
this.genesisValues = this.getAttribute("$values","");
+ this.genesisIsBlock = this.getAttribute("$mode",this.parseTreeNode.isBlock && "block") === "block";
// Do not create a child widget if the $type attribute is missing or blank
if(!this.genesisType) {
this.makeChildWidgets(this.parseTreeNode.children);
@@ -60,6 +61,7 @@ GenesisWidget.prototype.execute = function() {
tag: nodeTag,
attributes: {},
orderedAttributes: [],
+ isBlock: this.genesisIsBlock,
children: this.parseTreeNode.children || [],
isNotRemappable: !this.genesisRemappable
}];
diff --git a/editions/test/tiddlers/tests/data/genesis-widget/Block.tid b/editions/test/tiddlers/tests/data/genesis-widget/Block.tid
new file mode 100644
index 000000000..dfa5dacaf
--- /dev/null
+++ b/editions/test/tiddlers/tests/data/genesis-widget/Block.tid
@@ -0,0 +1,30 @@
+title: Genesis/Block
+description: genesis widget distinguishes between block and inline
+type: text/vnd.tiddlywiki-multiple
+tags: [[$:/tags/wiki-test-spec]]
+
+title: Output
+
+\whitespace trim
+<$genesis $type="$reveal" type=nomatch>
+
+Block
+$genesis>
+
+<$genesis $type="$reveal" type=nomatch $mode=block>
+
+Block forced block
+$genesis>
+
+<$genesis $type="$reveal" type=nomatch $mode=inline>
+
+Block forced inline
+$genesis>
+
+<$genesis $type=$reveal type=nomatch>Inline$genesis>
+<$genesis $type=$reveal type=nomatch $mode=block>Inline forced block$genesis>
+<$genesis $type=$reveal type=nomatch $mode=inline>Inline forced inline$genesis>
++
+title: ExpectedResult
+
+
Block
Block forced block
Block forced inline
Inline
Inline forced block
Inline forced inline
\ No newline at end of file
diff --git a/editions/tw5.com/tiddlers/widgets/GenesisWidget.tid b/editions/tw5.com/tiddlers/widgets/GenesisWidget.tid
index 9292e39ba..83bb36e6d 100644
--- a/editions/tw5.com/tiddlers/widgets/GenesisWidget.tid
+++ b/editions/tw5.com/tiddlers/widgets/GenesisWidget.tid
@@ -17,6 +17,7 @@ The content of the <<.wid genesis>> widget is used as the content of the dynamic
|$type |The type of widget or element to create (an initial `$` indicates a widget, otherwise an HTML element will be created) |
|$names |An optional filter evaluating to the names of a list of attributes to be applied to the widget |
|$values |An optional filter evaluating to the values corresponding to the list of names specified in <<.attr $names>> |
+|$mode |An optional override of the parsing mode. May be "inline" or "block" |
|//{other attributes starting with $}// |Other attributes starting with a single dollar sign are reserved for future use |
|//{attributes starting with $$}// |Attributes starting with two dollar signs are applied as attributes to the output widget, but with the attribute name changed to use a single dollar sign |
|//{attributes not starting with $}// |Any other attributes that do not start with a dollar are applied as attributes to the output widget |
From 77b418004af3c24373cc01e8bcdd4a49dfcceb7a Mon Sep 17 00:00:00 2001
From: Jeremy Ruston
Date: Fri, 10 Feb 2023 21:27:20 +0000
Subject: [PATCH 06/83] Zoomin: Avoid using broken tc-storyview-zoomin-tiddler
class (#7252)
* First commit
Fixes #7247
* Revert to setting the faulty tc-storyview-zoomin-tiddler class for backwards compatibility
---
themes/tiddlywiki/vanilla/base.tid | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid
index cb53840bf..98097296a 100644
--- a/themes/tiddlywiki/vanilla/base.tid
+++ b/themes/tiddlywiki/vanilla/base.tid
@@ -1445,7 +1445,7 @@ html body.tc-body.tc-single-tiddler-window {
width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}};
}
- body.tc-body .tc-storyview-zoomin-tiddler {
+ body.tc-body .tc-page-container.tc-page-view-zoomin .tc-tiddler-frame {
width: 100%;
width: calc(100% - 42px);
}
@@ -1457,7 +1457,7 @@ html body.tc-body.tc-single-tiddler-window {
margin-right: 0;
}
- body.tc-body .tc-storyview-zoomin-tiddler {
+ body.tc-body .tc-page-container.tc-page-view-zoomin .tc-tiddler-frame {
width: 100%;
width: calc(100% - 84px);
}
@@ -1716,7 +1716,7 @@ html body.tc-body.tc-single-tiddler-window {
margin-right: .3em;
}
-.tc-storyview-zoomin-tiddler {
+.tc-page-container.tc-page-view-zoomin .tc-tiddler-frame {
position: absolute;
display: block;
width: 100%;
@@ -1724,7 +1724,7 @@ html body.tc-body.tc-single-tiddler-window {
@media (min-width: <>) {
- .tc-storyview-zoomin-tiddler {
+ .tc-page-container.tc-page-view-zoomin .tc-tiddler-frame {
width: calc(100% - 84px);
}
From 95dc56d8508109a76c232cfbcd858889d32916a9 Mon Sep 17 00:00:00 2001
From: btheado
Date: Sat, 11 Feb 2023 03:15:44 -0600
Subject: [PATCH 07/83] Fix importTitle and autoOpenOnImport in the
tm-import-tiddler message (#7243)
* Add initial tm-import-tiddler test
* Add failing test for tm-import-tiddlers importTitle #7234
* Add failing test for tm-import-tiddlers autoOpenOnImport #7234
* Use event.paramObject instead of event to access tm-import-tiddlers options. Fixes #7234.
* Added a clarifying comment
* Allow mixing tm-import-tiddler params in both event and event.paramObject
* Added import test using tv-auto-open-on-import variable
* Removed stray punctuation
---
core/modules/widgets/navigator.js | 5 +--
.../tm-import-tiddler/CustomTitle.tid | 35 ++++++++++++++++++
.../messages/tm-import-tiddler/NoAutoOpen.tid | 35 ++++++++++++++++++
.../tm-import-tiddler/NoAutoOpenViaVar.tid | 36 +++++++++++++++++++
.../messages/tm-import-tiddler/default.tid | 34 ++++++++++++++++++
5 files changed, 143 insertions(+), 2 deletions(-)
create mode 100644 editions/test/tiddlers/tests/data/messages/tm-import-tiddler/CustomTitle.tid
create mode 100644 editions/test/tiddlers/tests/data/messages/tm-import-tiddler/NoAutoOpen.tid
create mode 100644 editions/test/tiddlers/tests/data/messages/tm-import-tiddler/NoAutoOpenViaVar.tid
create mode 100644 editions/test/tiddlers/tests/data/messages/tm-import-tiddler/default.tid
diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js
index 2e39fdd20..efdbba83f 100755
--- a/core/modules/widgets/navigator.js
+++ b/core/modules/widgets/navigator.js
@@ -499,7 +499,8 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
// Get the tiddlers
var tiddlers = $tw.utils.parseJSONSafe(event.param,[]);
// Get the current $:/Import tiddler
- var importTitle = event.importTitle ? event.importTitle : IMPORT_TITLE,
+ var paramObject = event.paramObject || {},
+ importTitle = event.importTitle || paramObject.importTitle || IMPORT_TITLE,
importTiddler = this.wiki.getTiddler(importTitle),
importData = this.wiki.getTiddlerData(importTitle,{}),
newFields = new Object({
@@ -540,7 +541,7 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
newFields.text = JSON.stringify(importData,null,$tw.config.preferences.jsonSpaces);
this.wiki.addTiddler(new $tw.Tiddler(importTiddler,newFields));
// Update the story and history details
- var autoOpenOnImport = event.autoOpenOnImport ? event.autoOpenOnImport : this.getVariable("tv-auto-open-on-import");
+ var autoOpenOnImport = event.autoOpenOnImport || paramObject.autoOpenOnImport || this.getVariable("tv-auto-open-on-import");
if(autoOpenOnImport !== "no") {
var storyList = this.getStoryList(),
history = [];
diff --git a/editions/test/tiddlers/tests/data/messages/tm-import-tiddler/CustomTitle.tid b/editions/test/tiddlers/tests/data/messages/tm-import-tiddler/CustomTitle.tid
new file mode 100644
index 000000000..2c7b8ba05
--- /dev/null
+++ b/editions/test/tiddlers/tests/data/messages/tm-import-tiddler/CustomTitle.tid
@@ -0,0 +1,35 @@
+title: Message/tm-import-tiddlers/CustomTitle
+description: tm-import-tiddlers message can import to a tiddler with a custom title
+type: text/vnd.tiddlywiki-multiple
+tags: [[$:/tags/wiki-test-spec]]
+
+title: Output
+
+text: <$text text={{MyCustomTitle}}/>
+plugin-type: <$text text={{MyCustomTitle!!plugin-type}}/>
+~$:/StoryList: <$text text={{$:/StoryList!!list}}/>
++
+title: Actions
+
+<$navigator story="$:/StoryList">
+<$action-sendmessage
+ $message="tm-import-tiddlers"
+ $param='[{"title": "Elephants"}, {"title": "Eagles"}]'
+ importTitle=MyCustomTitle/>
+$navigator>
+
++
+title: ExpectedResult
+
+
\ No newline at end of file
From fb99d3050e462a1634c9f31909b1381f00e6dc4d Mon Sep 17 00:00:00 2001
From: Mateusz Wilczek <36714554+mateuszwilczek@users.noreply.github.com>
Date: Fri, 17 Feb 2023 10:09:45 +0100
Subject: [PATCH 08/83] Sign the CLA (#7271)
Mateusz Wilczek, @mateuszwilczek, 2023/02/16
---
licenses/cla-individual.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/licenses/cla-individual.md b/licenses/cla-individual.md
index 290fa85f5..2c5ddf048 100644
--- a/licenses/cla-individual.md
+++ b/licenses/cla-individual.md
@@ -519,3 +519,5 @@ Scott Sauye, @CrossEye, 2023-01-04
Marcus Winter, @yaisog, 2023-01-07
Ethan Weller, @gamedungeon, 2023-01-17
+
+Mateusz Wilczek, @mateuszwilczek, 2023/02/16
From 55124b4ee62a8a0a49f5e05f02bd8ece1ac9d124 Mon Sep 17 00:00:00 2001
From: Mateusz Wilczek <36714554+mateuszwilczek@users.noreply.github.com>
Date: Fri, 17 Feb 2023 19:14:21 +0100
Subject: [PATCH 09/83] Improve documentation of WikiText formatting (#7272)
* Improve 'Formatting in WikiText.tid'
Add highlight formatting example.
Simplify code formatting example to be single line without nested list.
Improve bold, italic, and underscore formatting examples to be consistent with others.
* Improve 'Styles and Classes in WikiText.tid'
Add more examples, including the default highlight styling when no style or class is defined, as introduced in #6877
---
.../wikitext/Formatting in WikiText.tid | 12 +++---
.../Styles and Classes in WikiText.tid | 42 ++++++++++++-------
2 files changed, 32 insertions(+), 22 deletions(-)
diff --git a/editions/tw5.com/tiddlers/wikitext/Formatting in WikiText.tid b/editions/tw5.com/tiddlers/wikitext/Formatting in WikiText.tid
index 7166c28c8..b38f2b030 100644
--- a/editions/tw5.com/tiddlers/wikitext/Formatting in WikiText.tid
+++ b/editions/tw5.com/tiddlers/wikitext/Formatting in WikiText.tid
@@ -7,13 +7,13 @@ type: text/vnd.tiddlywiki
Available character formatting includes:
-* `backticks` for `code` (<<.icon $:/core/images/mono-line>>)
-** Alternatively, ``double backticks allows `embedded` backticks``
-* `''bold''` for ''bold text'' (<<.icon $:/core/images/bold>>)
-* `//italic//` for //italic text// (<<.icon $:/core/images/italic>>)
-* `__underscore__` for __underscored text__ (<<.icon $:/core/images/underline>>)
+* `code` for `code` (<<.icon $:/core/images/mono-line>>), alternatively ``double backticks allow `embedded` single backticks``
+* `''bold''` for ''bold'' text (<<.icon $:/core/images/bold>>)
+* `//italic//` for //italic// text (<<.icon $:/core/images/italic>>)
+* `__underscore__` for __underscored__ text (<<.icon $:/core/images/underline>>)
* `^^superscript^^` for ^^superscripted^^ text (<<.icon $:/core/images/superscript>>)
* `,,subscript,,` for ,,subscripted,, text (<<.icon $:/core/images/subscript>>)
-* `~~strikethrough~~` for ~~strikethrough~~ text (<<.icon $:/core/images/strikethrough>>)
+* `~~strikethrough~~` for ~~strikethrough~~ text (<<.icon $:/core/images/strikethrough>>)
-* `''bold''` for ''bold'' text (<<.icon $:/core/images/bold>>)
-* `//italic//` for //italic// text (<<.icon $:/core/images/italic>>)
-* `__underscore__` for __underscored__ text (<<.icon $:/core/images/underline>>)
-* `^^superscript^^` for ^^superscripted^^ text (<<.icon $:/core/images/superscript>>)
-* `,,subscript,,` for ,,subscripted,, text (<<.icon $:/core/images/subscript>>)
-* `~~strikethrough~~` for ~~strikethrough~~ text (<<.icon $:/core/images/strikethrough>>)
-* `@@highlight@@` for @@highlighted@@ text (no editor toolbar button), see [[Styles and Classes in WikiText]] for more formatting options
+Available character formatting in WikiText includes:
-See also: [[Code Blocks in WikiText]]
+|Wikitext | Button | Shortcut |Rendered Output |h
+|Double single quotes are used for `''bold text''`| <<.icon $:/core/images/bold>> | <> |Double single quotes are used for ''bold text'' |
+|Double slashes are used for `//italic text//`| <<.icon $:/core/images/italic>> | <> |Double slashes are used for //italic text//|
+|Double underscores are used for `__underlined text__`| <<.icon $:/core/images/underline>> | <> |Double underscores are used for __underlined text__ |
+|Double circumflex accents are used for `^^superscripted^^` text | <<.icon $:/core/images/superscript>> | <> |Double circumflex accents are used for ^^superscripted^^ text |
+|Double commas are used for `,,subscripted,,` text | <<.icon $:/core/images/subscript>> | <> |Double commas are used for ,,subscripted,, text |
+|Double tilde signs are used for `~~strikethrough~~` text | <<.icon $:/core/images/strikethrough>> | <> |Double tilde signs are used for ~~strikethrough~~ text |
+|Single backticks are used for ```code` `` | <<.icon $:/core/images/mono-line>> | <> |Single backticks are used for `code` |
+|Double @ characters are used to create a `@@highlight@@` | - | - |Double @ characters are used to create a @@highlight@@ |
+
+See [[Styles and Classes in WikiText]] for more formatting options
+
+!! Embedded Backticks
+
+|Wikitext |Rendered Output|h
+|``double backticks allows `embedded` backticks``|``double backticks allows `embedded` backticks``|
+
+!! Keyboard Shortcuts
+
+The full list of KeyboardShortcuts can be found in the $:/ControlPanel -> ''Keyboard Shortcuts'' tab.
+
+!! Semantic Information
+
+|Wikitext | Resulting HTML Code |h
+|Double single quotes are used for `''bold text''`|Double single quotes are used for `bold text` |
+|Double slashes are used for `//italic text//`|Double slashes are used for `italic text` |
+|Double underscores are used for `__underlined text__`|Double underscores are used for `underlined text` |
+|Double circumflex accents are used for `^^superscripted^^` text |Double circumflex accents are used for `superscripted` text |
+|Double commas are used for `,,subscripted,,` text |Double commas are used for `subscripted` text |
+|Double tilde signs are used for `~~strikethrough~~` text |Double tilde signs are used for `strikethrough` text |
+|Single backticks are used for ```code` `` |Single backticks are used for `code` |
+|Double @ characters are used to create a `@@highlight@@` |Double @ characters are used to create a `highlighted` |
+
+!! Bold vs Strong
+
+In TW we use the term "bold" instead of "strong" because most users are used to it. ... The rendering process converts our "bold text" into the STRONG HTML element.
+
+>The `` element is for content that is of greater importance, while the `` element is used to draw attention to text without indicating that it's more important.
+>https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong#b_vs._strong
+
+!! Underline vs. Underscore
+
+>Use underline to describe text formatting that puts a line under the characters. Use underscore to refer to the underscore character ( _ ).
+>https://learn.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/u/underline-vs-underscore
+
+!! Emphasis vs Italics
+
+>The `` element represents stress emphasis of its contents, while the `` element represents text that is set off from the normal prose, such as a foreign word, fictional character thoughts, or when the text refers to the definition of a word instead of representing its semantic meaning. (The title of a work, such as the name of a book or movie, should use ``.)
+>https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em#i_vs._em
From 3627ad1d2822e5267b54a0c4cac2633523b07946 Mon Sep 17 00:00:00 2001
From: hffqyd
Date: Sat, 4 Mar 2023 05:58:13 +0800
Subject: [PATCH 31/83] Signing the CLA (#7316)
---
licenses/cla-individual.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/licenses/cla-individual.md b/licenses/cla-individual.md
index c64e6ede6..744b5e133 100644
--- a/licenses/cla-individual.md
+++ b/licenses/cla-individual.md
@@ -523,3 +523,5 @@ Ethan Weller, @gamedungeon, 2023-01-17
Mateusz Wilczek, @mateuszwilczek, 2023/02/16
Andrea Octo, @andrigamerita, 2023/02/24
+
+HuanC Fu, @hffqyd, 2023/03/03
From 7d7ac662a2775b668fcc12cece6d38831c1728e6 Mon Sep 17 00:00:00 2001
From: hffqyd
Date: Sat, 4 Mar 2023 06:02:15 +0800
Subject: [PATCH 32/83] Saving via a Minimal Web Server (#7315)
A standalone mini web server enables support tiddlywiki as well as upload files/images, for use like `[img[images/uploaded.jpg]]`.
---
.../Saving via a Minimal Web Server.tid | 49 +++++++++++++++++++
1 file changed, 49 insertions(+)
create mode 100644 editions/tw5.com/tiddlers/saving/Saving via a Minimal Web Server.tid
diff --git a/editions/tw5.com/tiddlers/saving/Saving via a Minimal Web Server.tid b/editions/tw5.com/tiddlers/saving/Saving via a Minimal Web Server.tid
new file mode 100644
index 000000000..5bbf79485
--- /dev/null
+++ b/editions/tw5.com/tiddlers/saving/Saving via a Minimal Web Server.tid
@@ -0,0 +1,49 @@
+caption: tw5-server
+color: #70c9a0
+community-author: hffqyd
+created: 20230302011710789
+delivery: Server-side Script
+description: Web server for saving and uploading
+method: save
+modified: 20230302055929311
+tags: Android Chrome Firefox [[Internet Explorer]] Linux Mac Opera Safari Saving Windows iOS Edge
+title: Saving via a Minimal Web Server
+type: text/vnd.tiddlywiki
+
+A local server for TiddlyWiki5 that saves and backups wikis, inspired by
+[[tw5-server.rb | https://gist.github.com/jimfoltz/ee791c1bdd30ce137bc23cce826096da]].
+
+tw5-server provides features of:
+
+* Server for TiddlyWiki5, as well as other files (e.g. images used in TW5 `[img[images/*.png]]`);
+* Easy to save wiki via browsers;
+* Backup wiki in compress format (.gz), to save disk space;
+* Auto clean backups: keep one newest per previous month, keep all backups in current month.
+* Upload files/images to server, for use in tiddlywiki as external links.
+* Offer binary executable for Linux, macos and windows.
+
+Download executable script and binary at the github.com [[tw5-server|https://github.com/hffqyd/tw5-server]].
+
+! Usage
+
+```bash
+# python script:
+python tw5-server.py -p 8000 -d ./ -b backup_dir
+
+# binary file:
+tw5server -a:192.168.0.10 -p:8000 -d:./ -b:backup
+
+-h usage help
+-a address, defautl localhost
+-p port, default 8000
+-d directory to servering, default `current dir`
+-b backup directory name, default `backup`
+-l log saving messages to stdout
+
+Backups auto-clean strategy:
+Keep all backups in current month, keep only the newest one for previous months.
+```
+
+In Unix/Linux, just excute `./tw5-server.py` (with `chmod +x tw5-server.py`).
+
+Then go to http://localhost:8000 (or other address:port specified in command) in your web browser, and click on your wiki html file.
From 1946f173a9afcd17d031cfa3931bc3b682aaab5e Mon Sep 17 00:00:00 2001
From: yaisog
Date: Sat, 4 Mar 2023 12:48:14 +0100
Subject: [PATCH 33/83] Update ActionListopsWidget documentation including
notes on de-duplication (#7301)
* Changed headings under Content
Made them H2 and changed the wording a bit.
* Move the list of filters to another tiddler
There is a tiddler for Extended Listops Filters, and the list should go there, so that the Widget tiddler does not get too overcrowded.
* Rework comparison to ActionSetFieldWidget
* Add notes on de-duplication
* Update link to Extended Listops Filters
* Updated link to Extended Listops Filters
* Update link to Extended Listops Filters
Duh. This was the most important one.
* Remove repeated links to widgets within one section
* Re-create original tiddler with a redirect notice
* Excised the examples into a separate tiddler
Also created an "examples" subdirectory under tw5.com/tiddlers/widgets.
---
.../learning/Introduction to Lists.tid | 2 +-
.../tiddlers/releasenotes/Release 5.1.16.tid | 2 +-
.../tiddlers/widgets/ActionListopsWidget.tid | 139 +++++-------------
.../widgets/Extended Listops Filters.tid | 138 +++++++++++++++++
.../widgets/The Extended Listops Filters.tid | 115 +--------------
.../ActionListopsWidget (Examples).tid | 81 ++++++++++
6 files changed, 258 insertions(+), 219 deletions(-)
create mode 100644 editions/tw5.com/tiddlers/widgets/Extended Listops Filters.tid
create mode 100644 editions/tw5.com/tiddlers/widgets/examples/ActionListopsWidget (Examples).tid
diff --git a/editions/tw5.com/tiddlers/learning/Introduction to Lists.tid b/editions/tw5.com/tiddlers/learning/Introduction to Lists.tid
index dd2a0269c..0cc883e47 100644
--- a/editions/tw5.com/tiddlers/learning/Introduction to Lists.tid
+++ b/editions/tw5.com/tiddlers/learning/Introduction to Lists.tid
@@ -6,7 +6,7 @@ type: text/vnd.tiddlywiki
Making lists of items plays a central role in working with TiddlyWiki. The following is a brief run-through of some of the more common techniques.
-~TiddlyWiki [[uses|The Extended Listops Filters]] lists [[internally|ListField]] for many purposes so the word can have several meanings. Here we are concerned with displaying sequences of items, but not necessarily presented as a conventional bullet list.
+~TiddlyWiki [[uses|Extended Listops Filters]] lists [[internally|ListField]] for many purposes so the word can have several meanings. Here we are concerned with displaying sequences of items, but not necessarily presented as a conventional bullet list.
! Manually Typed Lists
diff --git a/editions/tw5.com/tiddlers/releasenotes/Release 5.1.16.tid b/editions/tw5.com/tiddlers/releasenotes/Release 5.1.16.tid
index 03754dbb6..90c62c110 100644
--- a/editions/tw5.com/tiddlers/releasenotes/Release 5.1.16.tid
+++ b/editions/tw5.com/tiddlers/releasenotes/Release 5.1.16.tid
@@ -112,7 +112,7 @@ Prompted by the [[General Data Protection Regulation (GDPR)|https://en.wikipedia
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/pull/3093]] problem with crash when dragging over TiddlyWiki on some browsers
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/pull/3079]] issue with new journal button
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/pull/3164]] problem with ''filter'' and ''value'' attributes of SetWidget
-* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/pull/3190]] problem with numeric operands in the [[The Extended Listops Filters]]
+* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/pull/3190]] problem with numeric operands in the [[Extended Listops Filters]]
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/df1f7e9798b5f6c3d2c3fd82e438cbc9713ade04]] problem with "put" saver and 412 return codes
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/pull/3048]] problem with variable references in field values in the edit template
* [[Extended|https://github.com/Jermolene/TiddlyWiki5/pull/3219]] behaviour of list-after field so that the tiddler is placed at the end of the list if the list-after field is present but empty
diff --git a/editions/tw5.com/tiddlers/widgets/ActionListopsWidget.tid b/editions/tw5.com/tiddlers/widgets/ActionListopsWidget.tid
index 4773e8405..0762f14e0 100644
--- a/editions/tw5.com/tiddlers/widgets/ActionListopsWidget.tid
+++ b/editions/tw5.com/tiddlers/widgets/ActionListopsWidget.tid
@@ -1,25 +1,11 @@
caption: action-listops
created: 20141025120850184
-list: efg hlm pqr
-modified: 20211115091121133
+modified: 20230301183438774
myfield:
-revision: 0
tags: ActionWidgets Widgets
title: ActionListopsWidget
type: text/vnd.tiddlywiki
-\define .operator-rows(filter)
-<$list filter="$filter$">
-\end
-
! Introduction
The ''action-listops'' widget is an [[action widget|ActionWidgets]] that manipulates user lists in any field or data index. ActionWidgets are used within triggering widgets such as the ButtonWidget.
@@ -34,9 +20,9 @@ The ''action-listops'' widget is invisible. Any content within it is ignored.
|$index |Optional index of a property in a [[data tiddler|DataTiddlers]] index to be manipulated as a list |
|$filter |An optional filter expression, the output of which will be saved to the field/index being manipulated |
|$subfilter |An optional subfilter expression, which takes the list being manipulated as input, and saves the modified list back to the field/index being manipulated |
-|$tags |An optional subfilter expression, which takes the 'tags' field of the target tiddler as input, and saves the modified list of tags back to the 'tags' field |
+|$tags |An optional subfilter expression, which takes the <<.field tags>> field of the target tiddler as input, and saves the modified list of tags back to the <<.field tags>> field |
-! $filter vs. $subfilter
+!! Using $filter or $subfilter
Standalone use of the `$subfilter` attribute can be replaced by using a (more complicated) `$filter` attribute value.
@@ -49,12 +35,12 @@ For example, the items "abc" and "123" can be appended to the field `myfield` us
The same can be achieved using the `$filter` attribute and prepending the [[Filter Run]] `[all[current]get[myfield]enlist-input[]]` to the [[Filter Expression]]:
```
-<$action-listops $field="myfield" $filter="[all[current]get[myfield]enlist-input[]] abc 123"/>
+<$action-listops $field="myfield" $filter="[enlist{!!myfield}] abc 123"/>
```
The short form is more convenient, but the long form is useful for live-debugging complicated `$subfilter` values using the filter tab of [[$:/AdvancedSearch]]. By using [[$:/AdvancedSearch]], the [[Filter Expression]] can be tested before using ''action-listops'' to modify actual tiddler fields. For this use case, the `all[current]` portion of the expression needs to be changed to select the proper test tiddler.
-! $tags vs. $field + $subfilter
+!! Using $tags or $subfilter
[[Tagging]] is implemented using a tiddler's 'tags' field, so appending the tags "abc" and "123" using the `$tags` attribute like this:
@@ -68,110 +54,53 @@ is mostly equivalent to using `$subfilter` along with "tags" for the value of `$
<$action-listops $field="tags" $subfilter="abc 123"/>
```
-! $action-listops widget vs. $action-setfield widget
+!! Comparison to [[ActionSetFieldWidget]]
-The ActionSetFieldWidget replaces a field's value using `$field`/`$value` attributes. A single ActionSetFieldWidget can be used to set any number of fields by using attributes not starting with $.
+In general, ActionSetFieldWidget is better for setting multiple fields at once and for replacing the value of a field, which can also be a list. The ActionListopsWidget is better for modifying a list field based on the existing list and for using a [[Filter Expression]] to derive the value of the field.
-The ActionListopsWidget replaces or modifies a single field's value. The new value is generated using filters.
+The ~ActionSetFieldWidget sets the value of a field using `$field` and `$value` attribute pairs or attributes that do not start with a `$`. A single ~ActionSetFieldWidget can be used to set any number of fields of a single tiddler.
-The following two examples are functionally equivalent:
+The ~ActionListopsWidget replaces or modifies a single field's value using filter expressions.
+
+The following widgets are functionally equivalent:
```
<$action-setfield $field="myfield" $value="abc 123"/>
-```
-
-```
+<$action-setfield myfield="abc 123"/>
<$action-listops $field="myfield" $filter="abc 123"/>
```
+Note that <<.value "abc 123">> in the first two cases is a literal string that is assigned to the field <<.field myfield>>, but in the third case a filter expression which evaluates to the same string.
-In general, ActionSetFieldWidget is better for setting multiple fields at once and for replacing a field's value. The ActionListopsWidget is better for modifying a field based on the field's existing value and for using a [[Filter Expression]] to derive the value.
+!! Extended Filter Operators
-! Extended Filter Operators
+A number of [[Extended Listops Filters]] are necessary for the manipulation of lists. These operators have been designed primarily for use in subfilter expressions whereby the modified current list is returned in place of the current list.
-A number of [[extended filter operators|The Extended Listops Filters]] are necessary for the manipulation of lists. These operators have been designed primarily for use in subfilter expressions whereby the modified current list is returned in place of the current list.
+!! Notes on de-duplication
-
+In some cases, there may occur unexpected de-duplication of lists.
-! Examples
+!!! Assignments to the <<.field list>> field
-In this example we shall populate and then clear a list in an ordinary field (myfield) of this tiddler (the default.)
+When assigning filter results to the <<.field list>> field (default), the generated list is automatically de-duplicated, so
+
+```
+<$action-listops $filter="[[1]] :and[[1]]"/>
+```
+will result in the <<.field list>> field of the current tiddler containing the string <<.value 1>>, but not <<.value "1 1">>.
+
+!!! Input to the subfilter expression
+
+The input to the subfilter expression in the `$subfilter` attribute is also de-duplicated. If you rely on lists containing duplicates, consider using this alternative using the `$filter` attribute:
<$macrocall $name='wikitext-example-without-html'
src="""<$button>
-<$action-listops $field="myfield" $subfilter="efg hlm pqr"/>
-Populate 'myfield'
-$button>
-<$button>
-<$action-listops $field="myfield" $subfilter="abc xyz"/>
-Append More Items
-$button>
-<$button>
-<$action-listops $field="myfield" $subfilter="-abc -hlm"/>
-Remove Items
-$button>
-<$button>
-<$action-listops $field="myfield" $filter="[[]]"/>
-Clear 'myfield'
+<$action-listops $field="myfield" $filter="[enlist:raw{!!myfield}] :all[[abc]]" />
+Add 'abc' to 'myfield'
$button>
-<$list filter="[list[!!myfield]]">
+<$list filter="[enlist:raw{!!myfield}]" template="$:/core/ui/ListItemTemplate" />
+"""/>
+The [[enlist Operator]] with `raw` suffix will enlist the list saved in <<.field myfield>> of the current tiddler without de-duplication, while e.g. the [[list Operator]] will always de-duplicate. The widget then adds the item <<.value abc>> -- whether or not it is already included in the list -- and replaces the original list in <<.field myfield>>.
-$list>"""/>
----
-In this example we shall append and remove items from a list in an ordinary field (myfield) of this tiddler (the default) and sort the resultant list. We shall then remove some of the appended items and sort the resulting list in reverse order.
-
-<$macrocall $name='wikitext-example-without-html'
-src="""<$button>
-<$action-listops $field="myfield" $subfilter="-efg ijk xyz [[this is a title]] +[sort[]]"/>
-Mangle List
-$button>
-<$button>
-<$action-listops $field="myfield" $subfilter="-xyz -[[this is a title]] +[!sort[]]"/>
-Unmangle List
-$button>
-
-<$list filter="[list[!!myfield]]">
-
-$list>"""/>
-
----
-In this example we shall append a few tags to the 'tags' field of this tiddler (the default.) We shall then remove some of the appended tags.
-
-<$macrocall $name='wikitext-example-without-html'
-src="""<$button>
-<$action-listops $tags="+[append{Days of the Week!!short}] $:/tag1 $:/tag2 $:/tag3"/>
-Populate 'tags'
-$button>
-<$button>
-<$action-listops $tags="+[!remove:2{!!tags}]"/>
-Remove Last Two Tags
-$button>
-<$button>
-<$action-listops $tags="+[!prefix[$:/]]"/>
-Remove System Tags
-$button>
-<$button>
-<$action-listops $tags="-Mon -Tue"/>
-Remove Mon and Tue
-$button>
-<$button>
-<$action-listops $tags="+[prefix[$:/]] ActionWidgets Widgets"/>
-Remove User Tags
-$button>
-<$button>
-<$action-listops $tags="+[[]] ActionWidgets Widgets"/>
-Clear Tags
-$button>
-
-<$list filter="[list[!!tags]]">
-
-$list>"""/>
+! [[Examples|ActionListopsWidget (Examples)]]
diff --git a/editions/tw5.com/tiddlers/widgets/Extended Listops Filters.tid b/editions/tw5.com/tiddlers/widgets/Extended Listops Filters.tid
new file mode 100644
index 000000000..4d11b4590
--- /dev/null
+++ b/editions/tw5.com/tiddlers/widgets/Extended Listops Filters.tid
@@ -0,0 +1,138 @@
+created: 20151014170727812
+days: Fri Wed Mon Tue
+dofwks: Mon Tue Wed Thu Fri Sat Sun
+item1: six
+item2: seven
+item3: eight
+list: Yesterday Today Tomorrow
+marker: Thursday
+modified: 20230227175501965
+myfield: Monday Tuesday [[Middle of the Week]] Thursday Friday Saturday Sunday
+numbers: 1 2 3 4 five 6 7 8 9
+tags: Filters
+title: Extended Listops Filters
+
+\define .operator-rows(filter)
+<$list filter="$filter$">
+\end
+
+! Introduction
+
+A number of filters are used to manipulate lists.
+
+Some filters are designed to move items from the tail of the list and insert them at specified locations in the list, e.g. [[putafter|putafter Operator]] or [[putbefore|putbefore Operator]]. Items are often appended to the list before using these filters. In general, these filters accept a suffix specifying the number of items to move (default to 1.)
+
+Some filters are designed to either add or remove from the list, a selected range of items from an array, e.g. [[append|append Operator]] or [[remove|remove Operator]]. These filters are best used with a reference to an array, stored in a field or data index elsewhere in the wiki (they may be used with a simple list of items, provided the items do not include white space.) In general, these filters accept a suffix specifying the number of items to move (default to All.)
+
+
+
+! Examples
+
+In this example we shall populate the '~DataIndex' index of the tiddler '~MyData' with the names of the days of the week, then clear this list.
+
+<$macrocall $name='wikitext-example-without-html'
+src="""<$button>
+<$action-listops $tiddler="ListopsData" $index="DataIndex" $filter="[list[Days of the Week]]"/>
+Get days-of-the-week
+$button>
+<$button>
+<$action-listops $tiddler="ListopsData" $index="DataIndex" $filter="[[]]"/>
+Clear
+$button>
+
+{{ListopsData}}"""/>
+
+---
+In this example we shall slice the populated list from the 'DaysOfTheWeek' index of the tiddler '~MyData' in order to insert items before and after a marker item (Wednesday) that are first appended to the list.
+
+<$macrocall $name='wikitext-example-without-html'
+src="""<$button>
+<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="one two +[putbefore:2[Wednesday]]"/>
+Put 2 Items Before Wednesday
+$button>
+<$button>
+<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="four five +[putafter:2[Wednesday]] three +[putbefore[Wednesday]]"/>
+Put One Item Before & Two Items After Wednesday
+$button>
+
+{{ListopsData}}"""/>
+
+---
+In this example we shall slice the populated list from the 'DaysOfTheWeek' index of the tiddler '~MyData' in order to replace the marker item (Wednesday) with items which are first appended to the list. We shall then move 3 items to the head of the list which have first been appended to the list from referenced fields.
+
+<$macrocall $name='wikitext-example-without-html'
+src="""<$button>
+<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="[[---o]] [[o---]] +[replace:2{!!marker}]"/>
+Replace '!!marker' with 2 Items
+$button>
+<$button>
+<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="[{!!item1}] [{!!item2}] [{!!item3}] +[putfirst:3[]]"/>
+Put 3 Items First
+$button>
+
+{{ListopsData}}"""/>
+
+---
+In this example we shall slice the populated list from the 'DaysOfTheWeek' index of the tiddler '~MyData' in order to append to the truncated list, items from a referenced field. We shall then remove the first two of the items added.
+
+<$macrocall $name='wikitext-example-without-html'
+src="""|list: |<$view field="list"/> |
+
+<$button>
+<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="+[allbefore:include[Wednesday]] +[prepend{!!list}]"/>
+Prepend '!!list' to items before 'Wednesday'
+$button>
+<$button>
+<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="+[remove:2{!!list}]"/>
+Remove first two items in '!!list' from current list
+$button>
+<$button>
+<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="+[!remove:1{!!list}]"/>
+Remove last item in '!!list' from current list
+$button>
+
+{{ListopsData}}"""/>
+
+---
+In this example we shall populate the list with numbers, then move items one by one from the head to the tail and from the tail to the head (best seen by clicking the lower buttons several times.)
+
+This example illustrates that the append[] and prepend[] operators do not enforce unique instances of an item and that, with the next run, any duplicates are removed.
+
+<$macrocall $name='wikitext-example-without-html'
+src="""<$button>
+<$action-listops $tiddler="ListopsData" $index="DataIndex" $filter="[[]]" $subfilter="+[append:3{!!numbers}]"/>
+Setup some numbers
+$button>
+<$button>
+<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="+[!append:6{!!numbers}]"/>
+Append more numbers
+$button>
+
+<$button>
+<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="+[putfirst:2[]]"/>
+Move last 2 items to the head
+$button>
+<$button>
+<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="+[putlast[]]"/>
+Move the head to the last item
+$button>
+
+{{ListopsData}}"""/>
diff --git a/editions/tw5.com/tiddlers/widgets/The Extended Listops Filters.tid b/editions/tw5.com/tiddlers/widgets/The Extended Listops Filters.tid
index 7e51f4c8c..86b821deb 100644
--- a/editions/tw5.com/tiddlers/widgets/The Extended Listops Filters.tid
+++ b/editions/tw5.com/tiddlers/widgets/The Extended Listops Filters.tid
@@ -1,114 +1,5 @@
-created: 20151014170727812
-days: Fri Wed Mon Tue
-dofwks: Mon Tue Wed Thu Fri Sat Sun
-item1: six
-item2: seven
-item3: eight
-list: Yesterday Today Tomorrow
-marker: Thursday
-modified: 20211114011103356
-myfield: Monday Tuesday [[Middle of the Week]] Thursday Friday Saturday Sunday
-numbers: 1 2 3 4 five 6 7 8 9
-tags: Filters
+created: 20230301172832597
+modified: 20230301172832597
title: The Extended Listops Filters
-! Introduction
-
-A number of extended filters are necessary to manipulate lists.
-
-The first set of filters are designed to move items from the tail of the list and insert them at specified locations in the list. Items are often appended to the list before using these filters. In general, these filters accept a suffix specifying the number of items to move (default to 1.)
-
-A second set of filters are designed to either add or remove from the list, a selected range of items from an array. These filters are best used with a reference to an array, stored in a field or data index elsewhere in the wiki (they may be used with a simple list of items, provided the items do not include white space.) In general, these filters accept a suffix specifying the number of items to move (default to All.)
-
-! Examples
-
-In this example we shall populate the '~DataIndex' index of the tiddler '~MyData' with the names of the days of the week, then clear this list.
-
-<$macrocall $name='wikitext-example-without-html'
-src="""<$button>
-<$action-listops $tiddler="ListopsData" $index="DataIndex" $filter="[list[Days of the Week]]"/>
-Get days-of-the-week
-$button>
-<$button>
-<$action-listops $tiddler="ListopsData" $index="DataIndex" $filter="[[]]"/>
-Clear
-$button>
-
-{{ListopsData}}"""/>
-
----
-In this example we shall slice the populated list from the 'DaysOfTheWeek' index of the tiddler '~MyData' in order to insert items before and after a marker item (Wednesday) that are first appended to the list.
-
-<$macrocall $name='wikitext-example-without-html'
-src="""<$button>
-<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="one two +[putbefore:2[Wednesday]]"/>
-Put 2 Items Before Wednesday
-$button>
-<$button>
-<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="four five +[putafter:2[Wednesday]] three +[putbefore[Wednesday]]"/>
-Put One Item Before & Two Items After Wednesday
-$button>
-
-{{ListopsData}}"""/>
-
----
-In this example we shall slice the populated list from the 'DaysOfTheWeek' index of the tiddler '~MyData' in order to replace the marker item (Wednesday) with items which are first appended to the list. We shall then move 3 items to the head of the list which have first been appended to the list from referenced fields.
-
-<$macrocall $name='wikitext-example-without-html'
-src="""<$button>
-<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="[[---o]] [[o---]] +[replace:2{!!marker}]"/>
-Replace '!!marker' with 2 Items
-$button>
-<$button>
-<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="[{!!item1}] [{!!item2}] [{!!item3}] +[putfirst:3[]]"/>
-Put 3 Items First
-$button>
-
-{{ListopsData}}"""/>
-
----
-In this example we shall slice the populated list from the 'DaysOfTheWeek' index of the tiddler '~MyData' in order to append to the truncated list, items from a referenced field. We shall then remove the first two of the items added.
-
-<$macrocall $name='wikitext-example-without-html'
-src="""|list: |<$view field="list"/> |
-
-<$button>
-<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="+[allbefore:include[Wednesday]] +[prepend{!!list}]"/>
-Prepend '!!list' to items before 'Wednesday'
-$button>
-<$button>
-<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="+[remove:2{!!list}]"/>
-Remove first two items in '!!list' from current list
-$button>
-<$button>
-<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="+[!remove:1{!!list}]"/>
-Remove last item in '!!list' from current list
-$button>
-
-{{ListopsData}}"""/>
-
----
-In this example we shall populate the list with numbers, then move items one by one from the head to the tail and from the tail to the head (best seen by clicking the lower buttons several times.)
-
-This example illustrates that the append[] and prepend[] operators do not enforce unique instances of an item and that, with the next run, any duplicates are removed.
-
-<$macrocall $name='wikitext-example-without-html'
-src="""<$button>
-<$action-listops $tiddler="ListopsData" $index="DataIndex" $filter="[[]]" $subfilter="+[append:3{!!numbers}]"/>
-Setup some numbers
-$button>
-<$button>
-<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="+[!append:6{!!numbers}]"/>
-Append more numbers
-$button>
-
-<$button>
-<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="+[putfirst:2[]]"/>
-Move last 2 items to the head
-$button>
-<$button>
-<$action-listops $tiddler="ListopsData" $index="DataIndex" $subfilter="+[putlast[]]"/>
-Move the head to the last item
-$button>
-
-{{ListopsData}}"""/>
+See [[Extended Listops Filters]]
\ No newline at end of file
diff --git a/editions/tw5.com/tiddlers/widgets/examples/ActionListopsWidget (Examples).tid b/editions/tw5.com/tiddlers/widgets/examples/ActionListopsWidget (Examples).tid
new file mode 100644
index 000000000..8f8fe8a87
--- /dev/null
+++ b/editions/tw5.com/tiddlers/widgets/examples/ActionListopsWidget (Examples).tid
@@ -0,0 +1,81 @@
+created: 20230301174431218
+list: efg hlm pqr
+modified: 20230301174431218
+myfield:
+revision: 0
+title: ActionListopsWidget (Examples)
+type: text/vnd.tiddlywiki
+
+In this example we shall populate and then clear a list in an ordinary field (myfield) of this tiddler (the default).
+
+<$macrocall $name='wikitext-example-without-html'
+src="""<$button>
+<$action-listops $field="myfield" $filter="efg hlm pqr"/>
+Populate 'myfield'
+$button>
+<$button>
+<$action-listops $field="myfield" $subfilter="abc xyz"/>
+Append More Items
+$button>
+<$button>
+<$action-listops $field="myfield" $subfilter="-abc -hlm"/>
+Remove Items
+$button>
+<$button>
+<$action-listops $field="myfield" $filter="[[]]"/>
+Clear 'myfield'
+$button>
+
+<$list filter="[list[!!myfield]]">
+
+$list>"""/>
+
+---
+In this example we shall append and remove items from a list in an ordinary field (myfield) of this tiddler (the default) and sort the resultant list. We shall then remove some of the appended items and sort the resulting list in reverse order.
+
+<$macrocall $name='wikitext-example-without-html'
+src="""<$button>
+<$action-listops $field="myfield" $subfilter="-efg ijk xyz [[this is a title]] +[sort[]]"/>
+Mangle List
+$button>
+<$button>
+<$action-listops $field="myfield" $subfilter="-xyz -[[this is a title]] +[!sort[]]"/>
+Unmangle List
+$button>
+
+<$list filter="[list[!!myfield]]">
+
+$list>"""/>
+
+---
+In this example we shall append a few tags to the 'tags' field of this tiddler (the default). We shall then remove some of the appended tags.
+
+<$macrocall $name='wikitext-example-without-html'
+src="""<$button>
+<$action-listops $tags="+[append{Days of the Week!!short}] $:/tag1 $:/tag2 $:/tag3"/>
+Populate 'tags'
+$button>
+<$button>
+<$action-listops $tags="+[!remove:2{!!tags}]"/>
+Remove Last Two Tags
+$button>
+<$button>
+<$action-listops $tags="+[!prefix[$:/]]"/>
+Remove System Tags
+$button>
+<$button>
+<$action-listops $tags="-Mon -Tue"/>
+Remove Mon and Tue
+$button>
+<$button>
+<$action-listops $tags="+[prefix[$:/]] ActionWidgets Widgets"/>
+Remove User Tags
+$button>
+<$button>
+<$action-listops $tags="+[[]] ActionWidgets Widgets"/>
+Clear Tags
+$button>
+
+<$list filter="[list[!!tags]]">
+
+$list>"""/>
From 11ffc83493a4ef2d815dbe50662010bbc50be461 Mon Sep 17 00:00:00 2001
From: Jeremy Ruston
Date: Sat, 4 Mar 2023 21:16:26 +0000
Subject: [PATCH 34/83] Introduce new levenshtein, makepatches, applypatches
operators (#7290)
* Initial Commit
* Fix crash with invalid patches
See https://github.com/Jermolene/TiddlyWiki5/pull/7290#issuecomment-1453155311
Thanks @yaisog
* Add words and lines options to makepatches (#7326)
* Prevent infinite loop for single-word texts (#7327)
* Add docs and examples for the new operators (#7328)
* Create makepatches Operator.tid
* Improve wording
* Doc and examples for the new operators
---------
Co-authored-by: yaisog
---
core/modules/filters/strings.js | 109 +++++++++++++++++-
.../tests/data/filters/DiffMergePatch1.tid | 28 +++++
.../tests/data/filters/DiffMergePatch2.tid | 25 ++++
.../tests/data/filters/DiffMergePatch3.tid | 22 ++++
editions/test/tiddlers/tests/test-filters.js | 14 +++
.../filters/applypatches Operator.tid | 15 +++
.../tiddlers/filters/examples/Hamlet.tid | 11 ++
.../levenshtein Operator (Examples).tid | 21 ++++
...s and applypatches Operator (Examples).tid | 43 +++++++
.../tiddlers/filters/levenshtein Operator.tid | 17 +++
.../tiddlers/filters/makepatches Operator.tid | 23 ++++
.../tw5.com/tiddlers/system/doc-styles.tid | 4 +
12 files changed, 331 insertions(+), 1 deletion(-)
create mode 100644 editions/test/tiddlers/tests/data/filters/DiffMergePatch1.tid
create mode 100644 editions/test/tiddlers/tests/data/filters/DiffMergePatch2.tid
create mode 100644 editions/test/tiddlers/tests/data/filters/DiffMergePatch3.tid
create mode 100644 editions/tw5.com/tiddlers/filters/applypatches Operator.tid
create mode 100644 editions/tw5.com/tiddlers/filters/examples/Hamlet.tid
create mode 100644 editions/tw5.com/tiddlers/filters/examples/levenshtein Operator (Examples).tid
create mode 100644 editions/tw5.com/tiddlers/filters/examples/makepatches and applypatches Operator (Examples).tid
create mode 100644 editions/tw5.com/tiddlers/filters/levenshtein Operator.tid
create mode 100644 editions/tw5.com/tiddlers/filters/makepatches Operator.tid
diff --git a/core/modules/filters/strings.js b/core/modules/filters/strings.js
index 60a36265d..4a3c7c170 100644
--- a/core/modules/filters/strings.js
+++ b/core/modules/filters/strings.js
@@ -74,6 +74,113 @@ exports.join = makeStringReducingOperator(
},null
);
+var dmp = require("$:/core/modules/utils/diff-match-patch/diff_match_patch.js");
+
+exports.levenshtein = makeStringBinaryOperator(
+ function(a,b) {
+ var dmpObject = new dmp.diff_match_patch(),
+ diffs = dmpObject.diff_main(a,b);
+ return [dmpObject.diff_levenshtein(diffs) + ""];
+ }
+);
+
+// these two functions are adapted from https://github.com/google/diff-match-patch/wiki/Line-or-Word-Diffs
+function diffLineWordMode(text1,text2,mode) {
+ var dmpObject = new dmp.diff_match_patch();
+ var a = diffPartsToChars(text1,text2,mode);
+ var lineText1 = a.chars1;
+ var lineText2 = a.chars2;
+ var lineArray = a.lineArray;
+ var diffs = dmpObject.diff_main(lineText1,lineText2,false);
+ dmpObject.diff_charsToLines_(diffs,lineArray);
+ return diffs;
+}
+
+function diffPartsToChars(text1,text2,mode) {
+ var lineArray = [];
+ var lineHash = {};
+ lineArray[0] = '';
+
+ function diff_linesToPartsMunge_(text,mode) {
+ var chars = '';
+ var lineStart = 0;
+ var lineEnd = -1;
+ var lineArrayLength = lineArray.length,
+ regexpResult;
+ const searchRegexp = /\W+/g;
+ while(lineEnd < text.length - 1) {
+ if(mode === "words") {
+ regexpResult = searchRegexp.exec(text);
+ lineEnd = searchRegexp.lastIndex;
+ if(regexpResult === null) {
+ lineEnd = text.length;
+ }
+ lineEnd = --lineEnd;
+ } else {
+ lineEnd = text.indexOf('\n', lineStart);
+ if(lineEnd == -1) {
+ lineEnd = text.length - 1;
+ }
+ }
+ var line = text.substring(lineStart, lineEnd + 1);
+
+ if(lineHash.hasOwnProperty ? lineHash.hasOwnProperty(line) : (lineHash[line] !== undefined)) {
+ chars += String.fromCharCode(lineHash[line]);
+ } else {
+ if (lineArrayLength == maxLines) {
+ line = text.substring(lineStart);
+ lineEnd = text.length;
+ }
+ chars += String.fromCharCode(lineArrayLength);
+ lineHash[line] = lineArrayLength;
+ lineArray[lineArrayLength++] = line;
+ }
+ lineStart = lineEnd + 1;
+ }
+ return chars;
+ }
+ var maxLines = 40000;
+ var chars1 = diff_linesToPartsMunge_(text1,mode);
+ maxLines = 65535;
+ var chars2 = diff_linesToPartsMunge_(text2,mode);
+ return {chars1: chars1, chars2: chars2, lineArray: lineArray};
+};
+
+exports.makepatches = function(source,operator,options) {
+ var dmpObject = new dmp.diff_match_patch(),
+ suffix = operator.suffix || "",
+ result = [];
+
+ source(function(tiddler,title) {
+ var diffs, patches;
+ if(suffix === "lines" || suffix === "words") {
+ diffs = diffLineWordMode(title,operator.operand,suffix);
+ patches = dmpObject.patch_make(title,diffs);
+ } else {
+ patches = dmpObject.patch_make(title,operator.operand);
+ }
+ Array.prototype.push.apply(result,[dmpObject.patch_toText(patches)]);
+ });
+
+ return result;
+};
+
+exports.applypatches = makeStringBinaryOperator(
+ function(a,b) {
+ var dmpObject = new dmp.diff_match_patch(),
+ patches;
+ try {
+ patches = dmpObject.patch_fromText(b);
+ } catch(e) {
+ }
+ if(patches) {
+ return [dmpObject.patch_apply(patches,a)[0]];
+ } else {
+ return [a];
+ }
+ }
+);
+
function makeStringBinaryOperator(fnCalc) {
return function(source,operator,options) {
var result = [];
@@ -184,4 +291,4 @@ exports.charcode = function(source,operator,options) {
return [chars.join("")];
};
-})();
+})();
\ No newline at end of file
diff --git a/editions/test/tiddlers/tests/data/filters/DiffMergePatch1.tid b/editions/test/tiddlers/tests/data/filters/DiffMergePatch1.tid
new file mode 100644
index 000000000..e6e519df5
--- /dev/null
+++ b/editions/test/tiddlers/tests/data/filters/DiffMergePatch1.tid
@@ -0,0 +1,28 @@
+title: Filters/DiffMergePatch1
+description: Tests for diff-merge-patch derived operators
+type: text/vnd.tiddlywiki-multiple
+tags: [[$:/tags/wiki-test-spec]]
+
+title: Output
+
+\whitespace trim
+\define text1()
+the cat sat on the mat
+\end
+
+\define text2()
+the hat saw in every category
+\end
+
+<$text text={{{ [makepatches] }}}/>
++
+title: ExpectedResult
+
+
@@ -1,22 +1,29 @@
+ the
+-c
++h
+ at sa
+-t on the mat
++w in every category
+
\ No newline at end of file
diff --git a/editions/test/tiddlers/tests/data/filters/DiffMergePatch2.tid b/editions/test/tiddlers/tests/data/filters/DiffMergePatch2.tid
new file mode 100644
index 000000000..1fa355573
--- /dev/null
+++ b/editions/test/tiddlers/tests/data/filters/DiffMergePatch2.tid
@@ -0,0 +1,25 @@
+title: Filters/DiffMergePatch2
+description: Tests for diff-merge-patch derived operators
+type: text/vnd.tiddlywiki-multiple
+tags: [[$:/tags/wiki-test-spec]]
+
+title: Output
+
+\whitespace trim
+\define text1()
+the cat sat on the mat
+\end
+
+\define text2()
+the hat saw in every category
+\end
+
+<$let patches={{{ [makepatches] }}}>
+
+<$text text={{{ [applypatches] }}}/>
+
+$let>
++
+title: ExpectedResult
+
+the hat saw in every category
\ No newline at end of file
diff --git a/editions/test/tiddlers/tests/data/filters/DiffMergePatch3.tid b/editions/test/tiddlers/tests/data/filters/DiffMergePatch3.tid
new file mode 100644
index 000000000..87d98e890
--- /dev/null
+++ b/editions/test/tiddlers/tests/data/filters/DiffMergePatch3.tid
@@ -0,0 +1,22 @@
+title: Filters/DiffMergePatch3
+description: Tests for diff-merge-patch derived operators
+type: text/vnd.tiddlywiki-multiple
+tags: [[$:/tags/wiki-test-spec]]
+
+title: Output
+
+\whitespace trim
+\define text1()
+the cat sat on the mat
+\end
+
+\define patches()
+**NOT A VALID PATCH**
+\end
+
+<$text text={{{ [applypatches] }}}/>
+
++
+title: ExpectedResult
+
+the cat sat on the mat
\ No newline at end of file
diff --git a/editions/test/tiddlers/tests/test-filters.js b/editions/test/tiddlers/tests/test-filters.js
index 2e5d45d22..2a9080de5 100644
--- a/editions/test/tiddlers/tests/test-filters.js
+++ b/editions/test/tiddlers/tests/test-filters.js
@@ -1071,6 +1071,20 @@ Tests the filtering mechanism.
expect(wiki.filterTiddlers("[charcode[9],[10]]").join(" ")).toBe(String.fromCharCode(9) + String.fromCharCode(10));
expect(wiki.filterTiddlers("[charcode[]]").join(" ")).toBe("");
});
+
+ it("should handle the levenshtein operator", function() {
+ expect(wiki.filterTiddlers("[[apple]levenshtein[apple]]").join(" ")).toBe("0");
+ expect(wiki.filterTiddlers("[[apple]levenshtein[banana]]").join(" ")).toBe("9");
+ expect(wiki.filterTiddlers("[[representation]levenshtein[misreprehensionisation]]").join(" ")).toBe("10");
+ expect(wiki.filterTiddlers("[[the cat sat on the mat]levenshtein[the hat saw in every category]]").join(" ")).toBe("13");
+ });
+
+ it("should handle the makepatches operator", function() {
+ expect(wiki.filterTiddlers("[[apple]makepatches[apple]]").join(" ")).toBe("");
+ expect(wiki.filterTiddlers("[[apple]makepatches[banana]]").join(" ")).toBe("@@ -1,5 +1,6 @@\n-apple\n+banana\n");
+ expect(wiki.filterTiddlers("[[representation]makepatches[misreprehensionisation]]").join(" ")).toBe("@@ -1,13 +1,21 @@\n+mis\n repre\n-sent\n+hensionis\n atio\n");
+ expect(wiki.filterTiddlers("[[the cat sat on the mat]makepatches[the hat saw in every category]]").join(" ")).toBe("@@ -1,22 +1,29 @@\n the \n-c\n+h\n at sa\n-t on the mat\n+w in every category\n");
+ });
it("should parse filter variable parameters", function(){
expect($tw.utils.parseFilterVariable("currentTiddler")).toEqual(
diff --git a/editions/tw5.com/tiddlers/filters/applypatches Operator.tid b/editions/tw5.com/tiddlers/filters/applypatches Operator.tid
new file mode 100644
index 000000000..93bb0258c
--- /dev/null
+++ b/editions/tw5.com/tiddlers/filters/applypatches Operator.tid
@@ -0,0 +1,15 @@
+caption: applypatches
+created: 20230304154824762
+modified: 20230304154826621
+op-purpose: applies a set of patches to transform the input
+op-input: a [[selection of titles|Title Selection]]
+op-parameter: a string containing patches from the [[makepatches Operator]]
+op-parameter-name: P
+op-output: the transformed input to which the patches <<.place P>> have been applied
+tags: [[Filter Operators]] [[String Operators]]
+title: applypatches Operator
+type: text/vnd.tiddlywiki
+
+<<.from-version "5.2.6">>
+
+<<.operator-examples "makepatches and applypatches">>
diff --git a/editions/tw5.com/tiddlers/filters/examples/Hamlet.tid b/editions/tw5.com/tiddlers/filters/examples/Hamlet.tid
new file mode 100644
index 000000000..da209b035
--- /dev/null
+++ b/editions/tw5.com/tiddlers/filters/examples/Hamlet.tid
@@ -0,0 +1,11 @@
+created: 20230304161453213
+modified: 20230304162156826
+tags: [[Operator Examples]]
+title: Hamlet
+type: application/json
+
+{
+ "Shakespeare-old": "Hamlet: Do you see yonder cloud that's almost in shape of a camel?\nPolonius: By the mass, and 'tis like a camel, indeed.\nHamlet: Methinks it is like a weasel.\nPolonius: It is backed like a weasel.\nHamlet: Or like a whale?\nPolonius: Very like a whale.\n-- Shakespeare",
+ "Shakespeare-new": "Hamlet: Do you see the cloud over there that's almost the shape of a camel?\nPolonius: By golly, it is like a camel, indeed.\nHamlet: I think it looks like a weasel.\nPolonius: It is shaped like a weasel.\nHamlet: Or like a whale?\nPolonius: It's totally like a whale.\n-- Shakespeare",
+ "Trekkie-old": "Kirk: Do you see yonder cloud that's almost in shape of a Klingon?\nSpock: By the mass, and 'tis like a Klingon, indeed.\nKirk: Methinks it is like a Vulcan.\nSpock: It is backed like a Vulcan.\nKirk: Or like a Romulan?\nSpock: Very like a Romulan.\n-- Trekkie"
+}
\ No newline at end of file
diff --git a/editions/tw5.com/tiddlers/filters/examples/levenshtein Operator (Examples).tid b/editions/tw5.com/tiddlers/filters/examples/levenshtein Operator (Examples).tid
new file mode 100644
index 000000000..b5049e49c
--- /dev/null
+++ b/editions/tw5.com/tiddlers/filters/examples/levenshtein Operator (Examples).tid
@@ -0,0 +1,21 @@
+created: 20230304183158728
+modified: 20230304183159654
+tags: [[levenshtein Operator]] [[Operator Examples]]
+title: levenshtein Operator (Examples)
+type: text/vnd.tiddlywiki
+
+Determine the Levenshtein distance between two words:
+
+<<.operator-example 1 "[[motel]levenshtein[money]]">>
+
+List the 10 tiddler titles with the smallest Levenstein distance to "~TiddlyWiki":
+
+<$macrocall $name='wikitext-example-without-html'
+src="""
+"""/>
\ No newline at end of file
diff --git a/editions/tw5.com/tiddlers/filters/examples/makepatches and applypatches Operator (Examples).tid b/editions/tw5.com/tiddlers/filters/examples/makepatches and applypatches Operator (Examples).tid
new file mode 100644
index 000000000..a9dd38d6e
--- /dev/null
+++ b/editions/tw5.com/tiddlers/filters/examples/makepatches and applypatches Operator (Examples).tid
@@ -0,0 +1,43 @@
+created: 20230304160331362
+modified: 20230304160332927
+tags: [[makepatches Operator]] [[applypatches Operator]] [[Operator Examples]]
+title: makepatches and applypatches Operator (Examples)
+type: text/vnd.tiddlywiki
+
+These examples use the example texts in [[Hamlet]], taken from [[https://neil.fraser.name/software/diff_match_patch/demos/patch.html]]
+
+|^!Shakespeare's original |@@white-space: pre-wrap;{{Hamlet##Shakespeare-old}}@@ |
+|^!Modern English |@@white-space: pre-wrap;{{Hamlet##Shakespeare-new}}@@ |
+|^!Trekkie's Copy |@@white-space: pre-wrap;{{Hamlet##Trekkie-old}}@@ |
+
+
+
+Use `makepatches` to generate the set of patches to transform Shakepeare's original into Modern English:
+
+<<.operator-example 1 "[{Hamlet##Shakespeare-old}makepatches{Hamlet##Shakespeare-new}]">>
+
+Use `applypatches` to apply the patches to Shakespeare's original text:
+
+<<.operator-example 2 "[{Hamlet##Shakespeare-old}makepatches{Hamlet##Shakespeare-new}] :map[{Hamlet##Shakespeare-old}applypatches]">>
+
+In the above example, the [[Map Filter Run Prefix]] is used to pass the patches information as a parameter to `applypatches`. Inside `:map`, <<.value currentTiddler>> is set to the input title (i.e. the previously generated patches).
+
+The patch information from the Shakepeare texts can also be used to transform the //Trekkie's Copy// to a Modern English version:
+
+<<.operator-example 3 "[{Hamlet##Shakespeare-old}makepatches{Hamlet##Shakespeare-new}] :map[{Hamlet##Trekkie-old}applypatches]">>
+
+The above examples used the character mode of `makepatches`. The `word` mode yields very similar results in this case, even when applied to the //Trekkie's Copy//.
+
+<<.operator-example 4 "[{Hamlet##Shakespeare-old}makepatches:words{Hamlet##Shakespeare-new}]">>
+
+<<.operator-example 5 "[{Hamlet##Shakespeare-old}makepatches:words{Hamlet##Shakespeare-new}] :map[{Hamlet##Trekkie-old}applypatches]">>
+
+The `lines` mode doesn't work as well in this application:
+
+<<.operator-example 6 "[{Hamlet##Shakespeare-old}makepatches:lines{Hamlet##Shakespeare-new}]">>
+
+<<.operator-example 7 "[{Hamlet##Shakespeare-old}makepatches:lines{Hamlet##Shakespeare-new}] :map[{Hamlet##Trekkie-old}applypatches]">>
+
+It is better suited as a very fast algorithm to detect line-wise incremental changes to texts and store only the changes instead of multiple versions of the whole texts.
+
+
\ No newline at end of file
diff --git a/editions/tw5.com/tiddlers/filters/levenshtein Operator.tid b/editions/tw5.com/tiddlers/filters/levenshtein Operator.tid
new file mode 100644
index 000000000..7abc3e4dd
--- /dev/null
+++ b/editions/tw5.com/tiddlers/filters/levenshtein Operator.tid
@@ -0,0 +1,17 @@
+caption: levenshtein
+created: 20230304181639768
+modified: 20230304181642365
+op-purpose: determine the Levenshtein distance of the input title(s) and a given string
+op-input: a [[selection of titles|Title Selection]]
+op-parameter: a string
+op-parameter-name: S
+op-output: the Levenshtein distance between the input title(s) and <<.place S>>
+tags: [[Filter Operators]] [[String Operators]]
+title: levenshtein Operator
+type: text/vnd.tiddlywiki
+
+<<.from-version "5.2.6">>
+
+The Levenshtein distance is a metric for measuring the difference between two strings. Informally, the Levenshtein distance between two strings is the //minimum// number of single-character edits required to change one string into the other.
+
+<<.operator-examples "levenshtein">>
diff --git a/editions/tw5.com/tiddlers/filters/makepatches Operator.tid b/editions/tw5.com/tiddlers/filters/makepatches Operator.tid
new file mode 100644
index 000000000..c59284e22
--- /dev/null
+++ b/editions/tw5.com/tiddlers/filters/makepatches Operator.tid
@@ -0,0 +1,23 @@
+caption: makepatches
+created: 20230304122354967
+modified: 20230304122400128
+op-purpose: returns a set of patches that transform the input to a given string
+op-input: a [[selection of titles|Title Selection]]
+op-parameter: a string of characters
+op-parameter-name: S
+op-output: a set of patch instructions per input title to be used by the [[applypatches Operator]] to transform the input title(s) into the string <<.place S>>
+op-suffix: `lines` to operate in line mode, `words` to operate in word mode. If omitted (default), the algorithm operates in character mode. See notes below.
+op-suffix-name: T
+tags: [[Filter Operators]] [[String Operators]]
+title: makepatches Operator
+type: text/vnd.tiddlywiki
+
+<<.from-version "5.2.6">>
+
+The difference algorithm operates in character mode by default. This produces the most detailed diff possible. In `words` mode, each word in the input text is transformed into a meta-character, upon which the algorithm then operates. In the default character mode, the filter would find two patches between "ActionWidget" and "Action-Widgets" (the hyphen and the plural s), while in `words` mode, the whole word is found to be changed. In `lines` mode, the meta-character is formed from the whole line, delimited by newline characters, and is found to be changed independent of the number of changes within the line.
+
+The different modes influence the result when the patches are applied to texts other than the original, as well as the runtime.
+
+<<.tip "The calculation in `words` mode is roughly 10 times faster than the default character mode, while `lines` mode can be more than 100 times faster than the default.">>
+
+<<.operator-examples "makepatches and applypatches">>
diff --git a/editions/tw5.com/tiddlers/system/doc-styles.tid b/editions/tw5.com/tiddlers/system/doc-styles.tid
index b6d8eeee8..db6f71d81 100644
--- a/editions/tw5.com/tiddlers/system/doc-styles.tid
+++ b/editions/tw5.com/tiddlers/system/doc-styles.tid
@@ -133,6 +133,10 @@ td svg {
padding-left: 20px;
}
+.doc-examples-hard-breaks .doc-example-result li {
+ white-space: pre-wrap;
+}
+
.doc-bad-example code, .doc-bad-example pre, table.doc-bad-example {
background-color:#ffff80;
}
From f9604c40d3efa83ddf29c23ca470f5843b5da9de Mon Sep 17 00:00:00 2001
From: cdruan <80615570+cdruan@users.noreply.github.com>
Date: Sun, 5 Mar 2023 02:34:41 -0800
Subject: [PATCH 35/83] Add wikiparser.js dependency (#7330)
---
plugins/tiddlywiki/markdown/wrapper.js | 30 ++++++++++++--------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/plugins/tiddlywiki/markdown/wrapper.js b/plugins/tiddlywiki/markdown/wrapper.js
index cceb39138..98c5c2ae3 100755
--- a/plugins/tiddlywiki/markdown/wrapper.js
+++ b/plugins/tiddlywiki/markdown/wrapper.js
@@ -6,17 +6,13 @@ module-type: parser
Wraps up the markdown-it parser for use as a Parser in TiddlyWiki
\*/
-(function(realRequire){
+(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
-var require = function(m) {
- return realRequire("$:/plugins/tiddlywiki/markdown/" + m + ".js");
-};
-
-var MarkdownIt = require("markdown-it");
+var MarkdownIt = require("./markdown-it");
function parseAsBoolean(tiddlerName) {
return $tw.wiki.getTiddlerText(tiddlerName,"false").trim().toLowerCase() === "true";
@@ -61,8 +57,10 @@ function setupWikiRules(pluginOptions) {
return rulesInfo;
}
+ var WikiParser = require("$:/core/modules/parsers/wikiparser/wikiparser.js")["text/vnd.tiddlywiki"];
+
// first pass: get all rule classes
- var wikiParser = new $tw.Wiki.parsers["text/vnd.tiddlywiki"](null, '', {parseAsInline: true, wiki: $tw.wiki});
+ var wikiParser = new WikiParser(null, '', {parseAsInline: true, wiki: $tw.wiki});
// restore all possible rules from each rule class
wikiParser.pragmaRules = collectAllRules(wikiParser.pragmaRuleClasses,'pragma');
@@ -100,12 +98,12 @@ function setupWikiRules(pluginOptions) {
// Creates markdown-it parser
function createMarkdownEngine(markdownItOptions, pluginOptions) {
var md = new MarkdownIt(markdownItOptions)
- .use(require("markdown-it-sub"))
- .use(require("markdown-it-sup"))
- .use(require("markdown-it-ins"))
- .use(require("markdown-it-mark"))
- .use(require("markdown-it-footnote"))
- .use(require("markdown-it-deflist"));
+ .use(require("./markdown-it-sub"))
+ .use(require("./markdown-it-sup"))
+ .use(require("./markdown-it-ins"))
+ .use(require("./markdown-it-mark"))
+ .use(require("./markdown-it-footnote"))
+ .use(require("./markdown-it-deflist"));
var results = setupWikiRules(pluginOptions);
@@ -116,10 +114,10 @@ function createMarkdownEngine(markdownItOptions, pluginOptions) {
MarkdownParser.prototype.inlineRules = results.inlineRules;
if(pluginOptions.renderWikiText && $tw.modules.titles["$:/plugins/tiddlywiki/katex/katex.min.js"]) {
- md.use(require("markdown-it-katex"));
+ md.use(require("./markdown-it-katex"));
}
- md.use(require("markdown-it-tiddlywiki"),{
+ md.use(require("./markdown-it-tiddlywiki"),{
renderWikiText: pluginOptions.renderWikiText,
blockRules: results.blockRules,
inlineRules: results.inlineRules
@@ -263,4 +261,4 @@ function MarkdownParser(type,text,options) {
exports["text/markdown"] = MarkdownParser;
exports["text/x-markdown"] = MarkdownParser;
-})(require);
+})();
From 3f478f5689d0a390651107de0bf5e8a2ea32e89a Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Sun, 5 Mar 2023 17:40:04 +0000
Subject: [PATCH 36/83] Naming tweak to #6047
@linonetwo I realised on review that we refer to boot.files as the "tiddler file info"
---
plugins/tiddlywiki/filesystem/filesystemadaptor.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/plugins/tiddlywiki/filesystem/filesystemadaptor.js b/plugins/tiddlywiki/filesystem/filesystemadaptor.js
index 0692fb2fe..1779855df 100644
--- a/plugins/tiddlywiki/filesystem/filesystemadaptor.js
+++ b/plugins/tiddlywiki/filesystem/filesystemadaptor.js
@@ -140,7 +140,7 @@ FileSystemAdaptor.prototype.deleteTiddler = function(title,callback,options) {
}
}
// Remove the tiddler from self.boot.files & return null adaptorInfo
- self.deleteTiddlerInCache(title);
+ self.removeTiddlerFileInfo(title);
return callback(null,null);
});
} else {
@@ -151,8 +151,8 @@ FileSystemAdaptor.prototype.deleteTiddler = function(title,callback,options) {
/*
Delete a tiddler in cache, without modifying file system.
*/
-FileSystemAdaptor.prototype.deleteTiddlerInCache = function(title) {
- // Only delete the tiddler if we have writable information for the file
+FileSystemAdaptor.prototype.removeTiddlerFileInfo = function(title) {
+ // Only delete the tiddler info if we have writable information for the file
if(this.boot.files[title]) {
delete this.boot.files[title];
};
From 3764ca4760cab52ba9dbda2c94d9bf0ac610ae1b Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Sun, 5 Mar 2023 17:59:32 +0000
Subject: [PATCH 37/83] Update release note
---
.../prerelease/tiddlers/Release 5.2.6.tid | 47 ++++++++++++++++---
1 file changed, 40 insertions(+), 7 deletions(-)
diff --git a/editions/prerelease/tiddlers/Release 5.2.6.tid b/editions/prerelease/tiddlers/Release 5.2.6.tid
index 7bccaa61c..3a6ee78fb 100644
--- a/editions/prerelease/tiddlers/Release 5.2.6.tid
+++ b/editions/prerelease/tiddlers/Release 5.2.6.tid
@@ -1,39 +1,55 @@
caption: 5.2.6
-created: 20230119221001957
-modified: 20230119221001957
+created: 20230304213950684
+modified: 20230304213950684
tags: ReleaseNotes
title: Release 5.2.6
type: text/vnd.tiddlywiki
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.2.5...master]]//
+! Major Improvements
+
+* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7290">> three new operators exposing previously hidden features of the [[Diff-Match-Patch|https://neil.fraser.name/software/diff_match_patch]] library that is integrated with TiddlyWiki:
+** new [[levenshtein Operator]] to calculate the similarity of two strings as the number of characters that need to be inserted, deleted or modified in order to turn one into the other
+** new [[makepatches Operator]] and [[applypatches Operator]] that can be used to make and apply patches that represent the difference between two different texts. See the [[examples|makepatches and applypatches Operator (Examples)]]
+
! Translation Improvements
Improvements to the following translations:
* Chinese
* Italian
+* Polish
! Plugin Improvements
+* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7169">> integration between the [[BrowserStorage Plugin]] and the client-server configuration to allow changes to be made while offline and then later resynchronised with the server
* <<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/pull/6528">> the [[Markdown Plugin]] to use the newer and better maintained [[markdown-it|https://github.com/markdown-it/markdown-it]] library. The previous Markdown plugin remains available as "markdown-legacy"
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7176">> [[Innerwiki Plugin]] to allow the `<$data>` widget to override existing tiddler fields
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7207">>, <<.link-badge-here "https://github.com/Jermolene/TiddlyWiki5/commit/c39ef398bffae12c0ed7324d9b6d9d29f0f2f9ff">> and <<.link-badge-here "https://github.com/Jermolene/TiddlyWiki5/commit/8f7441f296351a4dd0852c3c782f8874d398e052">> problem preventing [[Share Plugin]] from working properly
+* <<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/commit/524cee1489f260375cac8cfe878fdc5942a4596e">> [[XLSX Plugin|XLSX Utilities Edition]] to handle importing numeric fields
+* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/81f514116657d0d567be7a4c45762a85beaa8bc0">> Dynannotate plugin crash when using the fake DOM used for static rendering
+* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7281">> bug where pasting text into the CodeMirror editor also opened an `$:/Import` tiddler
+! Accessibility Improvements
+
+* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7232">> appearance of save wiki button so that it is accessible to users without colour vision
! Usability Improvements
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7217">> consistency of tiddler deletion by allowing missing tiddlers to be 'deleted', which just results in them being closed
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/commit/34643a42790777f1b235f57b5093bb29bd0b3a14">> layout switcher to include an optional icon for each layout
* <<.link-badge-removed "https://github.com/Jermolene/TiddlyWiki5/commit/c0615e20ecf7d5d5e66d8a2acd28b80e8d59688d">> [[improvements to table layout|https://github.com/Jermolene/TiddlyWiki5/pull/7010]] from v5.2.5 that have proved to not be backwards compatible
+* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7323">> support for `$` HTML entity
! Widget Improvements
-*
+* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/pull/7222">> EditTextWidget to support `focusSelectFromStart` and `focusSelectFromEnd` attributes to give better control over text selection
! Filter improvements
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/pull/7121">> [[encodeuricomponent Operator]] to encode characters such as `*` that are illegal in Windows filenames
+* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/commit/89fd8871b6217634c9896b9402069757ca5ea189">> [[encodebase64 Operator]] and [[decodebase64 Operator]]
! Hackability Improvements
@@ -41,6 +57,7 @@ Improvements to the following translations:
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7118">> readability of [[tag-picker Macro]] and [[keyboard-driven-input Macro]]
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7129">> reliability of [[list-links-draggable Macro]] and [[list-tagged-draggable Macro]] by using the new GenesisWidget instead of textual substitution
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7210">> [[external JavaScript core support|Using the external JavaScript template]] to make it possible to save an external JS wiki as a standard single file wiki
+* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7007">> a warning message in the browser console when the Zoomin storyview fails due to the tiddler view template lacking a single containing element
! Bug Fixes
@@ -50,42 +67,58 @@ Improvements to the following translations:
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7121">> (and <<.link-badge-here "https://github.com/Jermolene/TiddlyWiki5/pull/7219">>) overriding `toc-caption` macro for [[Table-of-Contents Macros]]
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7212">> rendering of $:/core/ui/MoreSideBar/Tags when viewed within the story river
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7156">> undefined variable crash in [[reduce Operator]], [[filter Operator]] and [[sortsub Operator]]
-* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7153">> GenesisWidget not to create anything if the `$type` attribute is blank or missing
+* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/issues/7153">> GenesisWidget not to create anything if the `$type` attribute is blank or missing
+* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7230">> GenesisWidget to pass `isBlock` flag to the generated widget
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7160">> crash using [[jsonget Operator]] with "fixed" as key name
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/0b39e47ce88c7620b7a66c1553a71efaff06edb9">> importing of MP3 files to match current browser implementations
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7122">> crash when attempting to create an element with a blank tag name
+* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7224">> layout issue with "save tiddler" button
+* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/3d0ec5b1bdc157f87d65b8c9b76e681c14337eb4">> (and <<.link-badge-here "https://github.com/Jermolene/TiddlyWiki5/commit/4e5c957e975459350cd7df3038e5fb3c7aea859f">>) handling of whitespace in lists to cover all Unicode whitespace characters
+* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7228">> test spacing of parser rule checkboxes in control panel
+* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/f249b79e81e51d48364ea8147fe27850df9f577f">> CSS classes assigned to edit toolbar buttons
+* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7247">> usage of broken CSS class `tc-storyview-zoomin-tiddler` in Zoomin story view
+* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7243">> usage of `importTitle` and `autoOpenOnImport` options for [[WidgetMessage: tm-import-tiddlers]]
+* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7276">> fixed text editor refresh when the palette is changed
+* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7270">> crash with LetWidget when referencing a variable that exists but has an undefined value
! Node.js Improvements
-* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7169">> integration between the [[BrowserStorage Plugin]] and the client-server configuration to allow changes to be made while offline and then later resynchronised with the server
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7130">> duplicate fields in internal templates used in client-server configuration
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7138">> lazy loading not triggering a sync from the server
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/bf8e1ca5b0587787bf80692b0213bb7b038c7868">> crash on creating a new tiddler if anonymous users manage to create syncable tiddlers in a read only wiki
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/commit/95e61688397ff1bc9be04193bc4ce2e3c8c48dce">> handling of logout in the client-server configuration to avoid 404 errors
+* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7238">> problem with saving tiddlers with `_canonical_uri` field as `.tid` files
+* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/6953">> missing meta viewport to static river template
! Performance Improvements
-*
+* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7297">> wikitext parsing to use "sticky" flag for improved performance
+* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7299">> field indexer to more efficiently process lookups
! Acknowledgements
[[@Jermolene|https://github.com/Jermolene]] would like to thank the contributors to this release who have generously given their time to help improve TiddlyWiki:
<<.contributors """
+andrigamerita
AnthonyMuscio
BramChen
btheado
cdruan
CrossEye
cs8425
+EvidentlyCube
fkmiec
flibbles
GameDungeon
+hffqyd
jeffrey4l
joebordes
kookma
+linonetwo
m42e
Marxsal
+mateuszwilczek
newmedicine
pippep
pmario
@@ -94,4 +127,4 @@ Telumire
twMat
wincentbalin
yaisog
-""">>
+""">>
\ No newline at end of file
From 2ce14ac8f993370229507e8492eb8900c55ee665 Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Sun, 5 Mar 2023 18:05:25 +0000
Subject: [PATCH 38/83] Remove erroneously committed storylist tiddler
---
editions/prerelease/tiddlers/$__StoryList.tid | 5 -----
1 file changed, 5 deletions(-)
delete mode 100644 editions/prerelease/tiddlers/$__StoryList.tid
diff --git a/editions/prerelease/tiddlers/$__StoryList.tid b/editions/prerelease/tiddlers/$__StoryList.tid
deleted file mode 100644
index d1a1e959f..000000000
--- a/editions/prerelease/tiddlers/$__StoryList.tid
+++ /dev/null
@@ -1,5 +0,0 @@
-created: 20201222190149806
-list: [[Release 5.1.23]]
-modified: 20201222190149806
-title: $:/StoryList
-type: text/vnd.tiddlywiki
\ No newline at end of file
From 416a2fae7a17b05279247178884805d9ce732348 Mon Sep 17 00:00:00 2001
From: Mario Pietsch
Date: Mon, 6 Mar 2023 17:12:26 +0100
Subject: [PATCH 39/83] Add syntax docs to railroad plugin (#7334)
---
.../railroad/doc/example-transclusion.tid | 3 +
plugins/tiddlywiki/railroad/doc/syntax.tid | 250 ++++++++++++++++++
plugins/tiddlywiki/railroad/parser.js | 4 +-
3 files changed, 255 insertions(+), 2 deletions(-)
create mode 100644 plugins/tiddlywiki/railroad/doc/example-transclusion.tid
diff --git a/plugins/tiddlywiki/railroad/doc/example-transclusion.tid b/plugins/tiddlywiki/railroad/doc/example-transclusion.tid
new file mode 100644
index 000000000..f8d1144b1
--- /dev/null
+++ b/plugins/tiddlywiki/railroad/doc/example-transclusion.tid
@@ -0,0 +1,3 @@
+title: $:/plugins/tiddlywiki/railroad/example-transclusion
+
+"railroad transclusion example" text
\ No newline at end of file
diff --git a/plugins/tiddlywiki/railroad/doc/syntax.tid b/plugins/tiddlywiki/railroad/doc/syntax.tid
index fc0d8d87f..0e6e809dd 100644
--- a/plugins/tiddlywiki/railroad/doc/syntax.tid
+++ b/plugins/tiddlywiki/railroad/doc/syntax.tid
@@ -2,6 +2,7 @@ created: 20150103184022184
modified: 20150119220342000
title: $:/plugins/tiddlywiki/railroad/syntax
+
The railroad widget uses a special notation to construct the components defined below.
`x` and `y` here stand for any component.
@@ -12,9 +13,28 @@ Names (as opposed to quoted strings) are available when a value starts with a le
; sequence
: <$railroad text=""" ["<-"] {x} ["->"] """/>
+
* A sequence of components
* The `<-` and `->` delimiters allow you to force a single component to be treated as a sequence. This is occasionally useful for spacing a diagram out
+examples
+
+<<<
+
+```
+x y z sequence
+```
+<$railroad text=""" x y z """/>
+
+```
+<-x y z-> explicit sequence
+```
+
+<$railroad text=""" <- x y z -> """/>
+
+<<<
+
+
---
; optional
@@ -22,6 +42,24 @@ Names (as opposed to quoted strings) are available when a value starts with a le
* A component that can be omitted
* The colon makes `x` appear straight ahead
+examples
+
+<<<
+
+```
+[:x] optional, normally included
+```
+<$railroad text=""" [:x] """/>
+
+```
+[x] optional, normally omitted
+```
+
+<$railroad text=""" [x] """/>
+
+<<<
+
+
---
; repeated
@@ -29,12 +67,62 @@ Names (as opposed to quoted strings) are available when a value starts with a le
* A list of one or more `x`
* The `+` suffix adds `y` as a separator between each `x` and the next
+examples
+
+<<<
+
+```
+{x} one or more
+```
+<$railroad text=""" {x} """/>
+
+```
+{x +","} one or more, comma-separated
+```
+
+<$railroad text=""" {x +","} """/>
+
+<<<
+
+
---
; optional repeated
: <$railroad text=""" "[{" [":"] x [:"+" y] "}]" """/>
* An optional list of `x`, i.e. a list of zero or more `x`
+examples
+
+<<<
+
+```
+[{:x}] zero or more, normally included
+```
+
+<$railroad text=""" [{:x}] """/>
+
+```
+[{:x +","}] zero or more, comma-separated, normally included
+```
+
+<$railroad text=""" [{:x +","}] """/>
+
+```
+[{x}] zero or more, normally omitted
+```
+
+<$railroad text=""" [{x}] """/>
+
+```
+[{x +","}] zero or more, comma-separated, normally omitted
+```
+
+<$railroad text=""" [{x +","}] """/>
+
+<<<
+
+
+
---
; choice
@@ -42,6 +130,25 @@ Names (as opposed to quoted strings) are available when a value starts with a le
* A set of alternatives
* The colon indicates which branch appears straight ahead. By default, it's the first branch
+examples
+
+<<<
+
+```
+(x|y|z) alternatives
+```
+
+<$railroad text=""" (x|y|z) """/>
+
+```
+(x|:y|z) alternatives, normally y
+```
+
+<$railroad text=""" (x|:y|z) """/>
+
+<<<
+
+
---
; string / terminal
@@ -49,36 +156,117 @@ Names (as opposed to quoted strings) are available when a value starts with a le
* A literal or terminal component
* This follows the normal ~TiddlyWiki rules for quoted strings
+examples
+
+<<<
+
+```
+"x" terminal
+```
+
+<$railroad text=""" "x" """/>
+
+<<<
+
+
---
; nonterminal
: <$railroad text=""" (name | "<" string ">") """/>
* A nonterminal component, i.e. the name of another diagram
+examples
+
+<<<
+
+```
+<"x"> nonterminal
+```
+
+<$railroad text=""" <"x"> """/>
+
+<<<
+
+
---
; comment
: <$railroad text=""" "/" string "/" """/>
* A comment
+examples
+
+<<<
+
+```
+/ "comment" / comment
+```
+
+<$railroad text=""" / "comment" / """/>
+
+<<<
+
+
---
; dummy
: <$railroad text=""" "-" """/>
* The absence of a component
+examples
+
+<<<
+
+```
+- dummy
+```
+
+<$railroad text=""" - """/>
+
+<<<
+
+
---
; link
: <$railroad text=""" "[[" x "|" (name|string) "]]" """/>
* A link to the tiddler title or URI given by the string or name
+examples
+
+<<<
+
+```
+[[x|"tiddler"]] link
+```
+
+<$railroad text=""" [[x|"tiddler"]] """/>
+
+<<<
+
+
---
; transclusion
: <$railroad text=""" "{{" (name|string) "}}" """/>
* Treats the content of another tiddler as diagram syntax and transcludes it into the current diagram
+examples
+
+<<<
+
+```
+{{"$:/plugins/tiddlywiki/railroad/example-transclusion"}} transclusion
+
+// "railroad transclusion example" text <- text in the tidlder
+
+```
+
+<$railroad text=""" {{ "$:/plugins/tiddlywiki/railroad/example-transclusion" }} """/>
+
+<<<
+
+
---
; arrow pragma
@@ -86,14 +274,76 @@ Names (as opposed to quoted strings) are available when a value starts with a le
* Controls whether repeat paths have an arrow on them
* Can be toggled on and off in mid-diagram, if desired
+examples
+
+<<<
+```
+<$railroad text="""
+\arrow yes
+[{:x}]
+"""/>
+
+```
+
+<$railroad text="""\arrow yes [{:x}] """/>
+
+```
+<$railroad text="""
+\arrow no
+[{:x}]
+"""/>
+```
+
+<$railroad text="""\arrow no [{:x}] """/>
+
+<<<
+
+
---
; debug pragma
: <$railroad text=""" "\debug" """/>
* Causes the diagram to display its parse tree
+examples
+
+<<<
+
+```
+\debug
+x
+```
+
+<$railroad text="""\debug x """/>
+
+<<<
+
+
---
; start/end pragma
: <$railroad text=""" ("\start" |: "\end") ("none" |: "single" | "double") """/>
* Controls the style of the diagram's startpoint or endpoint
+examples
+
+<<<
+
+```
+\start none x
+```
+
+<$railroad text=""" \start none x """/>
+
+```
+\start double
+\end double
+ x
+```
+
+<$railroad text=""" \start double
+\end double
+x
+"""/>
+
+<<<
+
diff --git a/plugins/tiddlywiki/railroad/parser.js b/plugins/tiddlywiki/railroad/parser.js
index bb55b57b8..013d898d7 100644
--- a/plugins/tiddlywiki/railroad/parser.js
+++ b/plugins/tiddlywiki/railroad/parser.js
@@ -5,6 +5,8 @@ module-type: library
Parser for the source of a railroad diagram.
+x y z sequence
+<-x y z-> explicit sequence
[:x] optional, normally included
[x] optional, normally omitted
{x} one or more
@@ -13,8 +15,6 @@ Parser for the source of a railroad diagram.
[{:x +","}] zero or more, comma-separated, normally included
[{x}] zero or more, normally omitted
[{x +","}] zero or more, comma-separated, normally omitted
-x y z sequence
-<-x y z-> explicit sequence
(x|y|z) alternatives
(x|:y|z) alternatives, normally y
"x" terminal
From 6732d96f78d4ecde003a5d2e93696958dc25b8bd Mon Sep 17 00:00:00 2001
From: yaisog
Date: Mon, 6 Mar 2023 17:14:08 +0100
Subject: [PATCH 40/83] Add a description and examples for "strict" results
from getindex (#7333)
* Add a description and examples for "strict" results
* Add another example
* Amend description of output with suffix "index"
---
.../tiddlers/filters/examples/getindex.tid | 20 +++++++++++++++---
.../tw5.com/tiddlers/filters/getindex.tid | 21 +++++++++++--------
editions/tw5.com/tiddlers/filters/has.tid | 6 +++---
3 files changed, 32 insertions(+), 15 deletions(-)
diff --git a/editions/tw5.com/tiddlers/filters/examples/getindex.tid b/editions/tw5.com/tiddlers/filters/examples/getindex.tid
index 780c09946..ca18bce84 100644
--- a/editions/tw5.com/tiddlers/filters/examples/getindex.tid
+++ b/editions/tw5.com/tiddlers/filters/examples/getindex.tid
@@ -1,8 +1,22 @@
created: 20150203140000000
-modified: 20170608150301791
+modified: 20230306140231272
tags: [[getindex Operator]] [[Operator Examples]]
title: getindex Operator (Examples)
type: text/vnd.tiddlywiki
-<<.operator-example 1 "[[$:/palettes/Vanilla]getindex[background]]" "returns the value at index ''background'' of the [[DataTiddler|DataTiddlers]] [[$:/palettes/Vanilla]]">>
-<<.operator-example 2 "[all[shadows+tiddlers]tag[$:/tags/Palette]getindex[background]]" "returns all background colors defined in any of the ColourPalettes">>
\ No newline at end of file
+<<.operator-example 1 "[[$:/palettes/Vanilla]getindex[background]]" "returns the value at index <<.value background>> of the [[DataTiddler|DataTiddlers]] [[$:/palettes/Vanilla]]">>
+<<.operator-example 2 "[all[shadows+tiddlers]tag[$:/tags/Palette]getindex[background]]" "returns all background colors defined in any of the ColourPalettes">>
+
+[[ListopsData]] contains an empty index <<.value ~DataIndex>> which is not returned by the filter operator:
+<<.operator-example 3 "[[ListopsData]getindex[DataIndex]]">>
+
+This filter expression can be used to return the value, even if it is an empty string:
+<<.operator-example 4 "[[ListopsData]] :filter[has:index[DataIndex]] :and[getindex[DataIndex]else[]]">>
+
+There are 5 palettes which define the index <<.value diff-equal-background>>, but none defines a value:
+<<.operator-example 5 "[all[shadows+tiddlers]tag[$:/tags/Palette]] :filter[has:index[diff-equal-background]] :map[getindex[diff-equal-background]else[]]">>
+In the above example, the [[Map Filter Run Prefix]] is used instead of `:and` as it does not de-duplicate its results.
+
+Another way to check if an index has an empty value is to [[count|count Operator]] the results from the [[getindex Operator]]:
+<<.operator-example 6 "[[$:/palettes/Vanilla]indexes[]] :filter[[$:/palettes/Vanilla]getindexcount[]compare:number:eq[0]]">>
+Here, the input to `:filter` is the [[list of indexes|indexes Operator]] which are contained in [[$:/palettes/Vanilla]].
\ No newline at end of file
diff --git a/editions/tw5.com/tiddlers/filters/getindex.tid b/editions/tw5.com/tiddlers/filters/getindex.tid
index 89ddabb83..03302cc6b 100644
--- a/editions/tw5.com/tiddlers/filters/getindex.tid
+++ b/editions/tw5.com/tiddlers/filters/getindex.tid
@@ -1,17 +1,20 @@
+caption: getindex
created: 20150203140000000
-modified: 20150203140000000
+modified: 20230306131335009
+op-purpose: select all values of a data property in the input titles
+op-input: a [[selection of titles|Title Selection]]
+op-parameter: the name of a [[property|DataTiddlers]]
+op-parameter-name: P
+op-output: the values of property <<.place P>> in each of the input titles
tags: [[Filter Operators]] [[Field Operators]]
title: getindex Operator
caption: getindex
-op-purpose: select all values of a data property in the input titles
-
-<$macrocall $name=".operator-def"
-input="a [[selection of titles|Title Selection]]"
-parameter="the name of a [[property|DataTiddlers]]"
-paramName="P"
-output="the values of property <<.place P>> in each of the input titles"
-/>
Each input title is processed in turn, and is ignored if it does not denote a [[data tiddler|DataTiddlers]]. If the tiddler contains property <<.place P>>, the value of that property is [[dominantly appended|Dominant Append]] to the output.
+<<.tip """If a data tiddler contains index <<.place P>> with an empty value, the empty string is not appended. The following [[Filter Expression]] can be used to also return an empty string
+
:filter[has:index[P]] :and[getindex[P]else[]]
""">>
+
<<.operator-examples "getindex">>
+
+
diff --git a/editions/tw5.com/tiddlers/filters/has.tid b/editions/tw5.com/tiddlers/filters/has.tid
index cccb152ae..f05ae1e05 100644
--- a/editions/tw5.com/tiddlers/filters/has.tid
+++ b/editions/tw5.com/tiddlers/filters/has.tid
@@ -1,9 +1,9 @@
caption: has
created: 20140410103123179
-modified: 20190518145446047
+modified: 20230306143207920
op-input: a [[selection of titles|Title Selection]]
-op-neg-output: ''without suffix'' » those input tiddlers in which field <<.place F>> does <<.em not>> exist or has an empty value ''suffix `field`'' » those input tiddlers in which field <<.place F>> does <<.em not>> exist ''suffix `index`'' » those input tiddlers in which index <<.place F>> does <<.em not>> exist
-op-output: ''without suffix'' » those input tiddlers in which field <<.place F>> has a non-empty value ''suffix `field`'' » those input tiddlers in which field <<.place F>> exists
+op-neg-output: ''without suffix'' » those input tiddlers in which field <<.place F>> does <<.em not>> exist or has an empty value ''suffix `field`'' » those input tiddlers in which field <<.place F>> does <<.em not>> exist ''suffix `index`'' » those input data tiddlers in which index <<.place F>> does <<.em not>> exist
+op-output: ''without suffix'' » those input tiddlers in which field <<.place F>> has a non-empty value ''suffix `field`'' » those input tiddlers in which field <<.place F>> exists ''suffix `index`'' » those input data tiddlers in which index <<.place F>> exists
op-parameter: the name of a [[field|TiddlerFields]] ''suffix `index`'' » those input tiddlers in which index <<.place F>> exists
op-parameter: the name of a [[field|TiddlerFields]] or, optionally an [[index|TextReference]]
op-parameter-name: F
From ba01d0696270e5e26144e4da223fb0e00cf26a91 Mon Sep 17 00:00:00 2001
From: Mario Pietsch
Date: Tue, 7 Mar 2023 09:56:41 +0100
Subject: [PATCH 41/83] German Translation: fix some typos and add missing
tiddlers (#7337)
---
editions/de-AT/tiddlers/beispiele/TaskManagement.tid | 4 ++--
editions/de-AT/tiddlers/beispiele/done.tid | 4 ++--
editions/de-AT/tiddlers/howto/Importieren von Tiddlern.tid | 6 ++++++
editions/de-AT/tiddlers/howto/Liste aller HowTo's.tid | 4 ++--
editions/de-AT/tiddlers/konzept/Tagging.tid | 6 ++++++
.../$__themes_tiddlywiki_vanilla_options_sidebarlayout.tid | 6 ++++++
editions/de-AT/tiddlers/widgets/ListWidget.tid | 7 +++++++
editions/de-AT/tiddlers/widgets/TranscludeWidget.tid | 7 +++++++
editions/de-AT/tiddlers/wikitext/Bilder in WikiText.tid | 6 +++---
editions/de-AT/tiddlers/wikitext/Makros in WikiText.tid | 6 +++---
.../de-AT/tiddlers/wikitext/Transclusion in WikiText.tid | 7 +++++++
11 files changed, 51 insertions(+), 12 deletions(-)
create mode 100644 editions/de-AT/tiddlers/howto/Importieren von Tiddlern.tid
create mode 100644 editions/de-AT/tiddlers/konzept/Tagging.tid
create mode 100644 editions/de-AT/tiddlers/system/$__themes_tiddlywiki_vanilla_options_sidebarlayout.tid
create mode 100644 editions/de-AT/tiddlers/widgets/ListWidget.tid
create mode 100644 editions/de-AT/tiddlers/widgets/TranscludeWidget.tid
create mode 100644 editions/de-AT/tiddlers/wikitext/Transclusion in WikiText.tid
diff --git a/editions/de-AT/tiddlers/beispiele/TaskManagement.tid b/editions/de-AT/tiddlers/beispiele/TaskManagement.tid
index 2bc4bd0c0..159676eae 100644
--- a/editions/de-AT/tiddlers/beispiele/TaskManagement.tid
+++ b/editions/de-AT/tiddlers/beispiele/TaskManagement.tid
@@ -1,11 +1,11 @@
created: 20140923173639039
creator: pmario
-modified: 20140924155046340
+modified: 20230307080008193
modifier: pmario
title: TaskManagement
type: text/vnd.tiddlywiki
-In dieser Edition sind folgende Task Management Varianten beschreiben:
+In dieser Edition sind folgende Task Management Varianten beschrieben:
<>
diff --git a/editions/de-AT/tiddlers/beispiele/done.tid b/editions/de-AT/tiddlers/beispiele/done.tid
index 9972856b7..626fa3f33 100644
--- a/editions/de-AT/tiddlers/beispiele/done.tid
+++ b/editions/de-AT/tiddlers/beispiele/done.tid
@@ -2,7 +2,7 @@ color: #37d011
created: 20140923104300415
creator: pmario
icon: $:/core/images/done-button
-modified: 20140923105208878
+modified: 20230307080039831
modifier: ChrisK
tags: done
title: done
@@ -12,5 +12,5 @@ Diese Tag wird verwendet um "Tasks" als erledigt zu markieren.
Siehe auch:
-* [[Task Management]] .. Beispiel
+* [[Task Management|TaskManagement]] .. Beispiel
* [[Tag Manager|$:/TagManager]] .. Zuweisung der Farben und Symbole
\ No newline at end of file
diff --git a/editions/de-AT/tiddlers/howto/Importieren von Tiddlern.tid b/editions/de-AT/tiddlers/howto/Importieren von Tiddlern.tid
new file mode 100644
index 000000000..e9ea480b4
--- /dev/null
+++ b/editions/de-AT/tiddlers/howto/Importieren von Tiddlern.tid
@@ -0,0 +1,6 @@
+created: 20230307080413903
+modified: 20230307080417122
+title: Importieren von Tiddlern
+type: text/vnd.tiddlywiki
+
+https://tiddlywiki.com/#Importing%20Tiddlers
\ No newline at end of file
diff --git a/editions/de-AT/tiddlers/howto/Liste aller HowTo's.tid b/editions/de-AT/tiddlers/howto/Liste aller HowTo's.tid
index 9dcc7e62a..0c88f3e1e 100644
--- a/editions/de-AT/tiddlers/howto/Liste aller HowTo's.tid
+++ b/editions/de-AT/tiddlers/howto/Liste aller HowTo's.tid
@@ -1,11 +1,11 @@
created: 20140918094051245
creator: pmario
-modified: 20140918094948642
+modified: 20230307080301079
modifier: pmario
tags: Referenz
title: Liste aller HowTo's
type: text/vnd.tiddlywiki
-Hier finden Sie eine Auflistung aller HowTo's
+Hier finden Sie eine Auflistung aller ~HowTo's
<>
\ No newline at end of file
diff --git a/editions/de-AT/tiddlers/konzept/Tagging.tid b/editions/de-AT/tiddlers/konzept/Tagging.tid
new file mode 100644
index 000000000..fa28765ba
--- /dev/null
+++ b/editions/de-AT/tiddlers/konzept/Tagging.tid
@@ -0,0 +1,6 @@
+created: 20230307081437974
+modified: 20230307081439303
+title: Tagging
+type: text/vnd.tiddlywiki
+
+https://tiddlywiki.com/#Tagging
\ No newline at end of file
diff --git a/editions/de-AT/tiddlers/system/$__themes_tiddlywiki_vanilla_options_sidebarlayout.tid b/editions/de-AT/tiddlers/system/$__themes_tiddlywiki_vanilla_options_sidebarlayout.tid
new file mode 100644
index 000000000..66a4cbad8
--- /dev/null
+++ b/editions/de-AT/tiddlers/system/$__themes_tiddlywiki_vanilla_options_sidebarlayout.tid
@@ -0,0 +1,6 @@
+created: 20230307080103029
+modified: 20230307080103029
+title: $:/themes/tiddlywiki/vanilla/options/sidebarlayout
+type: text/vnd.tiddlywiki
+
+fluid-fixed
\ No newline at end of file
diff --git a/editions/de-AT/tiddlers/widgets/ListWidget.tid b/editions/de-AT/tiddlers/widgets/ListWidget.tid
new file mode 100644
index 000000000..44430e62c
--- /dev/null
+++ b/editions/de-AT/tiddlers/widgets/ListWidget.tid
@@ -0,0 +1,7 @@
+created: 20230307081923415
+modified: 20230307081953759
+tags: Widgets
+title: ListWidget
+type: text/vnd.tiddlywiki
+
+https://tiddlywiki.com/#ListWidget
\ No newline at end of file
diff --git a/editions/de-AT/tiddlers/widgets/TranscludeWidget.tid b/editions/de-AT/tiddlers/widgets/TranscludeWidget.tid
new file mode 100644
index 000000000..e2e0cbdaf
--- /dev/null
+++ b/editions/de-AT/tiddlers/widgets/TranscludeWidget.tid
@@ -0,0 +1,7 @@
+created: 20230307082002353
+modified: 20230307082023207
+tags: Widgets
+title: TranscludeWidget
+type: text/vnd.tiddlywiki
+
+https://tiddlywiki.com/#TranscludeWidget
\ No newline at end of file
diff --git a/editions/de-AT/tiddlers/wikitext/Bilder in WikiText.tid b/editions/de-AT/tiddlers/wikitext/Bilder in WikiText.tid
index 1a2407ad8..53ffd37d1 100644
--- a/editions/de-AT/tiddlers/wikitext/Bilder in WikiText.tid
+++ b/editions/de-AT/tiddlers/wikitext/Bilder in WikiText.tid
@@ -1,7 +1,7 @@
caption: Bilder
created: 20131205160221762
creator: pmario
-modified: 20140921170652909
+modified: 20230307081713229
modifier: pmario
tags: WikiText
title: Bilder in WikiText
@@ -25,7 +25,7 @@ oder
Wenn die Bildquelle der Titel eines existierenden Tiddlers ist, dann wird dieser direkt angezeigt. Ansonsten wird die Quelle als URL angesehen und ein HTML `` Element wird erzeugt. Das `src` Attribut wird auf die [[URL]] gesetzt.
-Ein [[Tooltip]] kann ebenfalls angegeben werden:
+Ein Tooltip kann ebenfalls angegeben werden:
```
[img[Ich bin der Tooltip text|Motovun Jack.jpg]]
@@ -33,7 +33,7 @@ Ein [[Tooltip]] kann ebenfalls angegeben werden:
[img width=100 [Ich bin der Tooltip text|Motovun Jack.jpg]]
-Attribute wie zB: CSS Klassen oder die Höhe und Breite können ebenfalls angegeben werden.
+Attribute wie z.B: CSS Klassen oder die Höhe und Breite können ebenfalls angegeben werden.
```
[img width=64 [Motovun Jack.jpg]]
diff --git a/editions/de-AT/tiddlers/wikitext/Makros in WikiText.tid b/editions/de-AT/tiddlers/wikitext/Makros in WikiText.tid
index dd336588e..c2141999a 100644
--- a/editions/de-AT/tiddlers/wikitext/Makros in WikiText.tid
+++ b/editions/de-AT/tiddlers/wikitext/Makros in WikiText.tid
@@ -1,7 +1,7 @@
caption: Makros
created: 20131205160746466
creator: pmario
-modified: 20140922124415476
+modified: 20230307080132949
modifier: ChrisK
tags: WikiText
title: Makros in WikiText
@@ -15,7 +15,7 @@ Hallo, Ich bin $name$ und lebe in $adresse$
Hallo, Ich bin $name$ und würde gerne mal wieder nach $adresse$ fahren:)
\end
-!! Makros Definieren
+!! Makros definieren
!!! Für die Ungeduldigen
@@ -76,7 +76,7 @@ Für einzeilige Makros kann die `\end` Markierung entfallen!
* Makros können mit dem ImportVariablesWidget importiert werden. (Für geübte Anwender)
-!! Makros Verwenden
+!! Makros verwenden
```
<>
diff --git a/editions/de-AT/tiddlers/wikitext/Transclusion in WikiText.tid b/editions/de-AT/tiddlers/wikitext/Transclusion in WikiText.tid
new file mode 100644
index 000000000..bb8798ebf
--- /dev/null
+++ b/editions/de-AT/tiddlers/wikitext/Transclusion in WikiText.tid
@@ -0,0 +1,7 @@
+created: 20230307081757660
+modified: 20230307081814992
+tags: WikiText
+title: Transclusion in WikiText
+type: text/vnd.tiddlywiki
+
+https://tiddlywiki.com/#Transclusion%20in%20WikiText
\ No newline at end of file
From 2bac676ac4815ed06f497f4788df1ce800d5bfb7 Mon Sep 17 00:00:00 2001
From: yaisog
Date: Tue, 7 Mar 2023 22:51:52 +0100
Subject: [PATCH 42/83] Docs: Align description with example (#7339)
---
editions/tw5.com/tiddlers/widgets/ActionListopsWidget.tid | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/editions/tw5.com/tiddlers/widgets/ActionListopsWidget.tid b/editions/tw5.com/tiddlers/widgets/ActionListopsWidget.tid
index 0762f14e0..2aadfe677 100644
--- a/editions/tw5.com/tiddlers/widgets/ActionListopsWidget.tid
+++ b/editions/tw5.com/tiddlers/widgets/ActionListopsWidget.tid
@@ -32,7 +32,7 @@ For example, the items "abc" and "123" can be appended to the field `myfield` us
<$action-listops $field="myfield" $subfilter="abc 123"/>
```
-The same can be achieved using the `$filter` attribute and prepending the [[Filter Run]] `[all[current]get[myfield]enlist-input[]]` to the [[Filter Expression]]:
+The same can be achieved using the `$filter` attribute and prepending the [[Filter Run]] `[enlist{!!myfield}]` to the [[Filter Expression]]:
```
<$action-listops $field="myfield" $filter="[enlist{!!myfield}] abc 123"/>
From b16d6953863c144bcae63374bf779bcb6a6bc78b Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Wed, 8 Mar 2023 08:53:02 +0000
Subject: [PATCH 43/83] Update release note
---
editions/prerelease/tiddlers/Release 5.2.6.tid | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/editions/prerelease/tiddlers/Release 5.2.6.tid b/editions/prerelease/tiddlers/Release 5.2.6.tid
index 3a6ee78fb..3e4410a6a 100644
--- a/editions/prerelease/tiddlers/Release 5.2.6.tid
+++ b/editions/prerelease/tiddlers/Release 5.2.6.tid
@@ -9,6 +9,16 @@ type: text/vnd.tiddlywiki
! Major Improvements
+!! Improved Markdown Plugin
+
+* <<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/pull/6528">> the [[Markdown Plugin]] to use the newer and better maintained [[markdown-it|https://github.com/markdown-it/markdown-it]] library. The previous Markdown plugin remains available as "markdown-legacy"
+
+!! Better Handling of Loss of Network Connectivity with Client Server Configuration
+
+* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7169">> integration between the [[BrowserStorage Plugin]] and the client-server configuration to allow changes to be made while offline and then later resynchronised with the server
+
+!! New Diff-Match-Patch Primitives
+
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7290">> three new operators exposing previously hidden features of the [[Diff-Match-Patch|https://neil.fraser.name/software/diff_match_patch]] library that is integrated with TiddlyWiki:
** new [[levenshtein Operator]] to calculate the similarity of two strings as the number of characters that need to be inserted, deleted or modified in order to turn one into the other
** new [[makepatches Operator]] and [[applypatches Operator]] that can be used to make and apply patches that represent the difference between two different texts. See the [[examples|makepatches and applypatches Operator (Examples)]]
@@ -23,8 +33,6 @@ Improvements to the following translations:
! Plugin Improvements
-* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7169">> integration between the [[BrowserStorage Plugin]] and the client-server configuration to allow changes to be made while offline and then later resynchronised with the server
-* <<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/pull/6528">> the [[Markdown Plugin]] to use the newer and better maintained [[markdown-it|https://github.com/markdown-it/markdown-it]] library. The previous Markdown plugin remains available as "markdown-legacy"
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7176">> [[Innerwiki Plugin]] to allow the `<$data>` widget to override existing tiddler fields
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7207">>, <<.link-badge-here "https://github.com/Jermolene/TiddlyWiki5/commit/c39ef398bffae12c0ed7324d9b6d9d29f0f2f9ff">> and <<.link-badge-here "https://github.com/Jermolene/TiddlyWiki5/commit/8f7441f296351a4dd0852c3c782f8874d398e052">> problem preventing [[Share Plugin]] from working properly
* <<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/commit/524cee1489f260375cac8cfe878fdc5942a4596e">> [[XLSX Plugin|XLSX Utilities Edition]] to handle importing numeric fields
From d8c2ab3bafe58b666b42f6a388ba88c30d41cc63 Mon Sep 17 00:00:00 2001
From: Michelle Saad
Date: Wed, 8 Mar 2023 18:16:48 +0000
Subject: [PATCH 44/83] Sign CLA (#7342)
---
licenses/cla-individual.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/licenses/cla-individual.md b/licenses/cla-individual.md
index 744b5e133..6be49c5e0 100644
--- a/licenses/cla-individual.md
+++ b/licenses/cla-individual.md
@@ -525,3 +525,5 @@ Mateusz Wilczek, @mateuszwilczek, 2023/02/16
Andrea Octo, @andrigamerita, 2023/02/24
HuanC Fu, @hffqyd, 2023/03/03
+
+Michelle Saad, @michsa, 2023-03-08
From 714587cdfcdd60de4409dbe8cfbf41698c6aa3cf Mon Sep 17 00:00:00 2001
From: yaisog
Date: Fri, 10 Mar 2023 09:48:28 +0100
Subject: [PATCH 45/83] Improve documentation for get and getindex - Update
descriptions and examples (#7349)
---
.../tw5.com/tiddlers/filters/examples/get.tid | 16 ++++++++++---
.../tiddlers/filters/examples/getindex.tid | 23 ++++++++-----------
editions/tw5.com/tiddlers/filters/get.tid | 16 ++++++-------
.../tw5.com/tiddlers/filters/getindex.tid | 14 ++++-------
4 files changed, 36 insertions(+), 33 deletions(-)
diff --git a/editions/tw5.com/tiddlers/filters/examples/get.tid b/editions/tw5.com/tiddlers/filters/examples/get.tid
index c49d876d6..de56361cf 100644
--- a/editions/tw5.com/tiddlers/filters/examples/get.tid
+++ b/editions/tw5.com/tiddlers/filters/examples/get.tid
@@ -1,9 +1,19 @@
created: 20150118134611000
-modified: 20150124201839000
+modified: 20230309180521925
+myfield:
tags: [[get Operator]] [[Operator Examples]]
title: get Operator (Examples)
type: text/vnd.tiddlywiki
<<.operator-example 1 "[all[current]get[draft.of]]" "the title of the tiddler of which the current tiddler is a draft">>
-<<.operator-example 2 "[get[tags]]">>
-<<.operator-example 3 "[each[tags]get[tags]]">>
+
+<<.operator-example 2 "[get[tags]]" "returns the tags of all tiddlers without de-duplication">>
+
+<<.operator-example 3 "[get[tags]unique[]]" "returns the tags of all tiddlers with de-duplication">>
+
+<<.tip """If a data tiddler contains a field with an empty value, the empty string is not appended to the results.""">>
+
+<<.operator-example 4 "[all[current]get[myfield]]" "the empty value of field <<.field myfield>> is not returned by the <<.olink get>> operator">>
+
+<<.operator-example 5 "[all[current]] :filter[has:field[myfield]] :map[get[myfield]]" "also returns the empty string">>
+The above example works by first using the [[Filter Filter Run Prefix]] to only select titles that have the field <<.field myfield>> and then using the [[Map Filter Run Prefix]] to replace those titles with their value of that field. The [[Map Filter Run Prefix]] outputs an empty string when its filter run returns an empty [[selection|Title Selection]].
\ No newline at end of file
diff --git a/editions/tw5.com/tiddlers/filters/examples/getindex.tid b/editions/tw5.com/tiddlers/filters/examples/getindex.tid
index ca18bce84..beb52fc19 100644
--- a/editions/tw5.com/tiddlers/filters/examples/getindex.tid
+++ b/editions/tw5.com/tiddlers/filters/examples/getindex.tid
@@ -1,22 +1,19 @@
created: 20150203140000000
-modified: 20230306140231272
+modified: 20230309180501044
tags: [[getindex Operator]] [[Operator Examples]]
title: getindex Operator (Examples)
type: text/vnd.tiddlywiki
-<<.operator-example 1 "[[$:/palettes/Vanilla]getindex[background]]" "returns the value at index <<.value background>> of the [[DataTiddler|DataTiddlers]] [[$:/palettes/Vanilla]]">>
-<<.operator-example 2 "[all[shadows+tiddlers]tag[$:/tags/Palette]getindex[background]]" "returns all background colors defined in any of the ColourPalettes">>
+<<.operator-example 1 "[[$:/palettes/Vanilla]getindex[background]]" "returns the value of property <<.value background>> of the [[DataTiddler|DataTiddlers]] [[$:/palettes/Vanilla]]">>
-[[ListopsData]] contains an empty index <<.value ~DataIndex>> which is not returned by the filter operator:
-<<.operator-example 3 "[[ListopsData]getindex[DataIndex]]">>
+<<.operator-example 2 "[all[shadows+tiddlers]tag[$:/tags/Palette]getindex[background]]" "returns all background colors defined in any of the ColourPalettes (notice the duplicates in the resulting list)">>
-This filter expression can be used to return the value, even if it is an empty string:
-<<.operator-example 4 "[[ListopsData]] :filter[has:index[DataIndex]] :and[getindex[DataIndex]else[]]">>
+<<.tip """If a data tiddler contains a property with an empty value, the empty string is not appended to the results.""">>
-There are 5 palettes which define the index <<.value diff-equal-background>>, but none defines a value:
-<<.operator-example 5 "[all[shadows+tiddlers]tag[$:/tags/Palette]] :filter[has:index[diff-equal-background]] :map[getindex[diff-equal-background]else[]]">>
-In the above example, the [[Map Filter Run Prefix]] is used instead of `:and` as it does not de-duplicate its results.
+<<.operator-example 3 "[[ListopsData]getindex[DataIndex]]" "the empty value of the property <<.field ~DataIndex>> in [[ListopsData]] is not returned by the <<.olink getindex>> operator">>
-Another way to check if an index has an empty value is to [[count|count Operator]] the results from the [[getindex Operator]]:
-<<.operator-example 6 "[[$:/palettes/Vanilla]indexes[]] :filter[[$:/palettes/Vanilla]getindexcount[]compare:number:eq[0]]">>
-Here, the input to `:filter` is the [[list of indexes|indexes Operator]] which are contained in [[$:/palettes/Vanilla]].
\ No newline at end of file
+<<.operator-example 4 "[[ListopsData]] :filter[has:index[DataIndex]] :map[getindex[DataIndex]]" "also returns the empty string">>
+The above example works by first using the [[Filter Filter Run Prefix]] to only select titles that have the property <<.field ~DataIndex>> and then using the [[Map Filter Run Prefix]] to replace those titles with their value of that property. The [[Map Filter Run Prefix]] outputs an empty string when its filter run returns an empty [[selection|Title Selection]].
+
+<<.operator-example 5 "[[$:/palettes/Vanilla]indexes[]] :filter[[$:/palettes/Vanilla]getindexcount[]compare:number:eq[0]]" "returns those colors in [[$:/palettes/Vanilla]] which are defined, but have no value assigned">>
+In the above example, <<.olink count>> is used to check if <<.olink getindex>> returns a result (i.e. the corresponding property has a value) or not.
\ No newline at end of file
diff --git a/editions/tw5.com/tiddlers/filters/get.tid b/editions/tw5.com/tiddlers/filters/get.tid
index 8623aa6d6..818f1602f 100644
--- a/editions/tw5.com/tiddlers/filters/get.tid
+++ b/editions/tw5.com/tiddlers/filters/get.tid
@@ -1,17 +1,17 @@
+caption: get
created: 20140426183123179
-modified: 20150203185001000
+modified: 20230309163844434
+op-input: a [[selection of titles|Title Selection]]
+op-output: the values of field <<.place F>> in each of the input titles
+op-parameter: the name of a [[field|TiddlerFields]]
+op-parameter-name: F
+op-purpose: select all values of a field in the input titles
tags: [[Filter Operators]] [[Field Operators]]
title: get Operator
type: text/vnd.tiddlywiki
-caption: get
-op-purpose: select all values of a field in the input titles
-op-input: a [[selection of titles|Title Selection]]
-op-parameter: the name of a [[field|TiddlerFields]]
-op-parameter-name: F
-op-output: the values of field <<.place F>> in each of the input titles
Each input title is processed in turn. If the corresponding tiddler contains field <<.place F>>, and the value of this field is not empty, then its value is appended to the output.
-Unlike most other [[Filter Operators]], the [[selection|Title Selection]] output by <<.op get>> can contain duplicates. To avoid duplicates, use `each[F]get[F]`.
+<<.tip "Unlike most other [[Filter Operators]], the [[selection|Title Selection]] output by <<.op get>> can contain duplicates. To avoid duplicates, use `get[F]unique[]`.">>
<<.operator-examples "get">>
diff --git a/editions/tw5.com/tiddlers/filters/getindex.tid b/editions/tw5.com/tiddlers/filters/getindex.tid
index 03302cc6b..225a68252 100644
--- a/editions/tw5.com/tiddlers/filters/getindex.tid
+++ b/editions/tw5.com/tiddlers/filters/getindex.tid
@@ -1,20 +1,16 @@
caption: getindex
created: 20150203140000000
-modified: 20230306131335009
-op-purpose: select all values of a data property in the input titles
+modified: 20230309163838670
op-input: a [[selection of titles|Title Selection]]
+op-output: the values of property <<.place P>> in each of the input titles
op-parameter: the name of a [[property|DataTiddlers]]
op-parameter-name: P
-op-output: the values of property <<.place P>> in each of the input titles
+op-purpose: select all values of a data property in the input titles
tags: [[Filter Operators]] [[Field Operators]]
title: getindex Operator
-caption: getindex
-Each input title is processed in turn, and is ignored if it does not denote a [[data tiddler|DataTiddlers]]. If the tiddler contains property <<.place P>>, the value of that property is [[dominantly appended|Dominant Append]] to the output.
+Each input title is processed in turn, and is ignored if it does not denote a [[data tiddler|DataTiddlers]]. If the corresponding tiddler contains property <<.place P>>, and the value of this property is not empty, then its value is appended to the output.
-<<.tip """If a data tiddler contains index <<.place P>> with an empty value, the empty string is not appended. The following [[Filter Expression]] can be used to also return an empty string
-
:filter[has:index[P]] :and[getindex[P]else[]]
""">>
+<<.tip "Unlike most other [[Filter Operators]], the [[selection|Title Selection]] output by <<.op getindex>> can contain duplicates. To avoid duplicates, use `getindex[P]unique[]`.">>
<<.operator-examples "getindex">>
-
-
From 007b75942166e1ff138a46893250d4e62e85c85d Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Fri, 10 Mar 2023 09:41:18 +0000
Subject: [PATCH 46/83] Undefined variables in let widget: Revert fix for #7270
Reverts 8c378e0d24e9f4b8986316bc17f077b894d1eb30 and adds a test
---
core/modules/widgets/let.js | 4 +---
.../data/widgets/LetWidgetSelfReferences.tid | 15 +++++++++++++++
2 files changed, 16 insertions(+), 3 deletions(-)
create mode 100644 editions/test/tiddlers/tests/data/widgets/LetWidgetSelfReferences.tid
diff --git a/core/modules/widgets/let.js b/core/modules/widgets/let.js
index dd3aa137a..afd3a2f20 100644
--- a/core/modules/widgets/let.js
+++ b/core/modules/widgets/let.js
@@ -74,9 +74,7 @@ LetWidget.prototype.getVariableInfo = function(name,options) {
text: this.currentValueFor[name]
};
}
- return Widget.prototype.getVariableInfo.call(this,name,$tw.utils.extend(Object.create(null),options,{
- defaultValue: ""
- }));
+ return Widget.prototype.getVariableInfo.call(this,name,options);
};
/*
diff --git a/editions/test/tiddlers/tests/data/widgets/LetWidgetSelfReferences.tid b/editions/test/tiddlers/tests/data/widgets/LetWidgetSelfReferences.tid
new file mode 100644
index 000000000..b81fc7d75
--- /dev/null
+++ b/editions/test/tiddlers/tests/data/widgets/LetWidgetSelfReferences.tid
@@ -0,0 +1,15 @@
+title: Widgets/LetWidgetSelfReferences
+description: Test let widget self references
+type: text/vnd.tiddlywiki-multiple
+tags: [[$:/tags/wiki-test-spec]]
+
+title: Output
+
+\whitespace trim
+<$let default={{{ [[default]is[variable]then[aa]else[bb]] }}} >
+<>
+$let>
++
+title: ExpectedResult
+
+
bb
\ No newline at end of file
From 589813f23335bbd3b50be52ad5d5211fbbffee33 Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Fri, 10 Mar 2023 09:41:36 +0000
Subject: [PATCH 47/83] Improved fix for #7270
---
core/modules/widgets/let.js | 4 +++-
.../data/widgets/LetWidgetUndefinedVariable.tid | 15 +++++++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
create mode 100644 editions/test/tiddlers/tests/data/widgets/LetWidgetUndefinedVariable.tid
diff --git a/core/modules/widgets/let.js b/core/modules/widgets/let.js
index afd3a2f20..2b2886530 100644
--- a/core/modules/widgets/let.js
+++ b/core/modules/widgets/let.js
@@ -53,7 +53,9 @@ LetWidget.prototype.computeAttributes = function() {
name = attribute.name;
// Now that it's prepped, we're allowed to look this variable up
// when defining later variables
- self.currentValueFor[name] = value;
+ if(value !== undefined) {
+ self.currentValueFor[name] = value;
+ }
});
// Run through again, setting variables and looking for differences
$tw.utils.each(this.currentValueFor,function(value,name) {
diff --git a/editions/test/tiddlers/tests/data/widgets/LetWidgetUndefinedVariable.tid b/editions/test/tiddlers/tests/data/widgets/LetWidgetUndefinedVariable.tid
new file mode 100644
index 000000000..e6163d915
--- /dev/null
+++ b/editions/test/tiddlers/tests/data/widgets/LetWidgetUndefinedVariable.tid
@@ -0,0 +1,15 @@
+title: Widgets/LetWidgetUndefinedVariable
+description: Test let widget undefined variable
+type: text/vnd.tiddlywiki-multiple
+tags: [[$:/tags/wiki-test-spec]]
+
+title: Output
+
+\whitespace trim
+<$let test1=<> test2={{{ [] }}}>
+<>
+$let>
++
+title: ExpectedResult
+
+
\ No newline at end of file
From f247686970f246fda69925e1f7b663c3dedc6f39 Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Fri, 10 Mar 2023 12:32:52 +0000
Subject: [PATCH 48/83] Remove "const" accidentally included in #7290
See #7350
---
core/modules/filters/strings.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/modules/filters/strings.js b/core/modules/filters/strings.js
index 4a3c7c170..538dd0597 100644
--- a/core/modules/filters/strings.js
+++ b/core/modules/filters/strings.js
@@ -107,7 +107,7 @@ function diffPartsToChars(text1,text2,mode) {
var lineEnd = -1;
var lineArrayLength = lineArray.length,
regexpResult;
- const searchRegexp = /\W+/g;
+ var searchRegexp = /\W+/g;
while(lineEnd < text.length - 1) {
if(mode === "words") {
regexpResult = searchRegexp.exec(text);
From e6175227b229b8db1374b824da9dfa207d748c28 Mon Sep 17 00:00:00 2001
From: yaisog
Date: Fri, 10 Mar 2023 16:57:51 +0100
Subject: [PATCH 49/83] Add another example for the `get` operator (#7351)
---
editions/tw5.com/tiddlers/filters/examples/get.tid | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/editions/tw5.com/tiddlers/filters/examples/get.tid b/editions/tw5.com/tiddlers/filters/examples/get.tid
index de56361cf..87655d0cb 100644
--- a/editions/tw5.com/tiddlers/filters/examples/get.tid
+++ b/editions/tw5.com/tiddlers/filters/examples/get.tid
@@ -1,5 +1,5 @@
created: 20150118134611000
-modified: 20230309180521925
+modified: 20230310154010278
myfield:
tags: [[get Operator]] [[Operator Examples]]
title: get Operator (Examples)
@@ -16,4 +16,7 @@ type: text/vnd.tiddlywiki
<<.operator-example 4 "[all[current]get[myfield]]" "the empty value of field <<.field myfield>> is not returned by the <<.olink get>> operator">>
<<.operator-example 5 "[all[current]] :filter[has:field[myfield]] :map[get[myfield]]" "also returns the empty string">>
-The above example works by first using the [[Filter Filter Run Prefix]] to only select titles that have the field <<.field myfield>> and then using the [[Map Filter Run Prefix]] to replace those titles with their value of that field. The [[Map Filter Run Prefix]] outputs an empty string when its filter run returns an empty [[selection|Title Selection]].
\ No newline at end of file
+The above example works by first using the [[Filter Filter Run Prefix]] to only select titles that have the field <<.field myfield>> and then using the [[Map Filter Run Prefix]] to replace those titles with their value of that field. The [[Map Filter Run Prefix]] outputs an empty string when its filter run returns an empty [[selection|Title Selection]].
+
+<<.operator-example 6 "[all[tiddlers]] :filter[get[created]compare:date:lt{HelloThere!!created}]" "return all tiddlers that are older than [[HelloThere]]">>
+The above example demonstrates two different ways of accessing field values in filters: Use <<.olink get>> when the title is not known in advance as with the [[Filter Filter Run Prefix]] where <<.var currentTiddler>> is set to the current input title. Use a [[TextReference]] as an indirect [[Filter Parameter]] when the title is known.
From 964993f879c1d9a8232e7799ac082d0337091184 Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Sat, 11 Mar 2023 11:13:35 +0000
Subject: [PATCH 50/83] New-here: Fix unwanted double braces around tags
specified in $:/config/NewTiddler/Tags
Fixes #7354
---
core/ui/ViewToolbar/new-here.tid | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/ui/ViewToolbar/new-here.tid b/core/ui/ViewToolbar/new-here.tid
index 25721f5fd..31e8e4158 100644
--- a/core/ui/ViewToolbar/new-here.tid
+++ b/core/ui/ViewToolbar/new-here.tid
@@ -6,7 +6,7 @@ description: {{$:/language/Buttons/NewHere/Hint}}
\whitespace trim
\define newHereActions()
\whitespace trim
-<$set name="tags" filter="[] [{$:/config/NewTiddler/Tags}]">
+<$set name="tags" filter="[] [enlist{$:/config/NewTiddler/Tags}]">
<$action-sendmessage $message="tm-new-tiddler" tags=<>/>
$set>
\end
From 0a20c0810738862e83d30f38c0712436b7e27b14 Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Sun, 12 Mar 2023 15:49:37 +0000
Subject: [PATCH 51/83] Fix Typo
Thanks @timp
---
editions/tw5.com/tiddlers/concepts/JSONTiddlers.tid | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/editions/tw5.com/tiddlers/concepts/JSONTiddlers.tid b/editions/tw5.com/tiddlers/concepts/JSONTiddlers.tid
index caffd063c..1a5a77d17 100644
--- a/editions/tw5.com/tiddlers/concepts/JSONTiddlers.tid
+++ b/editions/tw5.com/tiddlers/concepts/JSONTiddlers.tid
@@ -8,4 +8,4 @@ A JSON tiddler is a [[data tiddler|DataTiddlers]] containing a [[JSON|JavaScript
Its [[ContentType]] is `application/json`.
-The [[history list|$:/HistoryList]] is an of a JSON tiddler.
+The [[history list|$:/HistoryList]] is an example of a JSON tiddler.
From 6f038e362e517606b3037a3f8b2e411e4418c16d Mon Sep 17 00:00:00 2001
From: Mario Pietsch
Date: Sun, 12 Mar 2023 17:49:15 +0100
Subject: [PATCH 52/83] External-js: fix index.html overwrites external wiki
(#7356)
---
editions/tw5.com/tiddlywiki.info | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/editions/tw5.com/tiddlywiki.info b/editions/tw5.com/tiddlywiki.info
index 1de8bdc87..7379908ee 100644
--- a/editions/tw5.com/tiddlywiki.info
+++ b/editions/tw5.com/tiddlywiki.info
@@ -52,7 +52,7 @@
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain","$:/core/templates/static.tiddler.html",
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"],
"external-js": [
- "--render","$:/core/save/offline-external-js","index.html","text/plain",
+ "--render","$:/core/save/offline-external-js","[[external-]addsuffixaddsuffix[.html]]","text/plain",
"--render","$:/core/templates/tiddlywiki5.js","[[tiddlywikicore-]addsuffixaddsuffix[.js]]","text/plain"]
},
"config": {
From aa5a6627e65f46d534397753e79f2e577a951003 Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Sun, 12 Mar 2023 17:02:16 +0000
Subject: [PATCH 53/83] Revert "Use sticky flag to improve regexp search
performance (#7297)"
This reverts commit e313857822879187cda8ea1681a73b4a65ef845f.
---
core/modules/parsers/parseutils.js | 17 ++++++++---------
core/modules/parsers/wikiparser/rules/html.js | 6 +++---
core/modules/parsers/wikiparser/rules/image.js | 2 +-
3 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/core/modules/parsers/parseutils.js b/core/modules/parsers/parseutils.js
index 1c7525588..925674056 100644
--- a/core/modules/parsers/parseutils.js
+++ b/core/modules/parsers/parseutils.js
@@ -84,8 +84,7 @@ exports.parseTokenString = function(source,pos,token) {
};
/*
-Look for a token matching a regex at a specified position. Returns null if not found, otherwise returns {type: "regexp", match:, start:, end:,}
-Use the "Y" (sticky) flag to avoid searching the entire rest of the string
+Look for a token matching a regex. Returns null if not found, otherwise returns {type: "regexp", match:, start:, end:,}
*/
exports.parseTokenRegExp = function(source,pos,reToken) {
var node = {
@@ -146,7 +145,7 @@ exports.parseMacroParameter = function(source,pos) {
start: pos
};
// Define our regexp
- var reMacroParameter = /(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|((?:(?:>(?!>))|[^\s>"'])+)))/y;
+ var reMacroParameter = /(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|((?:(?:>(?!>))|[^\s>"'])+)))/g;
// Skip whitespace
pos = $tw.utils.skipWhiteSpace(source,pos);
// Look for the parameter
@@ -185,7 +184,7 @@ exports.parseMacroInvocation = function(source,pos) {
params: []
};
// Define our regexps
- var reMacroName = /([^\s>"'=]+)/y;
+ var reMacroName = /([^\s>"'=]+)/g;
// Skip whitespace
pos = $tw.utils.skipWhiteSpace(source,pos);
// Look for a double less than sign
@@ -222,7 +221,7 @@ exports.parseFilterVariable = function(source) {
params: [],
},
pos = 0,
- reName = /([^\s"']+)/y;
+ reName = /([^\s"']+)/g;
// If there is no whitespace or it is an empty string then there are no macro parameters
if(/^\S*$/.test(source)) {
node.name = source;
@@ -247,10 +246,10 @@ exports.parseAttribute = function(source,pos) {
start: pos
};
// Define our regexps
- var reAttributeName = /([^\/\s>"'=]+)/y,
- reUnquotedAttribute = /([^\/\s<>"'=]+)/y,
- reFilteredValue = /\{\{\{([\S\s]+?)\}\}\}/y,
- reIndirectValue = /\{\{([^\}]+)\}\}/y;
+ var reAttributeName = /([^\/\s>"'=]+)/g,
+ reUnquotedAttribute = /([^\/\s<>"'=]+)/g,
+ reFilteredValue = /\{\{\{([\S\s]+?)\}\}\}/g,
+ reIndirectValue = /\{\{([^\}]+)\}\}/g;
// Skip whitespace
pos = $tw.utils.skipWhiteSpace(source,pos);
// Get the attribute name
diff --git a/core/modules/parsers/wikiparser/rules/html.js b/core/modules/parsers/wikiparser/rules/html.js
index fdaae03ba..7fc4bb96e 100644
--- a/core/modules/parsers/wikiparser/rules/html.js
+++ b/core/modules/parsers/wikiparser/rules/html.js
@@ -48,7 +48,7 @@ exports.parse = function() {
// Advance the parser position to past the tag
this.parser.pos = tag.end;
// Check for an immediately following double linebreak
- var hasLineBreak = !tag.isSelfClosing && !!$tw.utils.parseTokenRegExp(this.parser.source,this.parser.pos,/([^\S\n\r]*\r?\n(?:[^\S\n\r]*\r?\n|$))/y);
+ var hasLineBreak = !tag.isSelfClosing && !!$tw.utils.parseTokenRegExp(this.parser.source,this.parser.pos,/([^\S\n\r]*\r?\n(?:[^\S\n\r]*\r?\n|$))/g);
// Set whether we're in block mode
tag.isBlock = this.is.block || hasLineBreak;
// Parse the body if we need to
@@ -78,7 +78,7 @@ exports.parseTag = function(source,pos,options) {
orderedAttributes: []
};
// Define our regexps
- var reTagName = /([a-zA-Z0-9\-\$]+)/y;
+ var reTagName = /([a-zA-Z0-9\-\$]+)/g;
// Skip whitespace
pos = $tw.utils.skipWhiteSpace(source,pos);
// Look for a less than sign
@@ -129,7 +129,7 @@ exports.parseTag = function(source,pos,options) {
pos = token.end;
// Check for a required line break
if(options.requireLineBreak) {
- token = $tw.utils.parseTokenRegExp(source,pos,/([^\S\n\r]*\r?\n(?:[^\S\n\r]*\r?\n|$))/y);
+ token = $tw.utils.parseTokenRegExp(source,pos,/([^\S\n\r]*\r?\n(?:[^\S\n\r]*\r?\n|$))/g);
if(!token) {
return null;
}
diff --git a/core/modules/parsers/wikiparser/rules/image.js b/core/modules/parsers/wikiparser/rules/image.js
index 9bfce99d2..6b379d9c5 100644
--- a/core/modules/parsers/wikiparser/rules/image.js
+++ b/core/modules/parsers/wikiparser/rules/image.js
@@ -116,7 +116,7 @@ exports.parseImage = function(source,pos) {
// Skip whitespace
pos = $tw.utils.skipWhiteSpace(source,pos);
// Get the source up to the terminating `]]`
- token = $tw.utils.parseTokenRegExp(source,pos,/(?:([^|\]]*?)\|)?([^\]]+?)\]\]/y);
+ token = $tw.utils.parseTokenRegExp(source,pos,/(?:([^|\]]*?)\|)?([^\]]+?)\]\]/g);
if(!token) {
return null;
}
From 308e207a6778a3b6fe9544df20d637f23efa3d98 Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Sun, 12 Mar 2023 17:03:19 +0000
Subject: [PATCH 54/83] Remove reference to #7297 from release note
---
editions/prerelease/tiddlers/Release 5.2.6.tid | 1 -
1 file changed, 1 deletion(-)
diff --git a/editions/prerelease/tiddlers/Release 5.2.6.tid b/editions/prerelease/tiddlers/Release 5.2.6.tid
index 3e4410a6a..f2c0ef4b3 100644
--- a/editions/prerelease/tiddlers/Release 5.2.6.tid
+++ b/editions/prerelease/tiddlers/Release 5.2.6.tid
@@ -100,7 +100,6 @@ Improvements to the following translations:
! Performance Improvements
-* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7297">> wikitext parsing to use "sticky" flag for improved performance
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7299">> field indexer to more efficiently process lookups
! Acknowledgements
From 95f987544cf13c2acc9e1664db1f42eba5a9cc55 Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Tue, 14 Mar 2023 14:50:52 +0000
Subject: [PATCH 55/83] Update save wiki "dirty" state icon
See https://talk.tiddlywiki.org/t/now-is-the-time-to-help-with-testing-the-tiddlywiki-v5-2-6-prerelease/6405/60
Addendum to #7232
---
core/images/save-button-dynamic.tid | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/core/images/save-button-dynamic.tid b/core/images/save-button-dynamic.tid
index d0aa13f83..02e66df17 100644
--- a/core/images/save-button-dynamic.tid
+++ b/core/images/save-button-dynamic.tid
@@ -5,8 +5,7 @@ tags: $:/tags/Image
-
-
-
+
+
\ No newline at end of file
From c9e1b91099bbb2e93544433c04a26857f802a296 Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Sat, 18 Mar 2023 16:02:55 +0000
Subject: [PATCH 56/83] Simplify save wiki button dirty state
Thanks to Thomas_Chuffart at https://talk.tiddlywiki.org/t/now-is-the-time-to-help-with-testing-the-tiddlywiki-v5-2-6-prerelease/6405/66
Addendum to #7232
---
core/images/save-button-dynamic.tid | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/core/images/save-button-dynamic.tid b/core/images/save-button-dynamic.tid
index 02e66df17..e88312aac 100644
--- a/core/images/save-button-dynamic.tid
+++ b/core/images/save-button-dynamic.tid
@@ -5,7 +5,7 @@ tags: $:/tags/Image
-
-
+
+
\ No newline at end of file
From 4ae2d8422b28eaa80e3122e37c3cba8910bf3e9c Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Mon, 20 Mar 2023 14:58:33 +0000
Subject: [PATCH 57/83] Revert to original icon for "dirty" version of save
wiki icon
This restores the circle-in-a-circle image first introduced in #7232
---
core/images/save-button-dynamic.tid | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/core/images/save-button-dynamic.tid b/core/images/save-button-dynamic.tid
index e88312aac..d0aa13f83 100644
--- a/core/images/save-button-dynamic.tid
+++ b/core/images/save-button-dynamic.tid
@@ -6,6 +6,7 @@ tags: $:/tags/Image
-
+
+
\ No newline at end of file
From da1825e6c5652568df79c8bf5168691ee9ff665a Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Mon, 20 Mar 2023 15:10:38 +0000
Subject: [PATCH 58/83] Update release note
---
editions/prerelease/tiddlers/Release 5.2.6.tid | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/editions/prerelease/tiddlers/Release 5.2.6.tid b/editions/prerelease/tiddlers/Release 5.2.6.tid
index f2c0ef4b3..143d73bd5 100644
--- a/editions/prerelease/tiddlers/Release 5.2.6.tid
+++ b/editions/prerelease/tiddlers/Release 5.2.6.tid
@@ -28,6 +28,7 @@ type: text/vnd.tiddlywiki
Improvements to the following translations:
* Chinese
+* German
* Italian
* Polish
@@ -38,6 +39,7 @@ Improvements to the following translations:
* <<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/commit/524cee1489f260375cac8cfe878fdc5942a4596e">> [[XLSX Plugin|XLSX Utilities Edition]] to handle importing numeric fields
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/81f514116657d0d567be7a4c45762a85beaa8bc0">> Dynannotate plugin crash when using the fake DOM used for static rendering
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7281">> bug where pasting text into the CodeMirror editor also opened an `$:/Import` tiddler
+* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7334">> documentation for the [[Railroad Plugin]]
! Accessibility Improvements
@@ -88,6 +90,7 @@ Improvements to the following translations:
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7243">> usage of `importTitle` and `autoOpenOnImport` options for [[WidgetMessage: tm-import-tiddlers]]
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7276">> fixed text editor refresh when the palette is changed
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7270">> crash with LetWidget when referencing a variable that exists but has an undefined value
+* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7354">> unwanted double braces around tags specified in $:/config/NewTiddler/Tags when using "new here" button
! Node.js Improvements
@@ -127,6 +130,7 @@ m42e
Marxsal
mateuszwilczek
newmedicine
+michsa
pippep
pmario
saqimtiaz
From 4cddfa228bef3316d99abf67fba572a2b1c2bd4e Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Mon, 20 Mar 2023 18:28:07 +0000
Subject: [PATCH 59/83] New release banner for v5.2.6
See competition at https://talk.tiddlywiki.org/t/vote-for-the-tiddlywiki-banner-v5-2-6/6469
---
.../tiddlers/images/New Release Banner.png | Bin 69195 -> 45900 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
diff --git a/editions/tw5.com/tiddlers/images/New Release Banner.png b/editions/tw5.com/tiddlers/images/New Release Banner.png
index 6cacb3e3dd58df0e074250a57768443b69aadc33..3fcd908434d8e27538443cd64957a1b44e0f83f0 100644
GIT binary patch
literal 45900
zcmV)4K+3;~P)Fna>;s7mef?*uW&C3B4H&}M3vbDF+TmUd)lmktSNS@(DBm`V=
zjQRTa0AA`YGeX+l+O)#cW@~huugVHTf1;(OS6gPx(%Np4v;bY=`1$Yc^6dap#P$01
z0t+9IsLOGhz8fMlEMvVFXP&{z)P#Lo2|RVOPXMrQLA}Dkig9ukjMCNGfTqwU
zP=v$M;@#omE`!qmDPtrQ1BH#Eo4ehTow{X774h-z09@UrtiQf=FaTxp($&+}=<(Fz
z??+5o047?Cnzas2j(duwZ=uovVdMZ=)S|=V|8M|wimMiC)-sOZ+iVa3GIL06oB&0p
z^7ZkAldHqW!~jmafjIz?wAp)mWwX1;dwhjhinhPY+VJn~06mteXB5rb>;3-xJ$$kO
zT+OPiu>c}ela!p?K%)b0WV
z4ggED05_uv
zIzUhTZvb?3d;n+qfwJR|x#R2Z>Z#4`waVpFg|d*EsBDa~NRG~wpS5qU=tG0JPB#y5
zle@LLxx~oJqKa
zaEVi-s^Xcd0PE%l)q`WC@!d)6ZK|%Zvbw#+jeSxte8+ZD
z754l206B#_b*#+d@yTfn%gxkRj?|IC@43Fb&C$~UR@08G)O?)21as?eb8Pf&1EXtH
z)!N#tz1L!_>HtZko3z(`f{MM(
z4Sba4nJ*k!@?bD_)ucg6*}M+}d%AQj455h#bcQC2raFM4GC*mN!9)=f4qN;Y{53tU
ze69o89_u(Yejl4s@Lh>BXIK_qrjJhzb;^Eeu@DdMvm%L7J
z!`|dI^TbzMF&?tu#fyi*#fA<5MIR4i#`BDSHbo16kFz`a+F+#k`~iJ641^)nAb=6y
zLIfa$p+5Z3V|f4nIGA}^Dd9TQo<%8?fUiFI3Voe~5d_8UTAPY_m!go1{_0I5OfrgWa^KiPM
zILniGd6NM~LZh{nLdL>GBw*eQzv}$5a$4XYytrVRD>p>&o6O#g_UW+rl#ItmJ)Q}
zGxmrg8O}5DpoKz^L9`;}iPS3W747R6zKG*5p4ld&IR0)!hNh6RIRG6{o#5>6pw
zShfstQjCN}z#d5qC74NKN>(#WTo8;UR$5zIBLLGHabe-tOC=O{D+u|$7Sf!gBJ5Gz
zWr~7^NW*2Dc-Qbjwh0+1&q*_e%(e7{#*4-b!5XHYfT0$}(%C|;63s9Y#SAP7A&w36
z<$#RIM*=OxHcL)(ByhwS=1n18-V8Mo0HA)_i#Vq(ewp7yE=@cD7!MPRCoNdGiSwkJ
z6e4xK093YZqfpt#j=?x3CeyfJ9Cx9_*LaDGYv=n4FbXUd%Lu*eLQW!RhL9xYiq(J*
zrl$378vgDh&<7Jf{kQJ}H$5_i!{TyTjHERtn{>LqAyT!2X@
zEX>F|fQpRCPs&S|222>=T*SSXz~ObE
z*a~sDNW~(+0_a$^ioWv?RaHIoZIytGwo$fmvI9$T9-<+J`O&h$jJ<>&0#_+lS1IcE
zNNQ1^aVBEHK9I<+AfE3d-;O)p;>Qw%bBqYkX;Q&}ks9VrPfCXXQDDUjNTKh!X_;31
zBhNI2Ta%~l%56~Z#y=p3mf
z%)1F>1$6Mkb2vibR!N8K4EbUqMu3GwV^sk?bLOflQR5`0S-rb!xW5GzXCAM$cO=v%L9z(
z%pz&l*LXo7Fn-p?j@viFhylEC_TW$fu)v{snIlgD{9&M3Ri!~A-EPSw}c{ji9{Yt2q-@$JQ{a7
zfYF{R<`oYUnuh>m_)l)TWH?80&rTI_v0Jijn}!R+#~64Y(=G1`&=kyp?+`Rog`6i5
z6E4xdlktyG`c`Ac7avp-@OK0lt~YWL&sLIBgzcodVW`dsla$e364ovW7uTprua_kn
z*H6H>lRa9~;#4(GC>qXo5GJYD%rIEOaqZe&Z4#z`;uQYD;hIBDwb&OwD6(DxuC@F-)J_yj9
zLPVo56AaQwMT4CJoUS&s47;%tL6-%VbS{X2E9h3cCSY)KDZ}8x2}aaFXuv4tqODRQ
zfwD;~(#xw8E<>TT8b4+I0?&x;YHtHYTcml?Z-|IO%ck6E01z)C{vy;1N6RUWl|}L#
zKYko;Icz9q05%qAdL(WnXdK!%SeT;AXEKTGk~f_r#iXP8#PNv8QwPZ$nXmX
z48u$JDL@Ow$U%ydgY0PF6mBi#R5Qk+ngU5R^jB%G$wo|E;UsQUIT$5Z9|q4D>84-;
zDi{_-e!p*EBoR^TfHPV+dZ&;gZYW>^>|&WD5*FZv2Z@`SkYzCgJkmvSY1%k0oU}7a
zI%XFSR={wVMj9k8cgHY#DO_}%L1h?wqc_8bY1|waW@;;C8Z3oHj7Df+?rYaO@{)n1
zGLQ
z@`c%zelw2B2(SY7tQ;g(!ogZ#4^>IwRHG2Q0xy(ZII|2JuveS`^d7^_uwk5Nju$Ff
zvsDRUO*1H>ClgJ&q%%iD8VrG
zR@zcI)1Fny0C<6`eTvfyfP&&ffMxNzb#TLQ!_MAe+(dD<;RZ@e8s#`?mch{^oLVC4
z?(f(liDYs@rFs%3!U&2UGSdWZ5Q#`zCr~AoDyA}vVnj+QfdY3yQ-kkthT+ND+)Wa4
zt97X+7B{YL5+rU=J*T^z!9!);+Mnk9B3vVi1j;599}_38TX*TwI&{VYcsOc+ZvZz^
z3vX4PlVO;6EYC`16Qc}VhGKl2o6I!Abk
zWfUfm6EFiX%pOtK=pZN-Ml9<9FBdLd7zgJPKu5rbnJRz{Q#A*<6xNX8B*R&Thw@4S
zsRAWqP!+JdET%tYnu<>nk-wtD1RCNJKaiea7ARv9p;2MV)o)sZM%yH9pz?xgY7Us7
zb7Y|+Ke9N+aA@KNLqz{b+$^fXbrGfjuEzof>z6qY+GTiQ(gnZ*IJp34oIG$(kj>%&
z0Gz#hhwVMcrEsBwjLcA0Rq1LgPoxSgXDLpM2#vEmroSOz1(>u7%y1(lKZoPaPzNc_
z$PVE4w}gTkuM5v$=i2UPOXqn(h7pE{5UOQ}ir