1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-05-28 00:02:17 +00:00

Compare commits

..

5 Commits

Author SHA1 Message Date
Jeremy Ruston a812313072 Another pesky function wrapper 2026-02-24 11:00:27 +00:00
Jeremy Ruston f85cbeda70 Remove function wrapper
Thanks @Leilei332
2026-02-24 10:58:02 +00:00
Jeremy Ruston e9e22598ad Merge branch 'master' into wikify-operator 2026-02-24 10:44:01 +00:00
Jeremy Ruston 1e47b88dc7 Merge branch 'master' into wikify-operator 2025-06-03 16:39:19 +01:00
Jeremy Ruston 55cf0b2965 Add wikify operator 2024-11-07 16:26:07 +00:00
142 changed files with 1152 additions and 2186 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ on:
- master
- tiddlywiki-com
env:
NODE_VERSION: "22.22"
NODE_VERSION: "22"
jobs:
test:
runs-on: ubuntu-latest
+2 -2
View File
@@ -20,7 +20,7 @@ jobs:
steps:
- name: build-size-check
id: get_sizes
uses: TiddlyWiki/cerebrus@v8
uses: TiddlyWiki/cerebrus@v7
with:
pr_number: ${{ github.event.pull_request.number }}
repo: ${{ github.repository }}
@@ -52,4 +52,4 @@ jobs:
pr_size: '${{ needs.calculate-build-size.outputs.pr_size }}',
base_size: '${{ needs.calculate-build-size.outputs.base_size }}'
}
});
});
+1 -1
View File
@@ -25,7 +25,7 @@ jobs:
steps:
- name: Build and check size
uses: TiddlyWiki/cerebrus@v8
uses: TiddlyWiki/cerebrus@v7
with:
pr_number: ${{ inputs.pr_number }}
repo: ${{ github.repository }}
+2 -2
View File
@@ -15,7 +15,7 @@ jobs:
steps:
# Step 1: Validate PR paths
- name: Validate PR Paths
uses: TiddlyWiki/cerebrus@v8
uses: TiddlyWiki/cerebrus@v6
with:
pr_number: ${{ github.event.pull_request.number }}
repo: ${{ github.repository }}
@@ -26,7 +26,7 @@ jobs:
# Step 2: Validate change notes
- name: Validate Change Notes
uses: TiddlyWiki/cerebrus@v8
uses: TiddlyWiki/cerebrus@v7
with:
pr_number: ${{ github.event.pull_request.number }}
repo: ${{ github.repository }}
+1 -11
View File
@@ -2,20 +2,10 @@
.c9/
.vs/
.vscode/
.claude/
# TiddlyWiki
tmp/
output/
node_modules/
$__StoryList.tid
# Playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
/playwright/.auth/
test-screenshots/
test-output.txt
.playwright-mcp
# TiddlyWiki MPC
.tw-mcp
$__StoryList.tid
+3 -7
View File
@@ -47,13 +47,6 @@ $tw.utils.hop = function(object,property) {
/** @deprecated Use Array.isArray instead */
$tw.utils.isArray = (value) => Array.isArray(value);
/*
Determine if a value is a date, even across VM boundaries
*/
$tw.utils.isDate = function(value) {
return Object.prototype.toString.call(value) === "[object Date]";
};
/*
Check if an array is equal by value and by reference.
*/
@@ -131,6 +124,9 @@ $tw.utils.pushTop = function(array,value) {
return array;
};
/** @deprecated Use instanceof Date instead */
$tw.utils.isDate = (value) => value instanceof Date;
/** @deprecated Use array iterative methods instead */
$tw.utils.each = function(object,callback) {
if(object) {
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,7 +1,6 @@
created: 20250909171928024
modified: 20251110133437795
tags: Community/Team
leader: @kjharcombe
team: @MotovunJack
title: Infrastructure Team
@@ -13,4 +12,4 @@ The infrastructure includes:
* github.com/TiddlyWiki
* tiddlywiki.com DNS
* Netlify account for PR previews
* edit.tiddlywiki.com
* edit.tiddlywiki.com
+5 -5
View File
@@ -14,31 +14,31 @@ Export our filter function
*/
exports.sort = function(source,operator,options) {
var results = prepare_results(source);
options.wiki.sortTiddlers(results,operator.operand || "title",operator.prefix === "!",false,false);
options.wiki.sortTiddlers(results,operator.operands[0] || "title",operator.prefix === "!",false,false,undefined,operator.operands[1]);
return results;
};
exports.nsort = function(source,operator,options) {
var results = prepare_results(source);
options.wiki.sortTiddlers(results,operator.operand || "title",operator.prefix === "!",false,true);
options.wiki.sortTiddlers(results,operator.operands[0] || "title",operator.prefix === "!",false,true,undefined,operator.operands[1]);
return results;
};
exports.sortan = function(source, operator, options) {
var results = prepare_results(source);
options.wiki.sortTiddlers(results, operator.operand || "title", operator.prefix === "!",false,false,true);
options.wiki.sortTiddlers(results, operator.operands[0] || "title", operator.prefix === "!",false,false,true,operator.operands[1]);
return results;
};
exports.sortcs = function(source,operator,options) {
var results = prepare_results(source);
options.wiki.sortTiddlers(results,operator.operand || "title",operator.prefix === "!",true,false);
options.wiki.sortTiddlers(results,operator.operands[0] || "title",operator.prefix === "!",true,false,undefined,operator.operands[1]);
return results;
};
exports.nsortcs = function(source,operator,options) {
var results = prepare_results(source);
options.wiki.sortTiddlers(results,operator.operand || "title",operator.prefix === "!",true,true);
options.wiki.sortTiddlers(results,operator.operands[0] || "title",operator.prefix === "!",true,true,undefined,operator.operands[1]);
return results;
};
+34
View File
@@ -0,0 +1,34 @@
/*\
title: $:/core/modules/filters/wikify.js
type: application/javascript
module-type: filteroperator
Filter operator wikifying each string in the input list and returning the result as a list of strings
\*/
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.wikify = function(source,operator,options) {
var output = operator.operands[0],
mode = operator.operands[1],
type = operator.operands[2],
results = [];
source(function(tiddler,title) {
var wikifier = new $tw.utils.Wikifier({
wiki: options.wiki,
widget: options.widget,
text: title,
type: type,
mode: mode,
output: output
});
results.push(wikifier.getResult());
});
return results;
};
+63 -79
View File
@@ -107,7 +107,7 @@ exports.parseStringLiteral = function(source,pos) {
type: "string",
start: pos
};
var reString = /(?:"""([\s\S]*?)"""|"([^"]*)")|(?:'([^']*)')|\[\[((?:[^\]]|\](?!\]))*)\]\]/y;
var reString = /(?:"""([\s\S]*?)"""|"([^"]*)")|(?:'([^']*)')|\[\[((?:[^\]]|\](?!\]))*)\]\]/g;
reString.lastIndex = pos;
var match = reString.exec(source);
if(match && match.index === pos) {
@@ -221,7 +221,7 @@ exports.parseMacroInvocationAsTransclusion = function(source,pos) {
orderedAttributes: []
};
// Define our regexps
var reVarName = /([^\s>"'=:]+)/y;
var reVarName = /([^\s>"'=:]+)/g;
// Skip whitespace
pos = $tw.utils.skipWhiteSpace(source,pos);
// Look for a double opening angle bracket
@@ -237,11 +237,9 @@ exports.parseMacroInvocationAsTransclusion = function(source,pos) {
}
$tw.utils.addAttributeToParseTreeNode(node,"$variable",token.match[1]);
pos = token.end;
// Check that the tag is terminated by a space or >>, and that there is a closing >> somewhere ahead
if(!(source.charAt(pos) === ">" && source.charAt(pos + 1) === ">") ) {
if(!$tw.utils.parseWhiteSpace(source,pos) || source.indexOf(">>",pos) === -1) {
return null;
}
// Check that the tag is terminated by a space or >>
if(!$tw.utils.parseWhiteSpace(source,pos) && !(source.charAt(pos) === ">" && source.charAt(pos + 1) === ">") ) {
return null;
}
// Process attributes
pos = $tw.utils.parseMacroParametersAsAttributes(node,source,pos);
@@ -269,7 +267,7 @@ exports.parseMVVReferenceAsTransclusion = function(source,pos) {
orderedAttributes: []
};
// Define our regexps
var reVarName = /([^\s>"'=:)]+)/y;
var reVarName = /([^\s>"'=:)]+)/g;
// Skip whitespace
pos = $tw.utils.skipWhiteSpace(source,pos);
// Look for a double opening parenthesis
@@ -325,17 +323,17 @@ exports.parseMacroParameterAsAttribute = function(source,pos) {
start: pos
};
// Define our regexps
var reAttributeName = /([^\/\s>"'`=:]+)/y,
reUnquotedAttribute = /((?:(?:>(?!>))|[^\s>"'])+)/y,
reFilteredValue = /\{\{\{([\S\s]+?)\}\}\}/y,
reIndirectValue = /\{\{([^\}]+)\}\}/y,
reSubstitutedValue = /(?:```([\s\S]*?)```|`([^`]|[\S\s]*?)`)/y;
var reAttributeName = /([^\/\s>"'`=:]+)/g,
reUnquotedAttribute = /((?:(?:>(?!>))|[^\s>"'])+)/g,
reFilteredValue = /\{\{\{([\S\s]+?)\}\}\}/g,
reIndirectValue = /\{\{([^\}]+)\}\}/g,
reSubstitutedValue = /(?:```([\s\S]*?)```|`([^`]|[\S\s]*?)`)/g;
// Skip whitespace
pos = $tw.utils.skipWhiteSpace(source,pos);
// Get the attribute name and the separator token
var nameToken = $tw.utils.parseTokenRegExp(source,pos,reAttributeName),
namePos = nameToken && $tw.utils.skipWhiteSpace(source,nameToken.end),
separatorToken = nameToken && $tw.utils.parseTokenRegExp(source,namePos,/=|:/y),
separatorToken = nameToken && $tw.utils.parseTokenRegExp(source,namePos,/=|:/g),
isNewStyleSeparator = false; // If there is no separator then we don't allow new style values
// If we have a name and a separator then we have a named attribute
if(nameToken && separatorToken) {
@@ -347,78 +345,64 @@ exports.parseMacroParameterAsAttribute = function(source,pos) {
}
// Skip whitespace
pos = $tw.utils.skipWhiteSpace(source,pos);
do {
// Look for a string literal
var stringLiteral = $tw.utils.parseStringLiteral(source,pos);
if(stringLiteral) {
pos = stringLiteral.end;
node.type = "string";
node.value = stringLiteral.value;
// Mark the value as having been quoted in the source
node.quoted = true;
break;
}
if(isNewStyleSeparator) {
// Look for a filtered value
var filteredValue = $tw.utils.parseTokenRegExp(source,pos,reFilteredValue);
if(filteredValue) {
pos = filteredValue.end;
node.type = "filtered";
node.filter = filteredValue.match[1];
break;
}
// Look for a string literal
var stringLiteral = $tw.utils.parseStringLiteral(source,pos);
if(stringLiteral) {
pos = stringLiteral.end;
node.type = "string";
node.value = stringLiteral.value;
// Mark the value as having been quoted in the source
node.quoted = true;
} else {
// Look for a filtered value
var filteredValue = $tw.utils.parseTokenRegExp(source,pos,reFilteredValue);
if(filteredValue && isNewStyleSeparator) {
pos = filteredValue.end;
node.type = "filtered";
node.filter = filteredValue.match[1];
} else {
// Look for an indirect value
var indirectValue = $tw.utils.parseTokenRegExp(source,pos,reIndirectValue);
if(indirectValue) {
if(indirectValue && isNewStyleSeparator) {
pos = indirectValue.end;
node.type = "indirect";
node.textReference = indirectValue.match[1];
break;
}
// Look for a macro invocation value
var macroInvocation = $tw.utils.parseMacroInvocationAsTransclusion(source,pos);
if(macroInvocation) {
pos = macroInvocation.end;
node.type = "macro";
node.value = macroInvocation;
break;
}
// Look for an MVV reference value
var mvvReference = $tw.utils.parseMVVReferenceAsTransclusion(source,pos);
if(mvvReference) {
pos = mvvReference.end;
node.type = "macro";
node.value = mvvReference;
node.isMVV = true;
break;
}
// Look for a substituted value
var substitutedValue = $tw.utils.parseTokenRegExp(source,pos,reSubstitutedValue);
if(substitutedValue) {
pos = substitutedValue.end;
node.type = "substituted";
node.rawValue = substitutedValue.match[1] || substitutedValue.match[2];
break;
} else {
// Look for a macro invocation value
var macroInvocation = $tw.utils.parseMacroInvocationAsTransclusion(source,pos);
if(macroInvocation && isNewStyleSeparator) {
pos = macroInvocation.end;
node.type = "macro";
node.value = macroInvocation;
} else {
// Look for an MVV reference value
var mvvReference = $tw.utils.parseMVVReferenceAsTransclusion(source,pos);
if(mvvReference && isNewStyleSeparator) {
pos = mvvReference.end;
node.type = "macro";
node.value = mvvReference;
node.isMVV = true;
} else {
var substitutedValue = $tw.utils.parseTokenRegExp(source,pos,reSubstitutedValue);
if(substitutedValue && isNewStyleSeparator) {
pos = substitutedValue.end;
node.type = "substituted";
node.rawValue = substitutedValue.match[1] || substitutedValue.match[2];
} else {
// Look for a unquoted value
var unquotedValue = $tw.utils.parseTokenRegExp(source,pos,reUnquotedAttribute);
if(unquotedValue) {
pos = unquotedValue.end;
node.type = "string";
node.value = unquotedValue.match[1];
} else {
}
}
}
}
}
}
// Look for a unquoted value
var unquotedValue = $tw.utils.parseTokenRegExp(source,pos,reUnquotedAttribute);
if(unquotedValue) {
pos = unquotedValue.end;
node.type = "string";
node.value = unquotedValue.match[1];
break; // redundant, but leaving for consistency
}
} while(false);
}
// Bail if we don't have a value
if(!node.type) {
return null;
-54
View File
@@ -1,54 +0,0 @@
/*\
title: $:/core/modules/relinkers/tiddlers.js
type: application/javascript
module-type: relinker
Relinks the tags and list fields of tiddlers.
Calls a tw-relinking-tiddler hook for every altered tiddler.
\*/
exports.name = "tiddlers";
exports.relink = function(wiki,fromTitle,toTitle,options) {
wiki.each(function(tiddler,title) {
var type = tiddler.fields.type || "";
// Don't touch plugins or JavaScript modules
if(!tiddler.fields["plugin-type"] && type !== "application/javascript") {
var tags = tiddler.fields.tags ? tiddler.fields.tags.slice(0) : undefined,
list = tiddler.fields.list ? tiddler.fields.list.slice(0) : undefined,
isModified = false,
processList = function(listField) {
if(listField && listField.indexOf(fromTitle) !== -1) {
// Remove any existing instances of the toTitle
var p = listField.indexOf(toTitle);
while(p !== -1) {
listField.splice(p,1);
p = listField.indexOf(toTitle);
}
// Replace the fromTitle with toTitle
$tw.utils.each(listField,function (title,index) {
if(title === fromTitle) {
listField[index] = toTitle;
isModified = true;
}
});
}
};
if(!options.dontRenameInTags) {
// Rename tags
processList(tags);
}
if(!options.dontRenameInLists) {
// Rename lists
processList(list);
}
if(isModified) {
var newTiddler = new $tw.Tiddler(tiddler,{tags: tags, list: list},wiki.getModificationFields());
newTiddler = $tw.hooks.invokeHook("th-relinking-tiddler",newTiddler,tiddler);
wiki.addTiddler(newTiddler);
}
}
});
};
+105
View File
@@ -0,0 +1,105 @@
/*\
title: $:/core/modules/utils/wikifier.js
type: application/javascript
module-type: utils
A high level helper class for parsing and wikification
\*/
/*
Options include:
wiki: wiki to be used for wikification
widget: optional widget to be used as parent of wikified text
text: text to be parsed/wikified
type: type of the text
mode: inline or block
output: text, formattedtext, html, parsetree or widgettree
*/
function Wikifier(options) {
this.wiki = options.wiki || $tw.wiki;
this.widget = options.widget || $tw.rootWidget;
this.text = options.text || "";
this.type = options.type || "";
this.mode = options.mode || "block";
this.output = options.output || "text";
// Create the parse tree
this.parser = this.wiki.parseText(this.type,this.text,{
parseAsInline: this.mode === "inline"
});
// Create the widget tree
this.widgetNode = this.wiki.makeWidget(this.parser,{
document: $tw.fakeDocument,
parentWidget: this.widget
});
// Render the widget tree to the container
this.container = $tw.fakeDocument.createElement("div");
this.widgetNode.render(this.container,null);
};
Wikifier.prototype.refresh = function(changedTiddlers) {
// Refresh the widget tree
return this.widgetNode.refresh(changedTiddlers);
};
/*
Return the result string
*/
Wikifier.prototype.getResult = function() {
var result;
switch(this.output) {
case "text":
result = this.container.textContent;
break;
case "formattedtext":
result = this.container.formattedTextContent;
break;
case "html":
result = this.container.innerHTML;
break;
case "parsetree":
result = JSON.stringify(this.parser.tree,0,$tw.config.preferences.jsonSpaces);
break;
case "widgettree":
result = JSON.stringify(this.getWidgetTree(),0,$tw.config.preferences.jsonSpaces);
break;
}
return result;
};
/*
Return a string of the widget tree
*/
Wikifier.prototype.getWidgetTree = function() {
var copyNode = function(widgetNode,resultNode) {
var type = widgetNode.parseTreeNode.type;
resultNode.type = type;
switch(type) {
case "element":
resultNode.tag = widgetNode.parseTreeNode.tag;
break;
case "text":
resultNode.text = widgetNode.parseTreeNode.text;
break;
}
if(Object.keys(widgetNode.attributes || {}).length > 0) {
resultNode.attributes = {};
$tw.utils.each(widgetNode.attributes,function(attr,attrName) {
resultNode.attributes[attrName] = widgetNode.getAttribute(attrName);
});
}
if(Object.keys(widgetNode.children || {}).length > 0) {
resultNode.children = [];
$tw.utils.each(widgetNode.children,function(widgetChildNode) {
var node = {};
resultNode.children.push(node);
copyNode(widgetChildNode,node);
});
}
},
results = {};
copyNode(this.widgetNode,results);
return results;
};
exports.Wikifier = Wikifier;
+2 -2
View File
@@ -61,7 +61,7 @@ LogWidget.prototype.log = function() {
$tw.utils.each(this.parseTreeNode.attributes,function(attribute,name) {
if(name.substring(0,2) !== "$$") {
var resultList = self.computeAttribute(attribute,{asList: true});
if(resultList && resultList.length <= 1) {
if(resultList.length <= 1) {
data[name] = resultList[0] || "";
} else {
data[name] = resultList;
@@ -75,7 +75,7 @@ LogWidget.prototype.log = function() {
allVars[v] = variable.value;
} else {
var variableInfo = this.getVariableInfo(v);
allVars[v] = variableInfo && variableInfo.resultList && variableInfo.resultList.length > 1 ? variableInfo.resultList : variableInfo.text;
allVars[v] = variableInfo.resultList.length > 1 ? variableInfo.resultList : variableInfo.text;
}
}
if(this.filter) {
+2 -2
View File
@@ -189,7 +189,7 @@ Widget.prototype.getVariableInfo = function(name,options) {
}
return {
text: text,
resultList: text === undefined ? text : [text]
resultList: [text]
};
};
@@ -338,7 +338,7 @@ Widget.prototype.makeFakeWidgetWithVariables = function(vars = {}) {
const value = vars[name];
return Array.isArray(value)
? { text: value[0], resultList: value }
: { text: value, resultList: value === undefined ? value : [value] };
: { text: value, resultList: [value] };
}
opts = opts || {};
opts.variables = Object.assign({}, vars, opts.variables || {});
+11 -78
View File
@@ -36,89 +36,22 @@ Compute the internal state of the widget
WikifyWidget.prototype.execute = function() {
// Get our parameters
this.wikifyName = this.getAttribute("name");
this.wikifyText = this.getAttribute("text");
this.wikifyType = this.getAttribute("type");
this.wikifyMode = this.getAttribute("mode","block");
this.wikifyOutput = this.getAttribute("output","text");
// Create the parse tree
this.wikifyParser = this.wiki.parseText(this.wikifyType,this.wikifyText,{
parseAsInline: this.wikifyMode === "inline"
// Create the wikifier
this.wikifier = new $tw.utils.Wikifier({
wiki: this.wiki,
widget: this,
text: this.getAttribute("text"),
type: this.getAttribute("type"),
mode: this.getAttribute("mode","block"),
output: this.getAttribute("output","text")
});
// Create the widget tree
this.wikifyWidgetNode = this.wiki.makeWidget(this.wikifyParser,{
document: $tw.fakeDocument,
parentWidget: this
});
// Render the widget tree to the container
this.wikifyContainer = $tw.fakeDocument.createElement("div");
this.wikifyWidgetNode.render(this.wikifyContainer,null);
this.wikifyResult = this.getResult();
this.wikifyResult = this.wikifier.getResult();
// Set context variable
this.setVariable(this.wikifyName,this.wikifyResult);
// Construct the child widgets
this.makeChildWidgets();
};
/*
Return the result string
*/
WikifyWidget.prototype.getResult = function() {
var result;
switch(this.wikifyOutput) {
case "text":
result = this.wikifyContainer.textContent;
break;
case "formattedtext":
result = this.wikifyContainer.formattedTextContent;
break;
case "html":
result = this.wikifyContainer.innerHTML;
break;
case "parsetree":
result = JSON.stringify(this.wikifyParser.tree,0,$tw.config.preferences.jsonSpaces);
break;
case "widgettree":
result = JSON.stringify(this.getWidgetTree(),0,$tw.config.preferences.jsonSpaces);
break;
}
return result;
};
/*
Return a string of the widget tree
*/
WikifyWidget.prototype.getWidgetTree = function() {
var copyNode = function(widgetNode,resultNode) {
var type = widgetNode.parseTreeNode.type;
resultNode.type = type;
switch(type) {
case "element":
resultNode.tag = widgetNode.parseTreeNode.tag;
break;
case "text":
resultNode.text = widgetNode.parseTreeNode.text;
break;
}
if(Object.keys(widgetNode.attributes || {}).length > 0) {
resultNode.attributes = {};
$tw.utils.each(widgetNode.attributes,function(attr,attrName) {
resultNode.attributes[attrName] = widgetNode.getAttribute(attrName);
});
}
if(Object.keys(widgetNode.children || {}).length > 0) {
resultNode.children = [];
$tw.utils.each(widgetNode.children,function(widgetChildNode) {
var node = {};
resultNode.children.push(node);
copyNode(widgetChildNode,node);
});
}
},
results = {};
copyNode(this.wikifyWidgetNode,results);
return results;
};
/*
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
@@ -130,9 +63,9 @@ WikifyWidget.prototype.refresh = function(changedTiddlers) {
return true;
} else {
// Refresh the widget tree
if(this.wikifyWidgetNode.refresh(changedTiddlers)) {
if(this.wikifier.refresh(changedTiddlers)) {
// Check if there was any change
var result = this.getResult();
var result = this.wikifier.getResult();
if(result !== this.wikifyResult) {
// If so, save the change
this.wikifyResult = result;
+40 -4
View File
@@ -9,7 +9,6 @@ Bulk tiddler operations such as rename.
"use strict";
var relinkers = $tw.modules.getModulesByTypeAsHashmap("relinker");
/*
Rename a tiddler, and relink any tags or lists that reference it.
*/
@@ -33,13 +32,50 @@ function renameTiddler(fromTitle,toTitle,options) {
Relink any tags or lists that reference a given tiddler
*/
function relinkTiddler(fromTitle,toTitle,options) {
var self = this;
fromTitle = (fromTitle || "").trim();
toTitle = (toTitle || "").trim();
options = options || {};
if(fromTitle && toTitle && fromTitle !== toTitle) {
for(var name in relinkers) {
relinkers[name].relink(this,fromTitle,toTitle,options);
}
this.each(function(tiddler,title) {
var type = tiddler.fields.type || "";
// Don't touch plugins or JavaScript modules
if(!tiddler.fields["plugin-type"] && type !== "application/javascript") {
var tags = tiddler.fields.tags ? tiddler.fields.tags.slice(0) : undefined,
list = tiddler.fields.list ? tiddler.fields.list.slice(0) : undefined,
isModified = false,
processList = function(listField) {
if(listField && listField.indexOf(fromTitle) !== -1) {
// Remove any existing instances of the toTitle
var p = listField.indexOf(toTitle);
while(p !== -1) {
listField.splice(p,1);
p = listField.indexOf(toTitle);
}
// Replace the fromTitle with toTitle
$tw.utils.each(listField,function (title,index) {
if(title === fromTitle) {
listField[index] = toTitle;
isModified = true;
}
});
}
};
if(!options.dontRenameInTags) {
// Rename tags
processList(tags);
}
if(!options.dontRenameInLists) {
// Rename lists
processList(list);
}
if(isModified) {
var newTiddler = new $tw.Tiddler(tiddler,{tags: tags, list: list},self.getModificationFields());
newTiddler = $tw.hooks.invokeHook("th-relinking-tiddler",newTiddler,tiddler);
self.addTiddler(newTiddler);
}
}
});
}
};
+10 -37
View File
@@ -369,31 +369,16 @@ Sort an array of tiddler titles by a specified field
isDescending: true if the sort should be descending
isCaseSensitive: true if the sort should consider upper and lower case letters to be different
*/
exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive,isNumeric,isAlphaNumeric) {
exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive,isNumeric,isAlphaNumeric,locale) {
var self = this;
if(sortField === "title") {
if(!isNumeric && !isAlphaNumeric) {
if(isCaseSensitive) {
if(isDescending) {
titles.sort(function(a,b) {
return b.localeCompare(a);
});
} else {
titles.sort(function(a,b) {
return a.localeCompare(b);
});
}
const sorter = new Intl.Collator(locale, { sensitivity: isCaseSensitive ? "variant" : "accent" });
if(isDescending) {
titles.sort((a,b) => sorter.compare(b, a));
} else {
if(isDescending) {
titles.sort(function(a,b) {
return b.toLowerCase().localeCompare(a.toLowerCase());
});
} else {
titles.sort(function(a,b) {
return a.toLowerCase().localeCompare(b.toLowerCase());
});
}
}
titles.sort((a,b) => sorter.compare(a, b));
}
} else {
titles.sort(function(a,b) {
var x,y;
@@ -414,14 +399,8 @@ exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive,is
}
}
}
if(isAlphaNumeric) {
return isDescending ? b.localeCompare(a,undefined,{numeric: true,sensitivity: "base"}) : a.localeCompare(b,undefined,{numeric: true,sensitivity: "base"});
}
if(!isCaseSensitive) {
a = a.toLowerCase();
b = b.toLowerCase();
}
return isDescending ? b.localeCompare(a) : a.localeCompare(b);
const sorter = new Intl.Collator(locale, { numeric: isAlphaNumeric, sensitivity: isAlphaNumeric ? "base" : isCaseSensitive ? "variant" : "accent" });
return isDescending ? sorter.compare(b, a) : sorter.compare(a, b);
});
}
} else {
@@ -463,14 +442,8 @@ exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive,is
}
a = String(a);
b = String(b);
if(isAlphaNumeric) {
return isDescending ? b.localeCompare(a,undefined,{numeric: true,sensitivity: "base"}) : a.localeCompare(b,undefined,{numeric: true,sensitivity: "base"});
}
if(!isCaseSensitive) {
a = a.toLowerCase();
b = b.toLowerCase();
}
return isDescending ? b.localeCompare(a) : a.localeCompare(b);
const sorter = new Intl.Collator(locale, { numeric: isAlphaNumeric, sensitivity: isAlphaNumeric ? "base" : isCaseSensitive ? "variant" : "accent" });
return isDescending ? sorter.compare(b, a) : sorter.compare(a, b);
});
}
};
@@ -1,7 +1,5 @@
title: $:/core/ui/EditTemplate/body/toolbar/button
\whitespace trim
\define toolbar-button-icon()
<$list
@@ -19,7 +19,6 @@ type: text/vnd.tiddlywiki
!! Update Readmes and release note
# Edit `package.json` to the new version number
# Run `npm install` to update the `package-lock.json` file
# Run `./bin/readme-bld.sh` to build the readme files
# Commit the new readme files to ''master''
# Restore `package.json` to the previous version number
+1 -2
View File
@@ -13,8 +13,7 @@
"tiddlywiki/menubar",
"tiddlywiki/jszip",
"tiddlywiki/confetti",
"tiddlywiki/tour",
"tiddlywiki/dom-to-image"
"tiddlywiki/tour"
],
"themes": [
"tiddlywiki/vanilla",
@@ -0,0 +1,21 @@
title: Operators/Wikify/TextMode
description: Simple wikify operator
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\parsermode inline
<$text text={{{ [subfilter{Filter}] }}}/>
+
title: Filter
[{Text}wikify[html],[inline],[text/vnd.tiddlywiki]]
+
title: Text
This is ''the text'' that is __wikified__
+
title: ExpectedResult
This is &lt;strong&gt;the text&lt;/strong&gt; that is &lt;u&gt;wikified&lt;/u&gt;
@@ -0,0 +1,64 @@
title: Operators/Wikify/ParseTreeMode
description: Simple wikify operator
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\parsermode inline
<$text text={{{ [subfilter{Filter}] }}}/>
+
title: Filter
[{Text}wikify[parsetree],[inline],[text/vnd.tiddlywiki]]
+
title: Text
This is ''the text'' that is __wikified__
+
title: ExpectedResult
[
{
"type": "text",
"text": "This is ",
"start": 0,
"end": 8
},
{
"type": "element",
"tag": "strong",
"children": [
{
"type": "text",
"text": "the text",
"start": 10,
"end": 18
}
],
"start": 8,
"end": 20,
"rule": "bold"
},
{
"type": "text",
"text": " that is ",
"start": 20,
"end": 29
},
{
"type": "element",
"tag": "u",
"children": [
{
"type": "text",
"text": "wikified",
"start": 31,
"end": 39
}
],
"start": 29,
"end": 41,
"rule": "underscore"
}
]
@@ -0,0 +1,21 @@
title: Operators/Wikify/TextMode
description: Simple wikify operator
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\parsermode inline
<$text text={{{ [subfilter{Filter}] }}}/>
+
title: Filter
[{Text}wikify[text],[inline],[text/vnd.tiddlywiki]]
+
title: Text
This is ''the text'' that is __wikified__
+
title: ExpectedResult
This is the text that is wikified
@@ -1,13 +0,0 @@
title: Transclude/MissingTiddlerAttributeVariable
description: Missing Tiddler Attribute Variable
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
description: hello
<$transclude tiddler=<<nonExistentVariable>> field="description"/>
+
title: ExpectedResult
<p>hello</p>
@@ -28,7 +28,7 @@ describe("Backlinks tests", function() {
}
describe("a tiddler with no links to it", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: "TestIncoming",
@@ -10,7 +10,7 @@ Tests the backtranscludes mechanism.
describe("Backtranscludes and transclude filter tests", function() {
describe("a tiddler with no transcludes to it", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: "TestIncoming",
@@ -25,7 +25,7 @@ describe("Backtranscludes and transclude filter tests", function() {
});
describe("A tiddler added to the wiki with a transclude to it", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: "TestIncoming",
@@ -44,7 +44,7 @@ describe("Backtranscludes and transclude filter tests", function() {
});
describe("A tiddler transclude with template will still use the tiddler as result.", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: "TestIncoming",
@@ -60,7 +60,7 @@ describe("Backtranscludes and transclude filter tests", function() {
});
describe("A data tiddler transclude will still use the tiddler as result.", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: "TestIncoming",
@@ -81,7 +81,7 @@ describe("Backtranscludes and transclude filter tests", function() {
describe("A tiddler that has a transclude added to it later", function() {
it("should have an additional backtransclude", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: "TestIncoming",
@@ -106,7 +106,7 @@ describe("Backtranscludes and transclude filter tests", function() {
});
describe("A tiddler that has a transclude remove from it later", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: "TestIncoming",
@@ -128,7 +128,7 @@ describe("Backtranscludes and transclude filter tests", function() {
});
describe("A tiddler transcludeing to another that gets renamed", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: "TestIncoming",
@@ -148,7 +148,7 @@ describe("Backtranscludes and transclude filter tests", function() {
});
describe("A tiddler transcludeing to another that gets deleted", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: "TestIncoming",
@@ -168,7 +168,7 @@ describe("Backtranscludes and transclude filter tests", function() {
});
describe("a tiddler with some transcludes on it in order", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: "TestOutgoing",
@@ -186,7 +186,7 @@ describe("Backtranscludes and transclude filter tests", function() {
});
describe("include implicit self transclusion", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: "TestOutgoing",
@@ -202,7 +202,7 @@ describe("Backtranscludes and transclude filter tests", function() {
});
describe("include explicit self transclusion", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: "TestOutgoing",
@@ -218,7 +218,7 @@ describe("Backtranscludes and transclude filter tests", function() {
});
describe("exclude self when target tiddler is not string", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: "TestOutgoing",
@@ -234,7 +234,7 @@ describe("Backtranscludes and transclude filter tests", function() {
});
describe("recognize transclusion defined by widget", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: "TestOutgoing",
@@ -534,7 +534,7 @@ describe("Checkbox widget", function() {
it("checkbox widget test: " + data.testName, function() {
// Setup
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddlers(data.tiddlers);
var widgetNode = createWidgetNode(parseText(data.widgetText,wiki),wiki);
renderWidgetNode(widgetNode);
@@ -13,7 +13,7 @@ Tests the compare filter.
describe("'compare' filter tests", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
it("should compare numerical equality", function() {
expect(wiki.filterTiddlers("[[2]compare:number:eq[0003]]").join(",")).toBe("");
+1 -1
View File
@@ -583,7 +583,7 @@ describe("Filter tests", function() {
});
it("should handle the '[is[draft]]' operator", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddlers([
{title: "A"},
{title: "Draft of 'A'", "draft.of": "A", "draft.title": "A"},
@@ -13,7 +13,7 @@ Tests the JSON filters and the format:json operator
describe("json filter tests", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
var tiddlers = [{
title: "First",
text: '{"a":"one","b":"","c":1.618,"d": {"e": "four","f": ["five","six",true,false,null]}}',
@@ -12,7 +12,7 @@ Tests for source attribute in parser returned from wiki.parseTextReference
describe("Wiki.parseTextReference tests", function() {
// Create a wiki
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: "TiddlerOne",
text: "The quick brown fox in $:/TiddlerTwo",
@@ -14,7 +14,7 @@ Tests the reduce prefix and filter.
describe("general filter prefix tests", function() {
it("should handle nonexistent prefixes gracefully", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
var results = wiki.filterTiddlers("[tag[A]] :nonexistent[tag[B]]");
expect(results).toEqual(["Filter Error: Unknown prefix for filter run"]);
});
@@ -215,7 +215,7 @@ describe("general filter prefix tests", function() {
describe("'reduce' and 'intersection' filter prefix tests", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: "Brownies",
+1 -1
View File
@@ -82,7 +82,7 @@ describe("Utility tests", function() {
});
it("stringifyList shouldn't interfere with setting variables to negative numbers", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddler({title: "test", text: "<$set name=X filter='\"-7\"'>{{{ [<X>add[2]] }}}</$set>"});
// X shouldn't be wrapped in brackets. If it is, math filters will treat it as zero.
expect(wiki.renderTiddler("text/plain","test")).toBe("-5");
@@ -19,7 +19,7 @@ describe("Widget Event Listeners", function() {
it("should call all added event listeners on dispatchEvent", function() {
var calls = [];
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
var widget = createWidgetNode({type:"widget", text:"text"}, wiki);
// Add a function listener.
@@ -44,7 +44,7 @@ describe("Widget Event Listeners", function() {
it("should remove an event listener correctly", function() {
var calls = [];
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
var widget = createWidgetNode({type:"widget", text:"text"}, wiki);
function listener(e) {
@@ -70,7 +70,7 @@ describe("Widget Event Listeners", function() {
it("stop further propagation by returns false won't block other listeners on the same level.", function() {
var calls = [];
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
var widget = createWidgetNode({type:"widget", text:"text"}, wiki);
widget.addEventListener("stopEvent", function(e) {
@@ -92,7 +92,7 @@ describe("Widget Event Listeners", function() {
it("should dispatch event to parent widget if not handled on child", function() {
var parentCalls = [];
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
var parentWidget = createWidgetNode({type:"widget", text:"text"}, wiki);
parentWidget.addEventListener("parentEvent", function(e) {
parentCalls.push("parentListener");
@@ -110,7 +110,7 @@ describe("Widget Event Listeners", function() {
it("should not dispatch event to parent if child's listener stops propagation", function() {
var parentCalls = [];
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
var parentWidget = createWidgetNode({type:"widget", text:"text"}, wiki);
parentWidget.addEventListener("bubbleTest", function(e) {
parentCalls.push("parentListener");
@@ -128,7 +128,7 @@ describe("Widget Event Listeners", function() {
it("should call multiple listeners in proper order across child and parent", function() {
var calls = [];
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
var parentWidget = createWidgetNode({type:"widget", text:"text"}, wiki);
parentWidget.addEventListener("chainEvent", function(e) {
calls.push("parentListener");
@@ -152,7 +152,7 @@ describe("Widget Event Listeners", function() {
it("should handle events of different types separately", function() {
var callsA = [];
var callsB = [];
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
var widget = createWidgetNode({type:"widget", text:"text"}, wiki);
widget.addEventListener("eventA", function(e) {
callsA.push("A1");
@@ -171,7 +171,7 @@ describe("Widget Event Listeners", function() {
// Test using $tw.utils.each in removeEventListener internally (behavior verified via dispatch)
it("should remove listeners using $tw.utils.each without affecting other listeners", function() {
var calls = [];
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
var widget = createWidgetNode({type:"widget", text:"text"}, wiki);
function listener1(e) {
calls.push("listener1");
@@ -192,7 +192,7 @@ describe("Widget Event Listeners", function() {
it("should prevent adding the same event listener multiple times", function() {
var calls = 0;
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
var widget = createWidgetNode({type:"widget", text:"text"}, wiki);
function listener(e) {
+31 -31
View File
@@ -45,7 +45,7 @@ describe("Widget module", function() {
}
it("should deal with text nodes and HTML elements", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Test parse tree
var parseTreeNode = {type: "widget", children: [
{type: "text", text: "A text node"},
@@ -77,7 +77,7 @@ describe("Widget module", function() {
});
it("should deal with transclude widgets and indirect attributes", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Add a tiddler
wiki.addTiddlers([
{title: "TiddlerOne", text: "the quick brown fox"}
@@ -137,7 +137,7 @@ describe("Widget module", function() {
});
it("should detect recursion of the transclude macro", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Add a tiddler
wiki.addTiddlers([
{title: "TiddlerOne", text: "<$transclude tiddler='TiddlerTwo'/>"},
@@ -158,7 +158,7 @@ describe("Widget module", function() {
});
it("should handle single-tiddler recursion with branching nodes", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Add a tiddler
wiki.addTiddlers([
{title: "TiddlerOne", text: "<$tiddler tiddler='TiddlerOne'><$transclude /> <$transclude /></$tiddler>"},
@@ -182,7 +182,7 @@ describe("Widget module", function() {
// end up being the same value for all iterations of the test.
$tw.utils.each(["div","$button","$checkbox","$diff-text","$draggable","$droppable","dropzone","$eventcatcher","$keyboard","$link","$list filter=x variable=x","$radio","$reveal type=nomatch","$scrollable","$select","$view field=x"],function(tag) {
it(`${tag} cleans itself up if children rendering fails`, function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddler({title: "TiddlerOne", text: `<$tiddler tiddler='TiddlerOne'><${tag}><$transclude />`});
var parseTreeNode = {type: "widget", children: [
{type: "transclude", attributes: {
@@ -204,7 +204,7 @@ describe("Widget module", function() {
});
it("should handle many-tiddler recursion with branching nodes", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Add a tiddler
wiki.addTiddlers([
{title: "TiddlerOne", text: "<$transclude tiddler='TiddlerTwo'/> <$transclude tiddler='TiddlerTwo'/>"},
@@ -225,7 +225,7 @@ describe("Widget module", function() {
});
it("should deal with SVG elements", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Construct the widget node
var text = "<svg class=\"tv-image-new-button\" viewBox=\"83 81 50 50\" width=\"22pt\" height=\"22pt\"><path d=\"M 101.25 112.5 L 101.25 127.5 C 101.25 127.5 101.25 127.5 101.25 127.5 L 101.25 127.5 C 101.25 129.156855 102.593146 130.5 104.25 130.5 L 111.75 130.5 C 113.406854 130.5 114.75 129.156854 114.75 127.5 L 114.75 112.5 L 129.75 112.5 C 131.406854 112.5 132.75 111.156854 132.75 109.5 L 132.75 102 C 132.75 100.343146 131.406854 99 129.75 99 L 114.75 99 L 114.75 84 C 114.75 82.343146 113.406854 81 111.75 81 L 104.25 81 C 104.25 81 104.25 81 104.25 81 C 102.593146 81 101.25 82.343146 101.25 84 L 101.25 99 L 86.25 99 C 86.25 99 86.25 99 86.25 99 C 84.593146 99 83.25 100.343146 83.25 102 L 83.25 109.5 C 83.25 109.5 83.25 109.5 83.25 109.5 L 83.25 109.5 C 83.25 111.156855 84.593146 112.5 86.25 112.5 Z\"/></svg>\n";
var widgetNode = createWidgetNode(parseText(text,wiki,{parseAsInline:true}),wiki);
@@ -237,7 +237,7 @@ describe("Widget module", function() {
});
it("should parse and render transclusions", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Add a tiddler
wiki.addTiddlers([
{title: "TiddlerOne", text: "Jolly Old World"},
@@ -254,7 +254,7 @@ describe("Widget module", function() {
});
it("should render the view widget", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Add a tiddler
wiki.addTiddlers([
{title: "TiddlerOne", text: "Jolly Old World"}
@@ -283,7 +283,7 @@ describe("Widget module", function() {
});
it("should deal with the set widget", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Add some tiddlers
wiki.addTiddlers([
{title: "TiddlerOne", text: "Jolly Old World"},
@@ -313,7 +313,7 @@ describe("Widget module", function() {
});
it("should deal with the let widget", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddlers([
{title: "TiddlerOne", text: "lookup"},
{title: "TiddlerTwo", lookup: "value", newlookup: "value", wrong: "wrong"},
@@ -347,7 +347,7 @@ describe("Widget module", function() {
});
it("should deal with attributes specified as macro invocations", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Construct the widget node
var text = "\\define myMacro(one:\"paramOne\",two,three:\"paramTwo\")\nMy something $one$, $two$ or other $three$\n\\end\n<div class=<<myMacro 'something' three:'thing'>>>Content</div>";
var widgetNode = createWidgetNode(parseText(text,wiki),wiki);
@@ -358,7 +358,7 @@ describe("Widget module", function() {
});
it("should deal with built-in macros", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Add some tiddlers
wiki.addTiddlers([
{title: "TiddlerOne", text: "Jolly Old World", type: "text/vnd.tiddlywiki"}
@@ -374,7 +374,7 @@ describe("Widget module", function() {
/* This test reproduces issue #4693. */
it("should render the entity widget", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Construct the widget node
var text = "\n\n<$entity entity='&nbsp;' />\n\n<$entity entity='&#x2713;' />\n";
var widgetNode = createWidgetNode(parseText(text,wiki),wiki);
@@ -391,7 +391,7 @@ describe("Widget module", function() {
});
it("should deal with the list widget", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Add some tiddlers
wiki.addTiddlers([
{title: "TiddlerOne", text: "Jolly Old World"},
@@ -451,7 +451,7 @@ describe("Widget module", function() {
it("should deal with the list widget using a counter variable", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Add some tiddlers
wiki.addTiddlers([
{title: "TiddlerOne", text: "Jolly Old World"},
@@ -593,7 +593,7 @@ describe("Widget module", function() {
var testListJoin = function(oldList, newList) {
return function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Add some tiddlers
wiki.addTiddler({title: "Numbers", text: "", list: oldList});
var text = "<$list filter='[list[Numbers]]' variable='item' join=', '><<item>></$list>";
@@ -632,7 +632,7 @@ describe("Widget module", function() {
var testCounterLast = function(oldList, newList) {
return function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Add some tiddlers
wiki.addTiddler({title: "Numbers", text: "", list: oldList});
var text = "<$list filter='[list[Numbers]]' variable='item' counter='c'><<item>><$text text={{{ [<c-last>match[no]then[, ]] }}} /></$list>";
@@ -654,7 +654,7 @@ describe("Widget module", function() {
it("the list widget with counter-last should update correctly when first item is removed", testCounterLast("1 2 3 4", "2 3 4"));
it("should deal with the list widget followed by other widgets", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Add some tiddlers
wiki.addTiddlers([
{title: "TiddlerOne", text: "Jolly Old World"},
@@ -727,7 +727,7 @@ describe("Widget module", function() {
});
it("should deal with the list widget and external templates", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Add some tiddlers
wiki.addTiddlers([
{title: "$:/myTemplate", text: "(<$view field='title'/>)"},
@@ -747,7 +747,7 @@ describe("Widget module", function() {
});
it("should deal with the list widget and empty lists", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Construct the widget node
var text = "<$list emptyMessage='nothing'><$view field='title'/></$list>";
var widgetNode = createWidgetNode(parseText(text,wiki),wiki);
@@ -758,7 +758,7 @@ describe("Widget module", function() {
});
it("should refresh lists that become empty", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Add some tiddlers
wiki.addTiddlers([
{title: "TiddlerOne", text: "Jolly Old World"},
@@ -788,7 +788,7 @@ describe("Widget module", function() {
* if they use transclusion for their value. This relates to PR #4108.
*/
it("should refresh imported <$set> widgets", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Add some tiddlers
wiki.addTiddlers([
{title: "Raw", text: "Initial value"},
@@ -808,7 +808,7 @@ describe("Widget module", function() {
});
it("should support mixed setWidgets and macros when importing", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Add some tiddlers
wiki.addTiddlers([
{title: "A", text: "\\define A() Aval"},
@@ -824,7 +824,7 @@ describe("Widget module", function() {
});
it("should skip parameters widgets when importing", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Add some tiddlers
wiki.addTiddlers([
{title: "B", text: "<$parameters bee=nothing><$set name='B' value='Bval'>\n\ndummy text</$set></$parameters>"},
@@ -838,7 +838,7 @@ describe("Widget module", function() {
});
it("should use default $parameters if directly rendered", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
var text = "<$parameters bee=default $$dollar=bill nothing empty=''>bee=<<bee>>, $dollar=<<$dollar>>, nothing=<<nothing>>, empty=<<empty>></$parameters>";
var widgetNode = createWidgetNode(parseText(text,wiki),wiki);
// Render the widget node to the DOM
@@ -848,7 +848,7 @@ describe("Widget module", function() {
});
it("should use default \\parameters if directly rendered", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
var text = "\\parameters(bee:default $$dollar:bill nothing)\nbee=<<bee>>, $$dollar=<<$$dollar>>, nothing=<<nothing>>";
var widgetNode = createWidgetNode(parseText(text,wiki),wiki);
// Render the widget node to the DOM
@@ -858,7 +858,7 @@ describe("Widget module", function() {
});
it("can have more than one macroDef variable imported", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
wiki.addTiddlers([
{title: "ABC", text: "<$set name=A value=A>\n\n<$set name=B value=B>\n\n<$set name=C value=C>\n\ndummy text</$set></$set></$set>"},
{title: "D", text: "\\define D() D"}]);
@@ -911,7 +911,7 @@ describe("Widget module", function() {
* doesn't forget its childrenNodes.
*/
it("should work when import widget imports nothing", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
var text = "\\import [prefix[XXX]]\nDon't forget me.";
var widgetNode = createWidgetNode(parseText(text,wiki),wiki);
// Render the widget node to the DOM
@@ -925,7 +925,7 @@ describe("Widget module", function() {
* visual difference, but may affect plugins if it doesn't.
*/
it("should work when import pragma is standalone", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
var text = "\\import [prefix[XXX]]";
var parseTreeNode = parseText(text,wiki);
// Test the resulting parse tree node, since there is no
@@ -944,7 +944,7 @@ describe("Widget module", function() {
* at least ONE variable.
*/
it("adding imported variables doesn't change qualifyers", function() {
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
function wikiparse(text) {
var tree = parseText(text,wiki);
var widgetNode = createWidgetNode(tree,wiki);
@@ -12,7 +12,7 @@ Tests for wikitext parser
describe("WikiText parser tests", function() {
// Create a wiki
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Define a parsing shortcut
var parse = function(text) {
@@ -12,7 +12,7 @@ Tests the wikitext rendering pipeline end-to-end. We also need tests that indivi
describe("WikiText tests", function() {
// Create a wiki
var wiki = $tw.test.wiki();
var wiki = new $tw.Wiki();
// Add a couple of tiddlers
wiki.addTiddler({title: "TiddlerOne", text: "The quick brown fox"});
wiki.addTiddler({title: "TiddlerTwo", text: "The rain in Spain\nfalls mainly on the plain"});
@@ -0,0 +1,6 @@
created: 20251001034405510
list: A a Ä ä Z z O o Õ õ Ö ö Ü ü Y y
modified: 20251218023544134
tags:
title: Locale Example
type: text/vnd.tiddlywiki
@@ -1,5 +1,5 @@
created: 20150124112340000
modified: 20150124113250000
modified: 20251218023608468
tags: [[sort Operator]] [[Operator Examples]]
title: sort Operator (Examples)
type: text/vnd.tiddlywiki
@@ -11,3 +11,10 @@ type: text/vnd.tiddlywiki
<<.operator-example 3 "one two Three four +[sort[]]">>
<<.operator-example 4 "[prefix[Tiddl]sort[text]]">>
<<.operator-example 5 "[has[created]sort[created]limit[10]]" "the oldest 10 tiddlers in the wiki">>
! Using a custom locale
The following examples shows the differences when using the sort operator with default, Swedish and Estonian locale.
<<.operator-example 6 "[list[Locale Example]sort[]]">>
<<.operator-example 7 "[list[Locale Example]sort[],[sv]]">>
<<.operator-example 8 "[list[Locale Example]sort[],[et]]">>
+8 -8
View File
@@ -1,15 +1,15 @@
caption: nsort
created: 20140410103123179
modified: 20150203190051000
modified: 20251227084602319
op-input: a [[selection of titles|Title Selection]]
op-neg-output: the input, likewise sorted into descending order
op-output: the input, sorted into ascending order by field <<.field F>>, treating field values as numbers
op-parameter: accept same parameters as the [[sort Operator]]
op-parameter-name: F
op-purpose: sort the input by number field
tags: [[Filter Operators]] [[Field Operators]] [[Order Operators]] [[Negatable Operators]]
title: nsort Operator
type: text/vnd.tiddlywiki
caption: nsort
op-purpose: sort the input by number field
op-input: a [[selection of titles|Title Selection]]
op-parameter: the name of a [[field|TiddlerFields]], defaulting to <<.field title>>
op-parameter-name: F
op-output: the input, sorted into ascending order by field <<.field F>>, treating field values as numbers
op-neg-output: the input, likewise sorted into descending order
Non-numeric values are treated as having a higher value than any number, and the difference between capital and lowercase letters is ignored. Compare <<.olink nsortcs>>.
@@ -1,10 +1,10 @@
caption: nsortcs
created: 20140410103123179
modified: 20150417125717078
modified: 20251227084615705
op-input: a [[selection of titles|Title Selection]]
op-neg-output: the input, likewise sorted into descending order
op-output: the input, sorted into ascending order by field <<.place F>>, treating field values as numbers
op-parameter: the name of a [[field|TiddlerFields]], defaulting to <<.field title>>
op-parameter: accept same parameters as the [[sort Operator]]
op-parameter-name: F
op-purpose: sort the input titles by number field, treating upper and lower case as different
tags: [[Filter Operators]] [[Field Operators]] [[Order Operators]] [[Negatable Operators]]
+14 -8
View File
@@ -1,16 +1,22 @@
caption: sort
created: 20140410103123179
modified: 20150203191228000
modified: 20251227084644651
op-input: a [[selection of titles|Title Selection]]
op-neg-output: the input, likewise sorted into descending order
op-output: the input, sorted into ascending order by field <<.field F>>, treating field values as text
op-parameter: the <<.op sort>> operator accepts 1 or 2 parameters, see below for details
op-parameter-name: F
op-purpose: sort the input by text field
tags: [[Filter Operators]] [[Common Operators]] [[Field Operators]] [[Order Operators]] [[Negatable Operators]]
title: sort Operator
type: text/vnd.tiddlywiki
caption: sort
op-purpose: sort the input by text field
op-input: a [[selection of titles|Title Selection]]
op-parameter: the name of a [[field|TiddlerFields]], defaulting to <<.field title>>
op-parameter-name: F
op-output: the input, sorted into ascending order by field <<.field F>>, treating field values as text
op-neg-output: the input, likewise sorted into descending order
The difference between capital and lowercase letters is ignored. Compare <<.olink sortcs>>.
```
[sort[<field>],[<locale>]]
```
* ''field'' : the name of a [[field|TiddlerFields]], defaulting to <<.field title>>
* ''locale'': (optional). A string with a [[BCP 47 language tag|https://developer.mozilla.org/en-US/docs/Glossary/BCP_47_language_tag]]
<<.operator-examples "sort">>
+2 -2
View File
@@ -1,10 +1,10 @@
caption: sortan
created: 20180222071605739
modified: 20180223012553446
modified: 20251227084439804
op-input: a [[selection of titles|Title Selection]]
op-neg-output: the input, likewise sorted into descending order
op-output: the input, sorted into ascending order by field <<.field F>>, treating field values as alphanumerics
op-parameter: the name of a [[field|TiddlerFields]], defaulting to <<.field title>>
op-parameter: accept same parameters as the [[sort Operator]]
op-parameter-name: F
op-purpose: sort the input by text field considering them as alphanumerics
tags: [[Filter Operators]] [[Common Operators]] [[Field Operators]] [[Order Operators]] [[Negatable Operators]]
+2 -2
View File
@@ -1,10 +1,10 @@
caption: sortcs
created: 20140410103123179
modified: 20150417125704503
modified: 20251227084416522
op-input: a [[selection of titles|Title Selection]]
op-neg-output: the input, likewise sorted into descending order
op-output: the input, sorted into ascending order by field <<.field F>>, treating field values as text
op-parameter: the name of a [[field|TiddlerFields]], defaulting to <<.field title>>
op-parameter: accept same parameters as the [[sort Operator]]
op-parameter-name: F
op-purpose: sort the input by text field, treating upper and lower case as different
tags: [[Filter Operators]] [[Field Operators]] [[Order Operators]] [[Negatable Operators]]
@@ -19,5 +19,3 @@ A <<.def "filter expression">> is the outermost level of the [[filter syntax|Fil
<<.tip """If the diagram has a single start and end line, as shown above, it means there is more info in the linked level above. The breadcrumbs can be used to navigate""">>
<<.tip """If the diagram has no start and no end, as used in lower levels, it means that higher level syntax elements have been removed, to increase readability and simplicity. The breadcrumbs can be used to navigate""">>
<<.note """Filter expressions have a maximum recursion depth of 300. Filters that recursively invoke themselves (e.g. via the <<.olink subfilter>> or <<.olink filter>> operators) beyond this limit will return the error message `/**-- Excessive filter recursion --**/`. This protects against infinite loops.""">>
@@ -12,8 +12,6 @@ type: text/vnd.tiddlywiki
"{" [: <-"indirect"-> /"anything but }"/] "}"
|
"<" [: <-"variable"-> /"anything but >"/] ">"
|
"(" [: <-"multi-valued variable"-> /"anything but )"/ ] ")" /"v5.4.0"/
)
"""/>
@@ -22,7 +20,6 @@ The parameter to a [[filter operator|Filter Operators]] can be:
;<<.def hard>>
: `[like this]`
: The parameter is the exact text that appears between the square brackets.
;<<.def soft>>
: <<.def indirect>>
:: `{like this}`
@@ -31,9 +28,6 @@ The parameter to a [[filter operator|Filter Operators]] can be:
:: `<like this>`
:: The parameter is the current value of the [[variable|Variables]] whose name appears between the angle brackets. Macro parameters are <<.em not>> supported up to v5.2.0
::<<.from-version "5.2.0">> Literal macro parameters are supported. For example: `[<now [UTC]YYYY0MM0DD0hh0mm0ssXXX>]`.
: <<.def "multi-valued variable">>
:: `(like this)`
:: <<.from-version "5.4.0">> The parameter expands to the complete list of values stored in the [[multi-valued variable|Multi-Valued Variables]] whose name appears between the round brackets. When accessed this way, the filter operator receives all values, not just the first. See [[Multi-Valued Variables]] for details.
<<.note """Every [[filter Operator]] must be followed by a parameter expression. In the case of [[Operators without parameters]], that expression is empty, as with the filter Operator <<.olink links>> in `[<currentTiddler>links[]]`.""">>
@@ -41,8 +35,4 @@ The parameter to a [[filter operator|Filter Operators]] can be:
<<.from-version "5.1.23">> [[Filter Step]]s support multiple parameters which are separated by a `,` character.
For example: `[param1],[param2]` or `<param1>,{param2}` or `[param1],(param2)`
---
<<.warning """The `/regexp/(flags)` operand syntax is deprecated and will log a warning to the browser console. Use the <<.olink regexp>> operator instead.""">>
For example: `[param1],[param2]` or `<param1>,{param2}`
@@ -18,17 +18,17 @@ In programming terms, it is akin to a function call to which the step's input is
{ [[parameter|"Filter Parameter"]] + "," }
"""/>
The step's <<.def operator>> is drawn from a list of predefined keywords which are known as [[filter operators|Filter Operators]].
The step's <<.def operator>> is drawn from a list of predefined keywoards which are known as [[filter operators|Filter Operators]].
Many steps require an explicit <<.def parameter>>, that further defines what the step is to do.
The <<.def suffix>> is additional text, often the name of a [[field|TiddlerFields]], that extends the meaning of certain operators. Suffixes are separated by `:` characters, and each suffix group can contain multiple comma-separated values. For example, in `compare:number:gteq`, the first suffix is `number` and the second is `gteq`. In `:sort:string:reverse,casesensitive`, the first suffix is `string` and the second suffix group contains both `reverse` and `casesensitive`.
The <<.def suffix>> is additional text, often the name of a [[field|TiddlerFields]], that extends the meaning of certain operators.
If a step's <<.def operator>> and <<.def suffix>> are //omitted// altogether, it defaults to the [[title|title Operator]] operator. If a suffix is present but the operator name before the colon is empty (e.g. `[:fieldname[value]]`), the operator defaults to <<.olink field>>.
If a step's <<.def operator>> and <<.def suffix>> are //omitted// altogether, it defaults to the [[title|title Operator]] operator.
<<.from-version "5.1.23">> Some steps accept multiple <<.def parameter>>s which are separated by a `,` character.
Any unrecognised operator is treated as if it was the suffix to the <<.olink field>> operator. <<.from-version "5.3.0">> However, unrecognised operators whose name contains a `.` (dot) character are treated as user-defined filter operators, resolved by looking up a variable or function with that name.
Any unrecognised operator is treated as if it was the suffix to the <<.olink field>> operator.
Filter operators can be extended by plugins.
@@ -43,5 +43,3 @@ For the difference between `+` and `:intersection`, see [[Intersection Filter Ru
!! For Developers
To create a new filter run prefix, create a [[Javascript module|Modules]] with a [[module-type|ModuleType]] of `filterrunprefix`.
Compiled filter expressions are cached for performance. The cache holds up to 2000 entries and is reset in its entirety when this limit is exceeded.
@@ -15,15 +15,6 @@ type: text/vnd.tiddlywiki
[[run|"Filter Run"]]
"""/>
The filter output from previous runs is set aside. The `:intersection` filter run is started with all tiddler titles as input. Once this filter run has completed, the output is compared to the set-aside output. A new output is produced that contains only titles that appeared in both the set-aside output and the latest output. The order of titles in the output is preserved from the accumulated results.
!! Difference from `:and` / `+`
The key difference between `:intersection` and `:and` (or `+`) is what they receive as ''input'':
* `:and` / `+` feeds the ''accumulated results so far'' as input to the filter run. Operators in the run can only see and work with titles already in the results.
* `:intersection` feeds ''all tiddler titles'' as input to the filter run (just like an unprefixed run), then keeps only titles that also appear in the accumulated results.
This means `:intersection` can match titles using operators that need to start from the full tiddler pool. See [[Interchangeable Filter Run Prefixes]] for more details.
The filter output from previous runs is set aside. The `:intersection` filter run is started with all tiddler titles as input. Once this latest filter run has completed, the latest output is compared to the set-aside output. A new output is produced that contains only titles that appeared in both the set-aside output and the latest output.
[[Intersection Filter Run Prefix (Examples)]]
@@ -34,14 +34,4 @@ A named filter run prefix can precede any [[run|Filter Run]] of a [[filter expre
<<.tip """Within the filter runs prefixed with `:reduce`, `:sort`, `:map` and `:filter`, the <<.var currentTiddler>> variable is set to the title of the tiddler being processed.<br>The value of currentTiddler outside the subfilter is available in the variable <<.var "..currentTiddler">> <<.from-version "5.2.0">>""" >>
!! Suffixes
Named filter run prefixes can accept suffixes separated by `:` characters, each optionally containing comma-separated values. The general syntax is `:prefixname:suffix1:suffix2,...`. Currently the following prefixes accept suffixes:
|!Prefix |!Suffixes |!Example |
|`:map` |`flat` — return all results instead of only the first per item |`:map:flat[...]` |
|`:sort` |type (''string'', ''alphanumeric'', ''number'', ''integer'', ''version'', ''date'') and flags (''reverse'', ''casesensitive'', ''caseinsensitive'') |`:sort:number:reverse[...]` |
All other named prefixes (`:all`, `:and`, `:cascade`, `:else`, `:except`, `:filter`, `:intersection`, `:let`, `:or`, `:reduce`, `:then`) do not currently accept suffixes.
Also see: [[Interchangeable Filter Run Prefixes]]
@@ -21,10 +21,10 @@ If a run has:
* the prefix `-`, output titles are <<.em removed>> from the filter's output (if such tiddlers exist)
* the prefix `~`, <<.from-version "5.1.18">> if the filter output so far is an empty list then the output titles of the run are [[dominantly appended|Dominant Append]] to the filter's output. If the filter output so far is not an empty list then the run is ignored.
* the prefix `~`, if the filter output so far is an empty list then the output titles of the run are [[dominantly appended|Dominant Append]] to the filter's output. If the filter output so far is not an empty list then the run is ignored. <<.from-version "5.1.18">>
* the prefix `=`, <<.from-version "5.1.20">> output titles are appended to the filter's output without de-duplication.
* the prefix `=`, output titles are appended to the filter's output without de-duplication. <<.from-version "5.1.20">>
* the prefix `=>`, <<.from-version "5.4.0">> the accumulated results from all previous runs are assigned as a [[multi-valued variable|Multi-Valued Variables]] whose name is the first result of this run. The accumulated results are then cleared.
* the prefix `=>`, the input is assigned to the variable named with the output title. <<.from-version "5.4.0">>
{{Interchangeable Filter Run Prefixes}}
@@ -1,7 +1,7 @@
created: 20210618133745003
from-version: 5.3.0
modified: 20230710074225410
rp-input: <<.olink all>> tiddler titles (only evaluated when the output from previous runs is non-empty)
rp-input: <<.olink all>> tiddler titles
rp-output: the output of this filter run replaces the output of previous runs unless it is an empty list (see below)
rp-purpose: replace any input to this filter run with its output, only evaluating the run when there is any input
search:
@@ -1,7 +1,7 @@
title: HelloThumbnail - Community Survey 2025
tags: HelloThumbnail
color: rgb(234, 205, 183)
image: Community Survey 2025 Image
image: Community Survey 2025
caption: Community Survey
link: Community Survey 2025
ribbon-text: NEW
@@ -1,7 +1,7 @@
background-color: #EDB431
caption: Intertwingled Innovations
color: #ff0
image: Intertwingled Innovations Image
image: Intertwingled Innovations
link: Intertwingled Innovations
tags: HelloThumbnail
title: HelloThumbnail - Intertwingled Innovations
@@ -4,7 +4,6 @@ caption: What's New in v<<version>>
link: Releases
image: New Release Banner
color: #fff
ribbon-text: NEW
\define prerelease-regexp() [0-9]+\.[0-9]+\.[0-9]+\-prerelease
<$list filter="[<version>!regexp<prerelease-regexp>]" variable="ignore">
@@ -5,5 +5,6 @@ link: TiddlyWiki Newsletter
image: TiddlyWiki Newsletter Badge
color: #fff
type: text/vnd.tiddlywiki
ribbon-text: NEW
Subscribe to the ~TiddlyWiki Newsletter, a summary of the most interesting and relevant news from the ~TiddlyWiki community

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

@@ -1,4 +1,4 @@
alt-text: Shape the future by taking the TiddlyWiki Community Survey 2025
tags: picture
title: Community Survey 2025 Image
title: Community Survey 2025
type: image/webp
@@ -1,3 +0,0 @@
title: Intertwingled Innovations Image
type: image/webp
tags: picture

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

@@ -0,0 +1,3 @@
title: Intertwingled Innovations
type: image/webp
tags: picture
Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 161 KiB

@@ -12,15 +12,3 @@ eg="""<<tabs "[tag[sampletab]]" "SampleTabTwo" "$:/state/tab2" "tc-vertical">>""
<$macrocall $name=".example" n="3"
eg="""<<tabs "[tag[sampletab]nsort[order]]" "SampleTabThree" "$:/state/tab3" "tc-vertical">>"""/>
The following example sets the default tab to be the first tiddler selected in the filter and makes the saved state non-persistent (by using "~$:/temp/"):
<$macrocall $name=".example" n="4"
eg="""<$set name=tl filter="[tag[sampletab]nsort[order]]">
<$transclude $variable=tabs tabsList=<<tl>> default={{{[enlist<tl>]}}} state="$:/temp/state/tab" class="tc-vertical"/>
</$set>"""/>
<<.from-version "5.4.0">> Dynamic parameters can be used to specify the default tab:
<$macrocall $name=".example" n="5"
eg="""<<tabs "[tag[sampletab]nsort[order]]" default={{{[tag[sampletab]nsort[order]]}}} state="$:/temp/state/tab" class="tc-vertical">>"""/>
@@ -1,6 +1,6 @@
caption: Calls
created: 20221007130006705
modified: 20260301030947969
modified: 20260125212303316
tags: WikiText Procedures Functions Macros
title: Calls
type: text/vnd.tiddlywiki
@@ -25,12 +25,6 @@ Each parameter value can be enclosed in `'`single quotes`'`, `"`double quotes`"`
See the discussion about [[parser modes|WikiText parser mode: macro examples]]
!!! Examples
<<testcase TestCases/Calls/ProcedureStaticAttributes>>
<<testcase TestCases/Calls/ProcedureDynamicAttributes>>
!! Calls with <<.wlink TranscludeWidget>> Widget
The shortcut syntax expands to the <<.wlink TranscludeWidget>> widget with the `$variable` attribute specifying the name of the procedure to transclude.
@@ -55,10 +49,8 @@ The text returned from a call can be directly assigned to an attribute of a widg
Calls can be used in filters. The text is not wikified which again means that the parameters will be ignored.
//Note that currently only literal string parameters are supported//
```
<$list filter="[<my-procedure>]">
...
</$list>
```
```
@@ -1,10 +0,0 @@
title: $:/changenotes/5.4.0/#9280
description: Fixed :reverse suffix being ignored by version sort filter
tags: $:/tags/ChangeNote
release: 5.4.0
change-type: bugfix
change-category: filters
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9280
github-contributors: Flibbles
When using the version suffix with the sort filter, the reverse flag had no effect. Fixed.
@@ -1,12 +0,0 @@
title: $:/changenotes/5.4.0/#9297
description: Better support for downloading binary image tiddlers
tags: $:/tags/ChangeNote
release: 5.4.0
change-type: enhancement
change-category: usability
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9297
github-contributors: Flibbles
TiddlyWiki used to convert to blob all tiddlers intended to be downloaded, which is efficient, but interfered with a browser's ability to download binary image data in a way that it recognized.
This isn't necessarily the best solution, but it makes image downloading possible in TiddlyWiki until we require a more sufficient solution.
@@ -0,0 +1,17 @@
title: $:/changenotes/5.4.0/#9397
description: Fix critical freelinks bugs: first character loss and false positive matches in v5.4.0
release: 5.4.0
tags: $:/tags/ChangeNote
change-type: bugfix
change-category: plugin
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9084 https://github.com/TiddlyWiki/TiddlyWiki5/pull/9397
github-contributors: s793016
This note addresses two major bugs introduced in the Freelinks plugin with the v5.4.0 release:
Fixes:
* First Character Loss: The first character of a matched word would incorrectly disappear (e.g., "The" became "he"). This was fixed by correctly timing the filtering of the current tiddler's title during match validation, ensuring proper substring handling.
* False Positive Matches: Unrelated words (like "it is" or "Choose") would incorrectly link to a tiddler title. This was resolved by fixing wrong output merging in the Aho-Corasick failure-link handling, eliminating spurious matches from intermediate nodes, and adding cycle detection.
Impact:
* Significantly improved correctness and reliability of automatic linking for all users, especially in multilingual and large wikis.
@@ -0,0 +1,9 @@
title: $:/changenotes/5.4.0/#9400/impacts/collator
changenote: $:/changenotes/5.4.0/#9400
created: 20251114102355243
modified: 20251114102355243
tags: $:/tags/ImpactNote
description: Tiddlywiki no longer works on browsers that doesn't support [[Intl.Collator|https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator]]
impact-type: compatibility-break
@@ -0,0 +1,10 @@
title: $:/changenotes/5.4.0/#9400
description: Add locale support for sort operators
release: 5.4.0
tags: $:/tags/ChangeNote
change-type: feature
change-category: filters
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9400
github-contributors: Leilei332
Add a new parameter for `sort`, `nsort`, `sortan`, `sortcs` and `nsortcs` to support sorting with a custom locale.
@@ -1,48 +0,0 @@
title: $:/changenotes/5.4.0/#9676
description: Fix critical freelinks bugs: first character loss and false positive matches in v5.4.0
release: 5.4.0
tags: $:/tags/ChangeNote
change-type: bugfix
change-category: plugin
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9084 https://github.com/TiddlyWiki/TiddlyWiki5/pull/9397 https://github.com/TiddlyWiki/TiddlyWiki5/pull/9676
github-contributors: s793016
Fixes and optimizations to the Freelinks plugin's Aho-Corasick implementation following #9397.
Fixes:
* Failure Links Non-Functional (Critical): The failure link map used a plain object `{}` with trie nodes as keys. Since all JavaScript objects coerce to the same string `[object Object]`, every node resolved to the same map entry. Failure links were silently broken for all overlapping patterns. Fixed by replacing with `WeakMap`.
* Cache Rebuilt on Every UI Interaction (Performance): Any `$:/state/...` update (e.g. clicking tabs) would trigger a full Aho-Corasick rebuild, causing severe lag on large wikis. The `refresh` logic now ignores system tiddlers, with an explicit allowlist for plugin config tiddlers.
* Short Match Blocking Longer Match: A shorter title appearing earlier (e.g. "The New") could prevent a longer overlapping title (e.g. "New York City") from matching. Replaced left-to-right greedy selection with global length-first sorting and interval occupation tracking.
* Unicode Index Desync in ignoreCase Mode: Calling `toLowerCase()` on the full text before searching could change string length (e.g. Turkish "İ" expands), causing `substring()` to split Emoji surrogate pairs and produce garbage output. Case conversion is now done per-character during search.
* Removed Vestigial Regex Escaping: `escapeRegExp()` was called during trie construction but Aho-Corasick operates on literal character transitions, not regex. Removed.
Impact:
* Overlapping titles now match correctly for the first time.
* No cache rebuilds during normal UI interactions on large wikis.
* Correct longest-match behavior for titles sharing substrings.
* Safe Emoji and complex Unicode handling in case-insensitive mode.
#9397
This note addresses two major bugs introduced in the Freelinks plugin with the v5.4.0 release:
Fixes:
* First Character Loss: The first character of a matched word would incorrectly disappear (e.g., "The" became "he"). This was fixed by correctly timing the filtering of the current tiddler's title during match validation, ensuring proper substring handling.
* False Positive Matches: Unrelated words (like "it is" or "Choose") would incorrectly link to a tiddler title. This was resolved by fixing wrong output merging in the Aho-Corasick failure-link handling, eliminating spurious matches from intermediate nodes, and adding cycle detection.
Impact:
* Significantly improved correctness and reliability of automatic linking for all users, especially in multilingual and large wikis.
#9084
This change introduces a fully optimized override of the core text widget, integrating an enhanced Aho-Corasick algorithm for automatic linkification of tiddler titles within text (freelinks). The new implementation prioritizes performance for large wikis and correct support for non-Latin scripts such as Chinese.
Highlights:
- Full switch from regex-based matching to a custom, robust Aho-Corasick engine dedicated to rapid, multi-pattern title detection—drastically decreasing linkification time (tested: 15s reduced to 100500ms on ~12,000 tiddlers).
- Handles extremely large title sets gracefully, including a chunked insertion process and use of a persistent cache (`$:/config/Freelinks/PersistAhoCorasickCache`) to further accelerate subsequent linking operations in large/active wikis.
- Improvements for CJK and non-Latin text: supports linking using long or full-width symbol titles such as '' (U+FF1A) with no split or mismatch.
- Smart prioritization: longer titles are automatically matched before shorter, more ambiguous ones, preventing partial/incorrect linking.
- Actively skips self-linking in the current tiddler and prevents overlapping matches for clean, deterministic linkification.
- End users with large or multilingual wikis see massive performance boost and 100% accurate linking for complex, full-width, or multi-language titles.
- New options for persistent match cache and word boundary checking (`$:/config/Freelinks/WordBoundary`), both can be tuned based on wiki size and content language needs.
- Safe for gradual rollout: legacy behavior is preserved if the new freelinks override is not enabled.
@@ -1,13 +0,0 @@
change-category: hackability
change-type: enhancement
created: 20260228212206750
description: Allows modular relinking behavior for plugin support
github-contributors: flibbles
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9703
modified: 20260228212206750
release: 5.4.0
tags: $:/tags/ChangeNote
title: $:/changenotes/5.4.0/#9703
type: text/vnd.tiddlywiki
This PR introduces the `relinker` module type so that plugins can introduce behavior whenever a tiddler is renamed. This could be enhanced tiddler relinking behavior, server behavior, or temp tiddler changes.
@@ -9,12 +9,9 @@ description: Under development
\procedure release-introduction()
Release v5.4.0 deliberately and forensically loosens backwards compatibility to clear the path for significant new features and fundamental improvements to be made in the future.
''Please note that there are some changes that do not yet change notes, please see the change history on ~GitHub for the full list of changes.''
See the [[project plan|https://github.com/orgs/TiddlyWiki/projects/4]] for full details.
\end release-introduction
\define banner-credit-user-name() Peter
\define banner-credit-user-link() https://talk.tiddlywiki.org/u/peter
\define banner-credit-discussion-link() https://talk.tiddlywiki.org/t/vote-for-the-banner-tiddlywiki-v5-4-0/15016
\define banner-credit-permalink() https://raw.githubusercontent.com/TiddlyWiki/TiddlyWiki5/92caa7312ebc51c59cd345cc81b4a326661a0650/editions/tw5.com/tiddlers/images/New%20Release%20Banner.webp
<<releasenote 5.4.0>>
@@ -366,7 +366,7 @@ These are significant improvements that will benefit a broad range of users, and
<$list filter="[enlist<release-github-contributors>sort[]]" variable="username">
<li>
<a href={{{ [[https://github.com/]addsuffix<username>] }}} class="tc-tiddlylink-external" target="_blank" rel="noopener noreferrer">
<span class="doc-github-contributor-avatar"><img src={{{ [[https://avatars.githubusercontent.com/]addsuffix<username>addsuffix[?size=64]] }}} width="64" height="64"/></span>
<span class="doc-github-contributor-avatar"><img src={{{ [[https://github.com/]addsuffix<username>addsuffix[.png?size=64]] }}} width="64" height="64"/></span>
<span class="doc-github-contributor-username">@<$text text=<<username>>/></span>
</a>
</li>
@@ -1,14 +1,10 @@
created: 20130823203800000
modified: 20260220093010752
modified: 2020051619421803
tags: About
title: RoadMap
type: text/vnd.tiddlywiki
TiddlyWiki was first released in 2013, 9 years after the original [[TiddlyWiki Classic]]. Since then there have been 41 releases, making TiddlyWiki steadily more flexible and reliable. We have ambitious plans for the future as well: v5.4.x, v5.5.x, and eventually TWXX.
TiddlyWiki 5 is now a mature, stable project that is relied upon by many people. Simultaneously, it is rapidly evolving in many directions thanks to the broad community of developers and users. This paradoxical situation is possible because the project strictly maintains backwards compatibility, adding new features alongside the existing ones.
Our version numbering follows the form v5.x.0. ~TiddlyWiki is currently on v<<version>>, and so we are currently working towards v5.4.0.
There is no formal roadmap, but quite a few areas that have yet to be fully implemented, such as search and replace, and rich text editing. Current work can be found on ~GitHub at https://github.com/TiddlyWiki/TiddlyWiki5/
There is a detailed project plan on GitHub, but the major milestones are planned as follows:
* TiddlyWiki v5.4.0 will be followed by further v5.4.x releases to fix bugs and incrementally improve features. If there are significant backwards compatibility concerns then those improvements will be pushed into v5.5.0, the next release to make minor backwards comatibility tweaks.
* We'll go on to make v5.6.0, v5.7.0 etc releases until we're ready to release the next major redesign, that is not compromised by backwards compatibility. We are calling this release ~TiddlyWiki XX ("~TiddlyWiki Twenty", or TWXX).
@@ -1,40 +0,0 @@
created: 20260301005951330
description: Procedure calls with dynamic attributes
modified: 20260301013907635
tags: $:/tags/wiki-test-spec
title: TestCases/Calls/ProcedureDynamicAttributes
type: text/vnd.tiddlywiki-multiple
title: Narrative
New-style equals sign named parameters support dynamic values
+
title: Output
\function f(a) foo [<a>] :and[join[ ]]
\procedure p(a1) <$text text=<<a1>>/>
<$let v="foo 1" v2="foo 3">
<<p a1=<<v>>>> -
<<p a1=<<f 2>>>> -
<<p a1=`$(v2)$`>> -
<<p a1={{my tiddler}}>> -
<<p a1={{my tiddler!!myfield}}>> -
<<p a1={{{ foo 6 :and[join[ ]] }}}>>
</$let>
+
title: my tiddler
myfield: foo 5
foo 4
+
title: ExpectedResult
<p>
foo 1 -
foo 2 -
foo 3 -
foo 4 -
foo 5 -
foo 6
</p>
@@ -1,48 +0,0 @@
created: 20260301000418824
description: Procedure calls with static attributes
modified: 20260301031128810
tags: $:/tags/wiki-test-spec
title: TestCases/Calls/ProcedureStaticAttributes
type: text/vnd.tiddlywiki-multiple
title: Narrative
Positional, old style colon named parameters, and new-style equals sign named parameters support static values
+
title: Output
\procedure p(a1) <$text text=<<a1>>/>
<<p foo1>> -
<<p a1:foo2>> -
<<p a1=foo3>>
<<p "foo 4">> -
<<p a1:"foo 5">> -
<<p a1="foo 6">>
<<p 'foo 7'>> -
<<p a1:'foo 8'>> -
<<p a1='foo 9'>>
<<p """foo 10""">> -
<<p a1:"""foo 11""">> -
<<p a1="""foo 12""">>
<<p [[foo 13]]>> -
<<p a1:[[foo 14]]>> -
<<p a1=[[foo 15]]>>
+
title: ExpectedResult
<p>foo1 -
foo2 -
foo3</p><p>foo 4 -
foo 5 -
foo 6</p><p>foo 7 -
foo 8 -
foo 9</p><p>foo 10 -
foo 11 -
foo 12</p><p>foo 13 -
foo 14 -
foo 15</p>
@@ -79,14 +79,3 @@ The following is a table with maximum width. It contains [[TextWidget]]s with ma
| Cell1|<$edit-text tiddler="$:/temp/test-table-input" tag="input" field="test"/> |
|^ [[Link to a tiddler]]<br>some more text|<$edit-text tiddler="$:/temp/test-table-input" field="text"/> |
""">>
!! Table with Alternating Row Styles
You will need to create your own stylesheet. See [[Using Stylesheets]]. The idea is to create rules using `:nth-of-type(even/odd)`. For example:
```
.myclass tbody tr:nth-of-type(even) { background-color: <<color tiddler-editor-fields-even>>; }
.myclass tbody tr:nth-of-type(odd) { background-color: <<color tiddler-editor-fields-odd>>; }
```
<<.note """~TiddlyWiki automatically applies classes `evenRow` and `oddRow` to table rows. However, use of these classes is not recommended. Rows start as 'even' (opposite to that expected) and all the rows of the table are considered to be a single combined set of rows, regardless of if they appear in the header, footer, or body.""">>
+2 -3
View File
@@ -4,11 +4,10 @@
"tiddlywiki/browser-sniff",
"tiddlywiki/confetti",
"tiddlywiki/dynannotate",
"tiddlywiki/tour",
"tiddlywiki/internals",
"tiddlywiki/menubar",
"tiddlywiki/railroad",
"tiddlywiki/tour",
"tiddlywiki/dom-to-image"
"tiddlywiki/railroad"
],
"themes": [
"tiddlywiki/vanilla",
+6 -14
View File
@@ -96,10 +96,6 @@ Plugins/PluginWillRequireReload: (rechargement requis)
Plugins/Plugins/Caption: Plugins
Plugins/Plugins/Hint: Plugins
Plugins/Reinstall/Caption: réinstalle
Plugins/Stability/Deprecated: DÉPRÉCIÉ
Plugins/Stability/Experimental: EXPÉRIMENTAL
Plugins/Stability/Legacy: LEGACY
Plugins/Stability/Stable: STABLE
Plugins/Themes/Caption: Thèmes
Plugins/Themes/Hint: Plugins de thème
Plugins/Update/Caption: mise à jour
@@ -132,16 +128,17 @@ Saving/GitService/Gitea/Password: //Jeton d'accès// pour cette API (via l'inter
Saving/TiddlySpot/Advanced/Heading: Paramètres avancés
Saving/TiddlySpot/BackupDir: Dossier des //sauvegardes//
Saving/TiddlySpot/Backups: Sauvegardes
Saving/TiddlySpot/Caption: Enregistreur ~TiddlyHost
Saving/TiddlySpot/ControlPanel: Panneau de contrôle ~TiddlyHost
Saving/TiddlySpot/Description: Ces paramètres ne servent que lors de la sauvegarde vers [[TiddlyHost|https://tiddlyhost.com]] ou vers un serveur distant compatible. Voir [[ici|https://github.com/simonbaird/tiddlyhost/wiki/TiddlySpot-Saver-configuration-for-Tiddlyhost-and-Tiddlyspot]] pour plus d'informations sur la configuration de la sauvegarde sur ~TiddlyHost.
Saving/TiddlySpot/Caption: Enregistreur ~TiddlySpot
Saving/TiddlySpot/ControlPanel: Panneau de contrôle ~TiddlySpot
Saving/TiddlySpot/Description: Ces paramètres ne servent que lors de la sauvegarde vers [[TiddlySpot|http://tiddlyspot.com]], [[TiddlyHost|https://tiddlyhost.com]] ou vers un serveur distant compatible. Voir [[ici|https://github.com/simonbaird/tiddlyhost/wiki/TiddlySpot-Saver-configuration-for-Tiddlyhost-and-Tiddlyspot]] pour plus d'informations sur la configuration de la sauvegarde sur ~TiddlySpot et ~TiddlyHost.
Saving/TiddlySpot/Filename: Nom du fichier enregistré
Saving/TiddlySpot/Heading: ~TiddlyHost
Saving/TiddlySpot/Heading: ~TiddlySpot
Saving/TiddlySpot/Hint: //L'URL par défaut est `http://<nom du wiki>.tiddlyspot.com/store.cgi`. Elle peut être remplacée par une adresse serveur personnalisée, comme `http://example.com/store.php`.//
Saving/TiddlySpot/Password: Mot de passe
Saving/TiddlySpot/ReadOnly: Notez que [[TiddlySpot|http://tiddlyspot.com]] n'autorise plus la création de nouveaux sites. Pour les nouveaux sites vous pouvez utiliser [[TiddlyHost|https://tiddlyhost.com]], un nouveau service d'hébergement qui remplace ~TiddlySpot.
Saving/TiddlySpot/ServerURL: URL du serveur
Saving/TiddlySpot/UploadDir: Dossier des dépôts
Saving/TiddlySpot/UserName: Nom du Wiki
Saving/TiddlySpot/UserName: Nom utilisé pour ce Wiki
Settings/AutoSave/Caption: Sauvegarde automatique
Settings/AutoSave/Disabled/Description: Pas de sauvegarde automatique des modifications
Settings/AutoSave/Enabled/Description: Sauvegarde automatique des modifications
@@ -187,8 +184,6 @@ Settings/DefaultSidebarTab/Caption: Onglet par défaut sur la barre latérale
Settings/DefaultSidebarTab/Hint: Indique l'onglet de la barre latérale qui sera affiché par défaut
Settings/DefaultMoreSidebarTab/Caption: Onglet par défaut sous le Plus de la barre latérale
Settings/DefaultMoreSidebarTab/Hint: Indique quel onglet sera affiché par défaut sous le Plus de la barre latérale
Settings/DefaultTiddlerInfoTab/Caption: Onglet par défaut pour les Infos du tiddler
Settings/DefaultTiddlerInfoTab/Hint: Spécifie l'onglet affiché par défaut lorsque le panneau d'information du tiddler est ouvert
Settings/LinkToBehaviour/Caption: Comportement à l'ouverture du tiddler
Settings/LinkToBehaviour/InsideRiver/Hint: Navigation depuis un emplacement //interne// au déroulé
Settings/LinkToBehaviour/OutsideRiver/Hint: Navigation depuis un emplacement //externe// au déroulé
@@ -250,6 +245,3 @@ ViewTemplateSubtitle/Caption: Visualisation du sous-titre
ViewTemplateSubtitle/Hint: Cette cascade de règles est utilisée par le template de visualisation par défaut pour choisir dynamiquement le template d'affichage du sous-titre d'un tiddler.
ViewTemplateTags/Caption: Visualisation des tags
ViewTemplateTags/Hint: Cette cascade de règles est utilisée par le template de visualisation par défaut pour choisir dynamiquement le template d'affichage de la zone de tags d'un tiddler.
WikiInformation/Caption: Informations sur le Wiki
WikiInformation/Hint: Cette page rassemble quelques informations générales sur la configuration de ce ~TiddlyWiki. Elle est conçue pour permettre de partager rapidement certains aspects de sa configuration avec d'autres, par exemple lorsqu'on demande de l'aide sur un forum. Elle ne contient aucune information privée ni personnelle, et rien n'est partagé sans être explicitement copié-collé ailleurs.
WikiInformation/Drag/Caption: Déplacer ce lien pour copier cet outil sur un autre wiki
-1
View File
@@ -1,6 +1,5 @@
title: $:/language/
Alerts: Alertes
AboveStory/ClassicPlugin/Warning: On dirait que vous essayez de charger un plugin conçu pour ~TiddlyWiki Classic. Merci de noter que [[ces plugins ne fonctionnent pas avec TiddlyWiki version 5.x.x|https://tiddlywiki.com/#TiddlyWikiClassic]]. Plugins ~TiddlyWiki Classic détectés :
BinaryWarning/Prompt: Ce tiddler contient des données binaires
ClassicWarning/Hint: Ce tiddler est écrit au format TiddlyWiki Classic, qui n'est pas entièrement compatible avec TiddlyWiki version 5. Pour en savoir plus, rendez-vous à l'adresse https://tiddlywiki.com/static/Upgrading.html.
-1
View File
@@ -30,7 +30,6 @@ EditorHeight/Caption: エディタの縦幅
EditorHeight/Caption/Auto: コンテンツに合わせて自動的に高さを調整します
EditorHeight/Caption/Fixed: 縦幅の固定:
EditorHeight/Hint: テキストエディタの縦幅を選択します
EmergencyDownload/Caption: JSON形式でTiddlerをダウンロード
Encryption/Caption: 暗号化
Encryption/ClearPassword/Caption: パスワードの解除
Encryption/ClearPassword/Hint: パスワードと暗号化を解除します
+7 -7
View File
@@ -6,7 +6,6 @@ Appearance/Caption: 外観
Appearance/Hint: TiddlyWiki 外観のカスタマイズ方法
Basics/AnimDuration/Prompt: アニメーション時間:
Basics/AutoFocus/Prompt: 新しい Tiddler の標準フォーカスフィールド
Basics/AutoFocusEdit/Prompt: 既存のTIddlerの標準フォーカスフィールド
Basics/Caption: 基本
Basics/DefaultTiddlers/BottomHint: タイトルに空白を含めたいときは &#91;&#91;二重の角カッコ&#93;&#93; を使用してください。そのほか {{保存時の表示を維持||$:/snippets/retain-story-ordering-button}} することもできます。
Basics/DefaultTiddlers/Prompt: デフォルト Tiddler:
@@ -137,13 +136,14 @@ Saving/Hint: セーバーモジュールで TiddlyWiki 全体を 1 ファイル
Saving/TiddlySpot/Advanced/Heading: 詳細設定
Saving/TiddlySpot/BackupDir: バックアップディレクトリ
Saving/TiddlySpot/Backups: バックアップ
Saving/TiddlySpot/Caption: ~TiddlyHost セーバー
Saving/TiddlySpot/ControlPanel: ~TiddlyHost コントロールパネル
Saving/TiddlySpot/Description: この設定は、 [[TiddlyHost|https://tiddlyhost.com]] または互換性のあるリモートサーバーへ保存する場合に使います。~TiddlyHostへの保存設定に関しては、[[ここ|https://github.com/simonbaird/tiddlyhost/wiki/TiddlySpot-Saver-configuration-for-Tiddlyhost-and-Tiddlyspot]]を参照してください
Saving/TiddlySpot/Caption: ~TiddlySpot セーバー
Saving/TiddlySpot/ControlPanel: ~TiddlySpot コントロールパネル
Saving/TiddlySpot/Description: この設定は、 http://tiddlyspot.com または互換性のあるリモートサーバーへ保存する場合に使います。
Saving/TiddlySpot/Filename: アップロードファイル名
Saving/TiddlySpot/Heading: ~TiddlyHost
Saving/TiddlySpot/Hint: //サーバーのURLには `http://<wikiname>.tiddlyspot.com/` がデフォルトで使用されます。ほかのサーバーのアドレス(例えば、`http://example.com/store.php`)を指定することもできます。//
Saving/TiddlySpot/Heading: ~TiddlySpot
Saving/TiddlySpot/Hint: //サーバーのURLには `http://<wikiname>.tiddlyspot.com/store.cgi` がデフォルトで使用されます。ほかのサーバーのアドレスを指定することもできます。//
Saving/TiddlySpot/Password: パスワード
Saving/TiddlySpot/ReadOnly: [[TiddlySpot|http://tiddlyspot.com]] では、新しいサイトの作成ができなくなりました。 ~TiddlySpot に代わる新しいホスティングサービスである [[TiddlyHost|https://tiddlyhost.com]] 新しいサイトを制作できます。
Saving/TiddlySpot/ServerURL: サーバー URL
Saving/TiddlySpot/UploadDir: アップロードディレクトリ
Saving/TiddlySpot/UserName: Wiki 名
@@ -153,7 +153,7 @@ Settings/AutoSave/Enabled/Description: 自動的に保存する
Settings/AutoSave/Hint: 自動的に保存するかどうかを設定します
Settings/CamelCase/Caption: Camel Case Wiki リンク
Settings/CamelCase/Description: 自動で ~CamelCase リンクを有効にする
Settings/CamelCase/Hint: 有効にするには再読み込みが必要です
Settings/CamelCase/Hint: ~CamelCase フレーズの自動リンクをグローバルに無効にすることができます。有効にするには再読み込みが必要です
Settings/Caption: 設定
Settings/DefaultMoreSidebarTab/Caption: デフォルトのサイドバー 詳しく タブ
Settings/DefaultMoreSidebarTab/Hint: デフォルトで表示されるサイドバー 詳しく タブを指定します
+1 -1
View File
@@ -10,7 +10,7 @@ config: `$tw.config` に格納されるデータ。
filteroperator: 個々のフィルタ操作用メソッドモジュール。
global: `$tw` に格納されるグローバルデータ。
info: [[$:/temp/info-plugin]] 疑似プラグインを介してシステム情報を公開します。
isfilteroperator: ''is''フィルタオペレータのパラメータ
isfilteroperator: フィルタ ''is'' メソッドのオペランドモジュール
library: JavaScript汎用モジュール用の汎用モジュールタイプ。
macro: JavaScript マクロの定義モジュール。
parser: 各種 ContentType のパーサモジュール。
-4
View File
@@ -1,4 +0,0 @@
title: $:/language/Draft/
Attribution: {{$:/status/UserName}}による'<<draft-title>>'のドラフト
Title: '<<draft-title>>'のドラフト
+4 -4
View File
@@ -1,6 +1,6 @@
title: $:/language/Exporters/
CsvFile: CSVファイル
JsonFile: JSONファイル
StaticRiver: 静的HTML
TidFile: TIDテキストファイル
CsvFile: CSV ファイル
JsonFile: JSON ファイル
StaticRiver: 静的 HTML ファイルとして構成される一連の Tiddler
TidFile: ".tid" ファイル
+4 -4
View File
@@ -8,16 +8,16 @@ caption: タブやボタンに表示されるテキスト
class: Tiddlerをレンダリングする際に適用されるCSSクラスです。モーダルにも使用されます
code-body: ''yes'' に設定すると、表示テンプレートは、コードとして Tiddler を表示します
color: Tiddler に使用される CSS カラーの値
component: アラートTiddlerの原因となったコンポーネントの名前
component: [[アラート Tiddler|AlertMechanism]] の原因となったコンポーネントの名前
core-version: プラグインの場合、互換性のあるTiddlyWikiのバージョンを示します
created: Tiddler が作成された日付
creator: Tiddler の作成者名
current-tiddler: 履歴一覧のトップにあるTiddlerをキャッシュするために使用されます
current-tiddler: [[履歴一覧|HistoryMechanism]] のトップにある Tiddler をキャッシュするために使用されます
dependents: プラグインが依存する他のプラグインのリスト
description: プラグインなどの説明文
draft.of: それがドラフト Tiddler であるときのタイトル
draft.title: ドラフト Tiddler が正式版になったときに使用される予定のタイトル
footer: モーダルのフッタ部テキスト
footer: ウィザードのフッタ部テキスト
hide-body: ''yes'' に設定すると表示テンプレートは、Tiddler の本文を非表示にします
icon: 紐付けられているアイコン Tiddler のタイトル
library: ''yes'' の場合、その Tiddler は JavaScript ライブラリとして保存する必要があります
@@ -35,7 +35,7 @@ released: TiddlyWiki のリリース日付
revision: サーバー上の Tiddler のリビジョン
source: その Tiddler のソース URL
stability: プラグインの開発状況: 非推奨、実験的、安定版、またはレガシー
subtitle: モーダルのサブタイトル
subtitle: ウィザードのサブタイトル
tags: その Tiddler に付けられたタグのリスト
text: Tiddler の本文
throttle.refresh: 存在する場合、この Tiddler の更新を抑制します
+14 -7
View File
@@ -1,18 +1,25 @@
title: GettingStarted
\define lingo-base() $:/language/ControlPanel/Basics/
~TiddlyWikiと~TiddlyWikiコミュニティにようこそ
~TiddlyWiki にようこそ。これは個人で使える Web ノートです
TiddlyWikiに重要な情報を書き込む前に、変更内容を確実に保存できることを確認することが不可欠です。詳細は https://tiddlywiki.com/#GettingStarted をご覧ください。
作業を開始する前に保存機能が正しく使えるかどうかをご確認ください。 - 詳細は https://tiddlywiki.com/ の説明をご覧ください。
それでは始めましょう:
* サイドバーにある「+」ボタンで新しい Tiddler を作成します。
* サイドバーにある「歯車」ボタンで コントロールパネル を開いて、この Wiki に対する設定ができます。
** 「基本」タブのデフォルト Tiddler を変更することで、Wiki を開くたびにこのメッセージが表示されないようにできます。
* 変更を保存するにはサイドバーの「ダウンロード」ボタンを押してください。
* 書式に関する詳細は WikiText を参照してください。
!! この ~TiddlyWiki を設定
<div class="tc-control-panel">
|tc-table-no-border tc-first-col-min-width tc-first-link-nowrap|k
| <$link to="$:/SiteTitle"><<lingo Title/Prompt>></$link>|<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> |
| <$link to="$:/SiteSubtitle"><<lingo Subtitle/Prompt>></$link>|<$edit-text tiddler="$:/SiteSubtitle" default="" tag="input"/> |
|^ <$link to="$:/DefaultTiddlers"><<lingo DefaultTiddlers/Prompt>></$link><br><<lingo DefaultTiddlers/TopHint>>|<$edit tag="textarea" tiddler="$:/DefaultTiddlers"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |
|<$link to="$:/SiteTitle"><<lingo Title/Prompt>></$link> |<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> |
|<$link to="$:/SiteSubtitle"><<lingo Subtitle/Prompt>></$link> |<$edit-text tiddler="$:/SiteSubtitle" default="" tag="input"/> |
|<$link to="$:/DefaultTiddlers"><<lingo DefaultTiddlers/Prompt>></$link> |<<lingo DefaultTiddlers/TopHint>><br> <$edit-text tag="textarea" tiddler="$:/DefaultTiddlers"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |
</div>
より多くのオプションについては[[コントロールパネル|$:/ControlPanel]]を参照してください。
より多くのオプションは [[control panel|$:/ControlPanel]] を参照してください。
+1 -1
View File
@@ -1,7 +1,7 @@
title: $:/language/Help/deletetiddlers
description: Tiddlerのグループを削除
<<.from-version "5.1.20">> フィルターによって識別されたTiddlerのグループを削除します。
フィルターによって識別されたTiddlerのグループを削除します。
```
--deletetiddlers <filter>
+2 -5
View File
@@ -1,15 +1,12 @@
title: $:/language/Help/load
description: ファイルから Tiddler を読み込み
TiddlyWiki(`.html`)`.tiddler``.tid``.json`、またはその他のローカルファイルからTiddlerを読み込みます。入力ファイルに適用される処理は、ファイル拡張子によって決定されます。デシリアライザとエンコーディングを明示的に指定する必要がある場合は、代わりに`import`コマンドを使用してください
Tiddler を TiddlyWiki Ver.2 のファイル (`.html`), `.tiddler`, `.tid`, `.json` などから読み込みます
```
--load <filepath> [noerror]
--load <dirpath> [noerror]
--load <filepath>
```
デフォルトでは、loadコマンドはTiddlerが見つからない場合にエラーを発生します。オプションの"noerror"パラメータを指定することで、このエラーを抑制できます。
暗号化された TiddlyWiki ファイルから読み込むためには、最初に password コマンドでパスワードを指定する必要があります。
使用例:
-1
View File
@@ -7,4 +7,3 @@ description: 暗号化のパスワードの設定
--password <password>
```
''注意'': このコマンドはパスワード保護付きのTiddlyWikiの提供には使用しないでください。代わりに、[[Serverコマンド|ServerCommand]]のpasswordオプションを参照してください。
+3 -19
View File
@@ -1,24 +1,8 @@
title: $:/language/Help/rendertiddler
description: 個々のTiddlerを指定したContentTypeで出力
description: 個々の Tiddler を指定した ContentType で出力
(注意: この`--rendertiddler`コマンドは、より柔軟な新しい`--render`コマンドに置き換えられたため、非推奨となりました。)
個々のTiddlerを指定したContentTypeで出力します。デフォルトは`text/html`で、指定されたファイル名で内容を保存します。
オプションとして、テンプレートTiddlerのタイトルを指定できます。その場合、テンプレートTiddlerは、レンダリング中のTiddler(最初のパラメータ値)を"currentTiddler"変数に設定した状態でレンダリングされます。
追加変数の名前と値を任意で指定することもできます。
個々の Tiddler を指定した ContentType で出力します。デフォルトは `text/html` で、指定されたファイル名で内容を保存します。
```
--rendertiddler <title> <filename> [<type>] [<template>] [<name>] [<value>]
--rendertiddler <title> <filename> [<type>]
```
デフォルトでは、ファイル名はeditionディレクトリの`output`サブディレクトリからの相対として解決されます。`--output`コマンドを使用すると、出力先を別のディレクトリに指定できます。
ファイル名へのパス中の存在しないディレクトリは自動的に作成されます。
例えば、次のコマンドは、コアテンプレート`$:/core/templates/exporters/JsonFile`を使用して、フィルター`[tag[done]]`に一致するすべてのTiddlerを`output.json`というJSONファイルに保存します。
```
--rendertiddler "$:/core/templates/exporters/JsonFile" output.json text/plain "" exportFilter "[tag[done]]"
```
+3 -9
View File
@@ -1,20 +1,14 @@
title: $:/language/Help/rendertiddlers
description: フィルタパターンを指定してマッチする Tiddler を指定した ContentTypeで出力
(注意: この`--rendertiddlers`コマンドは、より柔軟な新しい`--render`コマンドに置き換えられたため、非推奨となりました。)
フィルタパターンを指定してマッチするTiddlerを指定したContentType(デフォルトは`text/html`)と拡張子(デフォルトは`.html`)で出力します。
フィルタパターンを指定してマッチする Tiddler を指定した ContentType(デフォルトは`text/html`)と拡張子(デフォルトは`.html`)で出力します。
```
--rendertiddlers '<filter>' <template> <pathname> [<type>] [<extension>] ["noclean"]
--rendertiddlers <filter> <template> <pathname> [<type>] [<extension>]
```
使用例:
```
--rendertiddlers '[!is[system]]' $:/core/templates/static.tiddler.html ./static text/plain
--rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html ./static text/plain
```
デフォルトでは、パス名はeditionディレクトリの`output`サブディレクトリからの相対として解決されます。`--output`コマンドを使用すると、出力先を別のディレクトリに指定できます。
''noclean''フラグが指定されていない限り、対象ディレクトリ内のファイルはすべて削除されます。対象ディレクトリが存在しない場合は、再帰的に作成されます。
+1 -7
View File
@@ -1,14 +1,8 @@
title: $:/language/Help/savetiddler
description: raw テキストの Tiddler をファイルに保存
(注意: この`--savetiddler`コマンドは、より柔軟な新しい`--save`コマンドに置き換えられたため、非推奨となりました。)
個別のTiddlerをrawテキストあるいはバイナリフォーマットにて、指定したファイル名に保存します。
個別の Tiddler を raw テキストあるいはバイナリフォーマットにて、指定したファイル名に保存します。
```
--savetiddler <title> <filename>
```
デフォルトでは、ファイル名はeditionディレクトリの`output`サブディレクトリからの相対として解決されます。`--output`コマンドを使用すると、出力先を別のディレクトリに指定できます。
ファイル名へのパス中の存在しないディレクトリは自動的に作成されます。
+6 -8
View File
@@ -1,16 +1,14 @@
title: $:/language/Help/savetiddlers
description: raw Tiddlerグループをディレクトリへ保存
description: raw Tiddler グループをファイルへ保存
(注意: `--savetiddlers`コマンドは非推奨で、新しい、より柔軟な`--save`コマンドが推奨されます)
(注意: `--savetiddler` コマンドは非推奨で、新しい、より柔軟な `--save` コマンドが優先されます)
個々のTiddlerを生のテキストまたはバイナリ形式で指定されたファイル名に保存します。
個々の Tiddler を生のテキストまたはバイナリ形式で指定されたファイル名に保存します。
```
--savetiddlers <filter> <pathname> ["noclean"]
--savetiddler <title> <filename>
```
デフォルトでは、パス名はeditionディレクトリの`output`サブディレクトリからの相対パスで解決されます。`--output`コマンドを使用すると、出力を別のディレクトリに向けることができます。
デフォルトでは、ファイル名はエディションディレクトリの `output` サブディレクトリからの相対パスで解決されます。 `--output` コマンドを使用すると、出力を別のディレクトリに向けることができます。
指定されたファイルを保存する前に、出力ディレクトリ内の既存ファイルが削除されます。''noclean''フラグを指定することで、この削除機能を無効にできます。
パス名に欠落しているディレクトリがあれば、自動的に作成されます。
ファイル名のパスに欠落しているディレクトリがあれば、自動的に作成されます。
+13 -24
View File
@@ -1,25 +1,25 @@
title: $:/language/Help/server
description: (非推奨: 'listen'コマンドを参照) TiddlyWikiHTTPサーバのインターフェースを提供
description: TiddlyWikiHTTP サーバのインターフェースを提供
HTTP経由でWikiを提供するためのレガシーコマンド
TiddlyWiki5 に組み込まれているサーバー機能は非常にシンプルなものです。TiddlyWeb との互換性はありますが、インターネット上で安定して公開するために必要となるいくつもの機能がサポートされていません
root 階層では指定された Tiddler のレンダリングを行います。root 階層以外では JSON エンコードされた個々の Tiddler や、一般的な HTTP 操作(`GET`, `PUT`, `DELETE`)をサポートします。
```
--server <port> <root-tiddler> <root-render-type> <root-serve-type> <username> <password> <host> <path-prefix> <debug-level>
--server <port> <roottiddler> <rendertype> <servetype> <username> <password> <host>
```
以下のパラメータがあります:
* ''port'' - 待ち受けるポート番号。数値以外の値は、システム環境変数として解釈され、ポート番号が抽出されます。(デフォルトは "8080")
* ''root-tiddler'' - root 階層になる Tiddler(デフォルトは "$:/core/save/all"
* ''root-render-type'' - root Tiddler がレンダリングされるときの ContentType(デフォルトは "text/plain"
* ''root-serve-type'' - root Tiddler がリクエストされるときの ContentType(デフォルトは "text/html"
* ''port'' - 待ち受けるポート番号デフォルトは "8080"
* ''roottiddler'' - root 階層になる Tiddler(デフォルトは "$:/core/save/all"
* ''rendertype'' - root Tiddler がレンダリングされるときの ContentType(デフォルトは "text/plain"
* ''servetype'' - root Tiddler がリクエストされるときの ContentType(デフォルトは "text/html"
* ''username'' - 編集した Tiddler を保存する際のデフォルトユーザ名
* ''password'' - オプションのベーシック認証用のパスワード
* ''host'' - オプションのサーバーとなるホスト名(デフォルトは "127.0.0.1" つまり "localhost"
* ''path-prefix'' - オプションのパスのプレフィックス
* ''debug-level'' - オプションのデバッグレベル。リクエストの詳細を表示するには"debug"に設定します(デフォルトは"none")
* ''password'' - ベーシック認証用のパスワード
* ''host'' - サーバーとなるホスト名(デフォルトは "127.0.0.1" つまり "localhost"
password パラメータが指定された場合ブラウザはユーザ名とパスワードを尋ねるようになります。なお、パスワードはネットワーク上を平文で流れるため、この実装は信頼できるネットワークやHTTPS接続でのみ使用してください。
password パラメータが指定された場合ブラウザはユーザ名とパスワードを尋ねるようになります。なお、このパスワードはネットワーク上を平文で流れるため、この実装はインターネット上に公開するような一般的な使用には適していないことに注意してください。
使用例:
@@ -27,16 +27,5 @@ password パラメータが指定された場合ブラウザはユーザ名と
--server 8080 $:/core/save/all text/plain text/html MyUserName passw0rd
```
ホスト名またはパスのプレフィックスを設定し、パスワードを必須にしたくない場合は、ユーザ名とパスワードを空の文字列として指定できます。
同時に複数の TiddlyWiki サーバーを起動したい場合は、それぞれに別々のポート番号を割り当てる必要があります。
```
--server 8080 $:/core/save/all text/plain text/html "" "" 192.168.0.245
```
このようなアドレスを使用すると、システムがローカルネットワークに公開されます。インスタンスをローカルネットワーク全体に公開する方法や、考えられるセキュリティ上の懸念事項については、TiddlyWiki.comのWebServer Tiddlerを参照してください。
同時に複数の TiddlyWiki サーバーを起動したい場合は、それぞれに別々のポート番号を割り当てる必要があります。ポート番号をNode.jsプロセスに渡すためには、環境変数を使用すると便利です。この例では、"MY_PORT_NUMBER"という環境変数を参照しています:
```
--server MY_PORT_NUMBER $:/core/save/all text/plain text/html MyUserName passw0rd
```
-2
View File
@@ -12,8 +12,6 @@ Listing/Preview/DiffFields: 差分 (項目)
Listing/Preview/Fields: 項目
Listing/Preview/Text: テキスト
Listing/Preview/TextRaw: テキスト (Raw)
Listing/ImportOptions/Caption: インポートオプション
Listing/ImportOptions/NoMatch: これらのファイルにはインポートオプションを適用しません。
Listing/Rename/CancelRename: キャンセル
Listing/Rename/ConfirmRename: Tiddler の名前を変更
Listing/Rename/OverwriteWarning: このタイトルの Tiddler はすでに存在しています。
+2 -3
View File
@@ -1,6 +1,5 @@
title: $:/language/
Alerts: アラート
AboveStory/ClassicPlugin/Warning: ~TiddlyWiki Classic用に設計されたプラグインを読み込もうとしています。 [[これらのプラグインは TiddlyWiki バージョン 5.xx では動作しません|these plugins do not work with TiddlyWiki version 5.x.x|https://tiddlywiki.com/#TiddlyWikiClassic]]のでご注意ください。検出された~TiddlyWiki Classic プラグイン:
BinaryWarning/Prompt: この Tiddler にはバイナリデータが含まれています
ClassicWarning/Hint: この Tiddler はクラシックスタイルの TiddlyWiki フォーマットで書かれています。このフォーマットは TiddlyWiki5 との完全な互換性はありません。詳しくは https://tiddlywiki.com/static/Upgrading.html を参照してください。
@@ -33,7 +32,7 @@ Error/Filter: フィルタエラー
Error/FilterRunPrefix: フィルタエラー: フィルタランのプレフィックスが不明です
Error/FilterSyntax: フィルタエラー: フィルタ式のシンタックスが間違っています
Error/FormatFilterOperator: フィルタエラー: 'format'フィルタオペレータのサフィックスが不明です
Error/IsFilterOperator: フィルタエラー: 'is'フィルタオペレータのパラメータが不明です
Error/IsFilterOperator: フィルタエラー: 'is'フィルタオペレータのオペランドが不明です
Error/LoadingPluginLibrary: プラグインライブラリの読み込みエラー
Error/NetworkErrorAlert: `<h2>''ネットワークエラー''</h2>サーバーへの接続が失われたようです。ネットワーク接続に問題がある可能性があります。続行する前に、ネットワーク接続を回復してください。<br><br>''保存されていない変更は、接続が回復すると自動的に同期されます。''`
Error/PutEditConflict: サーバー上でファイルが変更されました
@@ -78,7 +77,7 @@ No: いいえ
OfficialPluginLibrary: 公式 ~TiddlyWiki プラグインライブラリ
OfficialPluginLibrary/Hint: tiddlywiki.comにある公式~TiddlyWikiプラグインライブラリ。プラグイン、テーマ、言語パックはコアチームによってメンテナンスされています。
PageTemplate/Description: 標準 ~TiddlyWiki レイアウト
PageTemplate/Name: 標準レイアウト
PageTemplate/Name: 標準 ~PageTemplate
PluginReloadWarning: ~JavaScript プラグインの変更を有効にするため、 {{$:/core/ui/Buttons/save-wiki}} 保存して {{$:/core/ui/Buttons/refresh}} 再読み込みしてください
RecentChanges/DateFormat: YYYY-0MM-0DD
Shortcuts/Input/Accept/Hint: 選択項目を許可します
+1 -1
View File
@@ -1,4 +1,4 @@
title: $:/config/NewJournal/
Text:
Tags: 日誌
Title: YYYY年MM月DD日(ddd)

Some files were not shown because too many files have changed in this diff Show More