mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-01-22 19:04:38 +00:00
Compare commits
12 Commits
fix-transc
...
tm-http-re
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb02f15972 | ||
|
|
483ade1f16 | ||
|
|
ec7d248dcd | ||
|
|
a927de5b78 | ||
|
|
09e626e8ab | ||
|
|
cc7b857d71 | ||
|
|
53715bd3fd | ||
|
|
f798bf5611 | ||
|
|
fc22df908d | ||
|
|
be1882dd4c | ||
|
|
0adc0518a6 | ||
|
|
585c7339de |
@@ -5,7 +5,7 @@
|
||||
# Default to the current version number for building the plugin library
|
||||
|
||||
if [ -z "$TW5_BUILD_VERSION" ]; then
|
||||
TW5_BUILD_VERSION=v5.3.1
|
||||
TW5_BUILD_VERSION=v5.3.0
|
||||
fi
|
||||
|
||||
echo "Using TW5_BUILD_VERSION as [$TW5_BUILD_VERSION]"
|
||||
@@ -107,7 +107,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
# /empty.html Empty
|
||||
# /empty.hta For Internet Explorer
|
||||
node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/empty \
|
||||
$TW5_BUILD_MAIN_EDITION \
|
||||
--verbose \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--build empty \
|
||||
|
||||
@@ -596,11 +596,11 @@ $tw.utils.evalGlobal = function(code,context,filename,sandbox,allowGlobals) {
|
||||
// Add the code prologue and epilogue
|
||||
code = [
|
||||
"(function(" + contextNames.join(",") + ") {",
|
||||
" (function(){" + code + "\n;})();\n",
|
||||
" (function(){\n" + code + "\n;})();",
|
||||
(!$tw.browser && sandbox && !allowGlobals) ? globalCheck : "",
|
||||
"\nreturn exports;\n",
|
||||
" return exports;\n",
|
||||
"})"
|
||||
].join("");
|
||||
].join("\n");
|
||||
|
||||
// Compile the code into a function
|
||||
var fn;
|
||||
@@ -1150,7 +1150,7 @@ $tw.Wiki = function(options) {
|
||||
shadowTiddlerTitles = null,
|
||||
getShadowTiddlerTitles = function() {
|
||||
if(!shadowTiddlerTitles) {
|
||||
shadowTiddlerTitles = Object.keys(shadowTiddlers).sort(function(a,b) {return a.localeCompare(b);});
|
||||
shadowTiddlerTitles = Object.keys(shadowTiddlers);
|
||||
}
|
||||
return shadowTiddlerTitles;
|
||||
},
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
title: $:/core/images/new-journal-button
|
||||
tags: $:/tags/Image
|
||||
|
||||
<$parameters size="22pt" day=<<now "DD">>><svg width=<<size>> height=<<size>> class="tc-image-new-journal-button tc-image-button" viewBox="0 0 128 128"><g fill-rule="evenodd"><path d="M102.545 112.818v11.818c0 1.306 1.086 2.364 2.425 2.364h6.06c1.34 0 2.425-1.058 2.425-2.364v-11.818h12.12c1.34 0 2.425-1.058 2.425-2.363v-5.91c0-1.305-1.085-2.363-2.424-2.363h-12.121V90.364c0-1.306-1.086-2.364-2.425-2.364h-6.06c-1.34 0-2.425 1.058-2.425 2.364v11.818h-12.12c-1.34 0-2.425 1.058-2.425 2.363v5.91c0 1.305 1.085 2.363 2.424 2.363h12.121zM60.016 4.965c-4.781-2.76-10.897-1.118-13.656 3.66L5.553 79.305A9.993 9.993 0 009.21 92.963l51.04 29.468c4.78 2.76 10.897 1.118 13.655-3.66l40.808-70.681a9.993 9.993 0 00-3.658-13.656L60.016 4.965zm-3.567 27.963a6 6 0 106-10.393 6 6 0 00-6 10.393zm31.697 17.928a6 6 0 106-10.392 6 6 0 00-6 10.392z"/><text class="tc-fill-background" font-family="Helvetica" font-size="47.172" font-weight="bold" transform="rotate(30 25.742 95.82)"><tspan x="42" y="77.485" text-anchor="middle"><$text text=<<day>>/></tspan></text></g></svg></$parameters>
|
||||
<$parameters size="22pt" day=<<now "DD">>>
|
||||
<svg width=<<size>> height=<<size>> class="tc-image-new-journal-button tc-image-button" viewBox="0 0 128 128"><g fill-rule="evenodd"><path d="M102.545 112.818v11.818c0 1.306 1.086 2.364 2.425 2.364h6.06c1.34 0 2.425-1.058 2.425-2.364v-11.818h12.12c1.34 0 2.425-1.058 2.425-2.363v-5.91c0-1.305-1.085-2.363-2.424-2.363h-12.121V90.364c0-1.306-1.086-2.364-2.425-2.364h-6.06c-1.34 0-2.425 1.058-2.425 2.364v11.818h-12.12c-1.34 0-2.425 1.058-2.425 2.363v5.91c0 1.305 1.085 2.363 2.424 2.363h12.121zM60.016 4.965c-4.781-2.76-10.897-1.118-13.656 3.66L5.553 79.305A9.993 9.993 0 009.21 92.963l51.04 29.468c4.78 2.76 10.897 1.118 13.655-3.66l40.808-70.681a9.993 9.993 0 00-3.658-13.656L60.016 4.965zm-3.567 27.963a6 6 0 106-10.393 6 6 0 00-6 10.393zm31.697 17.928a6 6 0 106-10.392 6 6 0 00-6 10.392z"/><text class="tc-fill-background" font-family="Helvetica" font-size="47.172" font-weight="bold" transform="rotate(30 25.742 95.82)"><tspan x="42" y="77.485" text-anchor="middle"><$text text=<<day>>/></tspan></text></g></svg>
|
||||
</$parameters>
|
||||
@@ -4,7 +4,7 @@ description: Saves a wiki to a new wiki folder
|
||||
<<.from-version "5.1.20">> Saves the current wiki as a wiki folder, including tiddlers, plugins and configuration:
|
||||
|
||||
```
|
||||
--savewikifolder <wikifolderpath> [<filter>] [ [<name>=<value>] ]*
|
||||
--savewikifolder <wikifolderpath> [<filter>]
|
||||
```
|
||||
|
||||
* The target wiki folder must be empty or non-existent
|
||||
@@ -12,23 +12,8 @@ description: Saves a wiki to a new wiki folder
|
||||
* Plugins from the official plugin library are replaced with references to those plugins in the `tiddlywiki.info` file
|
||||
* Custom plugins are unpacked into their own folder
|
||||
|
||||
The following options are supported:
|
||||
|
||||
* ''filter'': a filter expression that defines the tiddlers to include in the output.
|
||||
* ''explodePlugins'': defaults to "yes"
|
||||
** ''yes'' will "explode" plugins into separate tiddler files and save them to the plugin directory within the wiki folder
|
||||
** ''no'' will suppress exploding plugins into their constituent tiddler files. It will save the plugin as a single JSON tiddler in the tiddlers folder
|
||||
|
||||
Note that both ''explodePlugins'' options will produce wiki folders that build the same exact same original wiki. The difference lies in how plugins are represented in the wiki folder.
|
||||
|
||||
A common usage is to convert a TiddlyWiki HTML file into a wiki folder:
|
||||
|
||||
```
|
||||
tiddlywiki --load ./mywiki.html --savewikifolder ./mywikifolder
|
||||
```
|
||||
|
||||
Save the plugin to the tiddlers directory of the target wiki folder:
|
||||
|
||||
```
|
||||
tiddlywiki --load ./mywiki.html --savewikifolder ./mywikifolder explodePlugins=no
|
||||
```
|
||||
@@ -5,14 +5,7 @@ module-type: command
|
||||
|
||||
Command to save the current wiki as a wiki folder
|
||||
|
||||
--savewikifolder <wikifolderpath> [ [<name>=<value>] ]*
|
||||
|
||||
The following options are supported:
|
||||
|
||||
* ''filter'': a filter expression defining the tiddlers to be included in the output
|
||||
* ''explodePlugins'': set to "no" to suppress exploding plugins into their constituent shadow tiddlers (defaults to "yes")
|
||||
|
||||
Supports backward compatibility with --savewikifolder <wikifolderpath> [<filter>] [ [<name>=<value>] ]*
|
||||
--savewikifolder <wikifolderpath> [<filter>]
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
@@ -42,28 +35,14 @@ Command.prototype.execute = function() {
|
||||
if(this.params.length < 1) {
|
||||
return "Missing wiki folder path";
|
||||
}
|
||||
var regFilter = /^[a-zA-Z0-9\.\-_]+=/g, // dynamic parameters
|
||||
namedParames,
|
||||
tiddlerFilter,
|
||||
options = {};
|
||||
if (regFilter.test(this.params[1])) {
|
||||
namedParames = this.commander.extractNamedParameters(this.params.slice(1));
|
||||
tiddlerFilter = namedParames.filter || "[all[tiddlers]]";
|
||||
} else {
|
||||
namedParames = this.commander.extractNamedParameters(this.params.slice(2));
|
||||
tiddlerFilter = this.params[1];
|
||||
}
|
||||
tiddlerFilter = tiddlerFilter || "[all[tiddlers]]";
|
||||
options.explodePlugins = namedParames.explodePlugins || "yes";
|
||||
var wikifoldermaker = new WikiFolderMaker(this.params[0],tiddlerFilter,this.commander,options);
|
||||
var wikifoldermaker = new WikiFolderMaker(this.params[0],this.params[1],this.commander);
|
||||
return wikifoldermaker.save();
|
||||
};
|
||||
|
||||
function WikiFolderMaker(wikiFolderPath,wikiFilter,commander,options) {
|
||||
function WikiFolderMaker(wikiFolderPath,wikiFilter,commander) {
|
||||
this.wikiFolderPath = wikiFolderPath;
|
||||
this.wikiFilter = wikiFilter;
|
||||
this.wikiFilter = wikiFilter || "[all[tiddlers]]";
|
||||
this.commander = commander;
|
||||
this.explodePlugins = options.explodePlugins;
|
||||
this.wiki = commander.wiki;
|
||||
this.savedPaths = []; // So that we can detect filename clashes
|
||||
}
|
||||
@@ -114,13 +93,10 @@ WikiFolderMaker.prototype.save = function() {
|
||||
self.log("Adding built-in plugin: " + libraryDetails.name);
|
||||
newWikiInfo[libraryDetails.type] = newWikiInfo[libraryDetails.type] || [];
|
||||
$tw.utils.pushTop(newWikiInfo[libraryDetails.type],libraryDetails.name);
|
||||
} else if(self.explodePlugins !== "no") {
|
||||
} else {
|
||||
// A custom plugin
|
||||
self.log("Processing custom plugin: " + title);
|
||||
self.saveCustomPlugin(tiddler);
|
||||
} else if(self.explodePlugins === "no") {
|
||||
self.log("Processing custom plugin to tiddlders folder: " + title);
|
||||
self.saveTiddler("tiddlers", tiddler);
|
||||
}
|
||||
} else {
|
||||
// Ordinary tiddler
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
/*\
|
||||
title: $:/core/modules/filterrunprefixes/then.js
|
||||
type: application/javascript
|
||||
module-type: filterrunprefix
|
||||
|
||||
Replace results of previous runs unless empty
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Export our filter prefix function
|
||||
*/
|
||||
exports.then = function(operationSubFunction) {
|
||||
return function(results,source,widget) {
|
||||
if(results.length !== 0) {
|
||||
// Only run if previous run(s) produced results
|
||||
var thisRunResult = operationSubFunction(source,widget);
|
||||
if(thisRunResult.length !== 0) {
|
||||
// Replace results only if this run actually produces a result
|
||||
results.clear();
|
||||
results.pushTop(thisRunResult);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
})();
|
||||
@@ -1,36 +0,0 @@
|
||||
/*\
|
||||
title: $:/core/modules/filters/substitute.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Filter operator for substituting variables and embedded filter expressions with their corresponding values
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Export our filter function
|
||||
*/
|
||||
exports.substitute = function(source,operator,options) {
|
||||
var results = [],
|
||||
operands = [];
|
||||
$tw.utils.each(operator.operands,function(operand,index){
|
||||
operands.push({
|
||||
name: (index + 1).toString(),
|
||||
value: operand
|
||||
});
|
||||
});
|
||||
source(function(tiddler,title) {
|
||||
if(title) {
|
||||
results.push(options.wiki.getSubstitutedText(title,options.widget,{substitutions:operands}));
|
||||
}
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -305,11 +305,10 @@ exports.parseAttribute = function(source,pos) {
|
||||
start: pos
|
||||
};
|
||||
// Define our regexps
|
||||
var reAttributeName = /([^\/\s>"'`=]+)/g,
|
||||
reUnquotedAttribute = /([^\/\s<>"'`=]+)/g,
|
||||
var reAttributeName = /([^\/\s>"'=]+)/g,
|
||||
reUnquotedAttribute = /([^\/\s<>"'=]+)/g,
|
||||
reFilteredValue = /\{\{\{([\S\s]+?)\}\}\}/g,
|
||||
reIndirectValue = /\{\{([^\}]+)\}\}/g,
|
||||
reSubstitutedValue = /(?:```([\s\S]*?)```|`([^`]|[\S\s]*?)`)/g;
|
||||
reIndirectValue = /\{\{([^\}]+)\}\}/g;
|
||||
// Skip whitespace
|
||||
pos = $tw.utils.skipWhiteSpace(source,pos);
|
||||
// Get the attribute name
|
||||
@@ -362,15 +361,8 @@ exports.parseAttribute = function(source,pos) {
|
||||
node.type = "macro";
|
||||
node.value = macroInvocation;
|
||||
} else {
|
||||
var substitutedValue = $tw.utils.parseTokenRegExp(source,pos,reSubstitutedValue);
|
||||
if(substitutedValue) {
|
||||
pos = substitutedValue.end;
|
||||
node.type = "substituted";
|
||||
node.rawValue = substitutedValue.match[1] || substitutedValue.match[2];
|
||||
} else {
|
||||
node.type = "string";
|
||||
node.value = "true";
|
||||
}
|
||||
node.type = "string";
|
||||
node.value = "true";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ Instantiate parse rule
|
||||
exports.init = function(parser) {
|
||||
this.parser = parser;
|
||||
// Regexp to match
|
||||
this.matchRegExp = /\\(function|procedure|widget)\s+([^(\s]+)\((\s*([^)]*))?\)(\s*\r?\n)?/mg;
|
||||
this.matchRegExp = /^\\(function|procedure|widget)\s+([^(\s]+)\((\s*([^)]*))?\)(\s*\r?\n)?/mg;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -53,7 +53,7 @@ exports.parse = function() {
|
||||
var reEnd;
|
||||
if(this.match[5]) {
|
||||
// If so, the end of the body is marked with \end
|
||||
reEnd = new RegExp("(\\r?\\n[^\\S\\n\\r]*\\\\end[^\\S\\n\\r]*(?:" + $tw.utils.escapeRegExp(this.match[2]) + ")?(?:$|\\r?\\n))","mg");
|
||||
reEnd = new RegExp("(\\r?\\n\\\\end[^\\S\\n\\r]*(?:" + $tw.utils.escapeRegExp(this.match[2]) + ")?(?:$|\\r?\\n))","mg");
|
||||
} else {
|
||||
// Otherwise, the end of the definition is marked by the end of the line
|
||||
reEnd = /($|\r?\n)/mg;
|
||||
|
||||
@@ -26,7 +26,7 @@ Instantiate parse rule
|
||||
exports.init = function(parser) {
|
||||
this.parser = parser;
|
||||
// Regexp to match
|
||||
this.matchRegExp = /\\parameters\s*\(([^)]*)\)(\s*\r?\n)?/mg;
|
||||
this.matchRegExp = /^\\parameters\s*\(([^)]*)\)(\s*\r?\n)?/mg;
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -15,7 +15,6 @@ Startup logic concerned with managing plugins
|
||||
// Export name and synchronous status
|
||||
exports.name = "plugins";
|
||||
exports.after = ["load-modules"];
|
||||
exports.before = ["startup"];
|
||||
exports.synchronous = true;
|
||||
|
||||
var TITLE_REQUIRE_RELOAD_DUE_TO_PLUGIN_CHANGE = "$:/status/RequireReloadDueToPluginChange";
|
||||
|
||||
@@ -38,7 +38,6 @@ exports.startup = function() {
|
||||
url: params.url,
|
||||
method: params.method,
|
||||
body: params.body,
|
||||
binary: params.binary,
|
||||
oncompletion: params.oncompletion,
|
||||
onprogress: params.onprogress,
|
||||
bindStatus: params["bind-status"],
|
||||
|
||||
@@ -27,11 +27,6 @@ exports.startup = function() {
|
||||
if($tw.browser) {
|
||||
$tw.browser.isIE = (/msie|trident/i.test(navigator.userAgent));
|
||||
$tw.browser.isFirefox = !!document.mozFullScreenEnabled;
|
||||
// 2023-07-21 Edge returns UA below. So we use "isChromeLike"
|
||||
//'mozilla/5.0 (windows nt 10.0; win64; x64) applewebkit/537.36 (khtml, like gecko) chrome/114.0.0.0 safari/537.36 edg/114.0.1823.82'
|
||||
$tw.browser.isChromeLike = navigator.userAgent.toLowerCase().indexOf("chrome") > -1;
|
||||
$tw.browser.hasTouch = !!window.matchMedia && window.matchMedia("(pointer: coarse)").matches;
|
||||
$tw.browser.isMobileChrome = $tw.browser.isChromeLike && $tw.browser.hasTouch;
|
||||
}
|
||||
// Platform detection
|
||||
$tw.platform = {};
|
||||
|
||||
@@ -80,7 +80,7 @@ exports.makeDraggable = function(options) {
|
||||
if(dataTransfer.setDragImage) {
|
||||
if(dragImageType === "pill") {
|
||||
dataTransfer.setDragImage(dragImage.firstChild,-16,-16);
|
||||
} else if(dragImageType === "blank") {
|
||||
} else if (dragImageType === "blank") {
|
||||
dragImage.removeChild(dragImage.firstChild);
|
||||
dataTransfer.setDragImage(dragImage,0,0);
|
||||
} else {
|
||||
@@ -106,9 +106,7 @@ exports.makeDraggable = function(options) {
|
||||
dataTransfer.setData("text/vnd.tiddler",jsonData);
|
||||
dataTransfer.setData("text/plain",titleString);
|
||||
dataTransfer.setData("text/x-moz-url","data:text/vnd.tiddler," + encodeURIComponent(jsonData));
|
||||
}
|
||||
// If browser is Chrome-like and has a touch-input device do NOT .setData
|
||||
if(!($tw.browser.isMobileChrome)) {
|
||||
} else {
|
||||
dataTransfer.setData("URL","data:text/vnd.tiddler," + encodeURIComponent(jsonData));
|
||||
}
|
||||
dataTransfer.setData("Text",titleString);
|
||||
|
||||
@@ -90,7 +90,6 @@ wiki: wiki to be used for executing action strings
|
||||
url: URL for request
|
||||
method: method eg GET, POST
|
||||
body: text of request body
|
||||
binary: set to "yes" to force binary processing of response payload
|
||||
oncompletion: action string to be invoked on completion
|
||||
onprogress: action string to be invoked on progress updates
|
||||
bindStatus: optional title of tiddler to which status ("pending", "complete", "error") should be written
|
||||
@@ -107,11 +106,10 @@ function HttpClientRequest(options) {
|
||||
this.wiki = options.wiki;
|
||||
this.completionActions = options.oncompletion;
|
||||
this.progressActions = options.onprogress;
|
||||
this.bindStatus = options["bindStatus"];
|
||||
this.bindProgress = options["bindProgress"];
|
||||
this.bindStatus = options["bind-status"];
|
||||
this.bindProgress = options["bind-progress"];
|
||||
this.method = options.method || "GET";
|
||||
this.body = options.body || "";
|
||||
this.binary = options.binary || "";
|
||||
this.variables = options.variables;
|
||||
var url = options.url;
|
||||
$tw.utils.each(options.queryStrings,function(value,name) {
|
||||
@@ -134,7 +132,7 @@ HttpClientRequest.prototype.send = function(callback) {
|
||||
var self = this,
|
||||
setBinding = function(title,text) {
|
||||
if(title) {
|
||||
self.wiki.addTiddler(new $tw.Tiddler({title: title, text: text}));
|
||||
this.wiki.addTiddler(new $tw.Tiddler({title: title, text: text}));
|
||||
}
|
||||
};
|
||||
if(this.url) {
|
||||
@@ -158,8 +156,6 @@ HttpClientRequest.prototype.send = function(callback) {
|
||||
type: this.method,
|
||||
headers: this.requestHeaders,
|
||||
data: this.body,
|
||||
returnProp: this.binary === "" ? "responseText" : "response",
|
||||
responseType: this.binary === "" ? "text" : "arraybuffer",
|
||||
callback: function(err,data,xhr) {
|
||||
var hasSucceeded = xhr.status >= 200 && xhr.status < 300,
|
||||
completionCode = hasSucceeded ? "complete" : "error",
|
||||
@@ -179,16 +175,6 @@ HttpClientRequest.prototype.send = function(callback) {
|
||||
data: (data || "").toString(),
|
||||
headers: JSON.stringify(headers)
|
||||
};
|
||||
/* Convert data from binary to base64 */
|
||||
if (xhr.responseType === "arraybuffer") {
|
||||
var binary = "",
|
||||
bytes = new Uint8Array(data),
|
||||
len = bytes.byteLength;
|
||||
for (var i=0; i<len; i++) {
|
||||
binary += String.fromCharCode(bytes[i]);
|
||||
}
|
||||
resultVariables.data = window.btoa(binary);
|
||||
}
|
||||
self.wiki.addTiddler(new $tw.Tiddler(self.wiki.getTiddler(requestTrackerTitle),{
|
||||
status: completionCode,
|
||||
}));
|
||||
@@ -226,7 +212,6 @@ Make an HTTP request. Options are:
|
||||
callback: function invoked with (err,data,xhr)
|
||||
progress: optional function invoked with (lengthComputable,loaded,total)
|
||||
returnProp: string name of the property to return as first argument of callback
|
||||
responseType: "text" or "arraybuffer"
|
||||
*/
|
||||
exports.httpRequest = function(options) {
|
||||
var type = options.type || "GET",
|
||||
@@ -279,7 +264,6 @@ exports.httpRequest = function(options) {
|
||||
}
|
||||
}
|
||||
}
|
||||
request.responseType = options.responseType || "text";
|
||||
// Set up the state change handler
|
||||
request.onreadystatechange = function() {
|
||||
if(this.readyState === 4) {
|
||||
|
||||
@@ -49,7 +49,7 @@ ImportVariablesWidget.prototype.execute = function(tiddlerList) {
|
||||
this.tiddlerList = tiddlerList || this.wiki.filterTiddlers(this.filter,this);
|
||||
// Accumulate the <$set> widgets from each tiddler
|
||||
$tw.utils.each(this.tiddlerList,function(title) {
|
||||
var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true, configTrimWhiteSpace:true});
|
||||
var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true});
|
||||
if(parser) {
|
||||
var parseTreeNode = parser.tree[0];
|
||||
while(parseTreeNode && ["setvariable","set","parameters"].indexOf(parseTreeNode.type) !== -1) {
|
||||
|
||||
@@ -145,7 +145,6 @@ SelectWidget.prototype.execute = function() {
|
||||
this.selectDefault = this.getAttribute("default");
|
||||
this.selectMultiple = this.getAttribute("multiple", false);
|
||||
this.selectSize = this.getAttribute("size");
|
||||
this.selectTabindex = this.getAttribute("tabindex");
|
||||
this.selectTooltip = this.getAttribute("tooltip");
|
||||
this.selectFocus = this.getAttribute("focus");
|
||||
// Make the child widgets
|
||||
@@ -163,9 +162,6 @@ SelectWidget.prototype.execute = function() {
|
||||
if(this.selectSize) {
|
||||
$tw.utils.addAttributeToParseTreeNode(selectNode,"size",this.selectSize);
|
||||
}
|
||||
if(this.selectTabindex) {
|
||||
$tw.utils.addAttributeToParseTreeNode(selectNode,"tabindex",this.selectTabindex);
|
||||
}
|
||||
if(this.selectTooltip) {
|
||||
$tw.utils.addAttributeToParseTreeNode(selectNode,"title",this.selectTooltip);
|
||||
}
|
||||
|
||||
@@ -41,43 +41,27 @@ TranscludeWidget.prototype.execute = function() {
|
||||
this.collectAttributes();
|
||||
this.collectStringParameters();
|
||||
this.collectSlotFillParameters();
|
||||
// Determine whether we're being used in inline or block mode
|
||||
var parseAsInline = !this.parseTreeNode.isBlock;
|
||||
if(this.transcludeMode === "inline") {
|
||||
parseAsInline = true;
|
||||
} else if(this.transcludeMode === "block") {
|
||||
parseAsInline = false;
|
||||
}
|
||||
// Set 'thisTiddler'
|
||||
this.setVariable("thisTiddler",this.transcludeTitle);
|
||||
var parseTreeNodes, target;
|
||||
// Get the parse tree nodes that we are transcluding
|
||||
var target = this.getTransclusionTarget(),
|
||||
parseTreeNodes = target.parseTreeNodes;
|
||||
this.sourceText = target.text;
|
||||
this.parserType = target.type;
|
||||
this.parseAsInline = target.parseAsInline;
|
||||
// Process the transclusion according to the output type
|
||||
switch(this.transcludeOutput || "text/html") {
|
||||
case "text/html":
|
||||
// Return the parse tree nodes of the target
|
||||
target = this.parseTransclusionTarget(parseAsInline);
|
||||
this.parseAsInline = target.parseAsInline;
|
||||
parseTreeNodes = target.parseTreeNodes;
|
||||
// No further processing required
|
||||
break;
|
||||
case "text/raw":
|
||||
// Just return the raw text
|
||||
target = this.getTransclusionTarget();
|
||||
parseTreeNodes = [{type: "text", text: target.text}];
|
||||
parseTreeNodes = [{type: "text", text: this.sourceText}];
|
||||
break;
|
||||
default:
|
||||
// "text/plain" is the plain text result of wikifying the text
|
||||
target = this.parseTransclusionTarget(parseAsInline);
|
||||
var widgetNode = this.wiki.makeWidget(target.parser,{
|
||||
parentWidget: this,
|
||||
document: $tw.fakeDocument
|
||||
});
|
||||
var container = $tw.fakeDocument.createElement("div");
|
||||
widgetNode.render(container,null);
|
||||
parseTreeNodes = [{type: "text", text: container.textContent}];
|
||||
// text/plain
|
||||
var plainText = this.wiki.renderText("text/plain",this.parserType,this.sourceText,{parentWidget: this});
|
||||
parseTreeNodes = [{type: "text", text: plainText}];
|
||||
break;
|
||||
}
|
||||
this.sourceText = target.text;
|
||||
this.parserType = target.type;
|
||||
// Set the legacy transclusion context variables only if we're not transcluding a variable
|
||||
if(!this.transcludeVariable) {
|
||||
var recursionMarker = this.makeRecursionMarker();
|
||||
@@ -174,44 +158,17 @@ TranscludeWidget.prototype.collectSlotFillParameters = function() {
|
||||
};
|
||||
|
||||
/*
|
||||
Get transcluded details as an object {text:,type:}
|
||||
Get transcluded parse tree nodes as an object {parser:,text:,type:}
|
||||
*/
|
||||
TranscludeWidget.prototype.getTransclusionTarget = function() {
|
||||
var self = this;
|
||||
var text;
|
||||
// Return the text and type of the target
|
||||
if(this.hasAttribute("$variable")) {
|
||||
if(this.transcludeVariable) {
|
||||
// Transcluding a variable
|
||||
var variableInfo = this.getVariableInfo(this.transcludeVariable,{params: this.getOrderedTransclusionParameters()});
|
||||
text = variableInfo.text;
|
||||
return {
|
||||
text: variableInfo.text,
|
||||
type: this.transcludeType
|
||||
};
|
||||
}
|
||||
} else {
|
||||
// Transcluding a text reference
|
||||
var parserInfo = this.wiki.getTextReferenceParserInfo(
|
||||
this.transcludeTitle,
|
||||
this.transcludeField,
|
||||
this.transcludeIndex,
|
||||
{
|
||||
subTiddler: this.transcludeSubTiddler,
|
||||
defaultType: this.transcludeType
|
||||
});
|
||||
return {
|
||||
text: parserInfo.text,
|
||||
type: parserInfo.type
|
||||
};
|
||||
// Determine whether we're being used in inline or block mode
|
||||
var parseAsInline = !this.parseTreeNode.isBlock;
|
||||
if(this.transcludeMode === "inline") {
|
||||
parseAsInline = true;
|
||||
} else if(this.transcludeMode === "block") {
|
||||
parseAsInline = false;
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Get transcluded parse tree nodes as an object {text:,type:,parseTreeNodes:,parseAsInline:}
|
||||
*/
|
||||
TranscludeWidget.prototype.parseTransclusionTarget = function(parseAsInline) {
|
||||
var self = this;
|
||||
var parser;
|
||||
// Get the parse tree
|
||||
if(this.hasAttribute("$variable")) {
|
||||
@@ -220,7 +177,8 @@ TranscludeWidget.prototype.parseTransclusionTarget = function(parseAsInline) {
|
||||
var variableInfo = this.getVariableInfo(this.transcludeVariable,{params: this.getOrderedTransclusionParameters()}),
|
||||
srcVariable = variableInfo && variableInfo.srcVariable;
|
||||
if(variableInfo.text) {
|
||||
if(srcVariable && srcVariable.isFunctionDefinition) {
|
||||
if(srcVariable.isFunctionDefinition) {
|
||||
// Function to return parameters by name or position
|
||||
var result = (variableInfo.resultList ? variableInfo.resultList[0] : variableInfo.text) || "";
|
||||
parser = {
|
||||
tree: [{
|
||||
@@ -250,7 +208,7 @@ TranscludeWidget.prototype.parseTransclusionTarget = function(parseAsInline) {
|
||||
if(variableInfo.isCacheable && srcVariable[cacheKey]) {
|
||||
parser = srcVariable[cacheKey];
|
||||
} else {
|
||||
parser = this.wiki.parseText(this.transcludeType,variableInfo.text || "",{parseAsInline: parseAsInline, configTrimWhiteSpace: srcVariable && srcVariable.configTrimWhiteSpace});
|
||||
parser = this.wiki.parseText(this.transcludeType,variableInfo.text || "",{parseAsInline: parseAsInline, configTrimWhiteSpace: srcVariable.configTrimWhiteSpace});
|
||||
if(variableInfo.isCacheable) {
|
||||
srcVariable[cacheKey] = parser;
|
||||
}
|
||||
@@ -258,7 +216,7 @@ TranscludeWidget.prototype.parseTransclusionTarget = function(parseAsInline) {
|
||||
}
|
||||
if(parser) {
|
||||
// Add parameters widget for procedures and custom widgets
|
||||
if(srcVariable && (srcVariable.isProcedureDefinition || srcVariable.isWidgetDefinition)) {
|
||||
if(srcVariable.isProcedureDefinition || srcVariable.isWidgetDefinition) {
|
||||
parser = {
|
||||
tree: [
|
||||
{
|
||||
@@ -277,7 +235,7 @@ TranscludeWidget.prototype.parseTransclusionTarget = function(parseAsInline) {
|
||||
}
|
||||
$tw.utils.addAttributeToParseTreeNode(parser.tree[0],name,param["default"])
|
||||
});
|
||||
} else if(srcVariable && !srcVariable.isFunctionDefinition) {
|
||||
} else {
|
||||
// For macros and ordinary variables, wrap the parse tree in a vars widget assigning the parameters to variables named "__paramname__"
|
||||
parser = {
|
||||
tree: [
|
||||
@@ -308,14 +266,27 @@ TranscludeWidget.prototype.parseTransclusionTarget = function(parseAsInline) {
|
||||
defaultType: this.transcludeType
|
||||
});
|
||||
}
|
||||
// Set 'thisTiddler'
|
||||
this.setVariable("thisTiddler",this.transcludeTitle);
|
||||
// Return the parse tree
|
||||
return {
|
||||
parser: parser,
|
||||
parseTreeNodes: parser ? parser.tree : (this.slotFillParseTrees["ts-missing"] || []),
|
||||
parseAsInline: parseAsInline,
|
||||
text: parser && parser.source,
|
||||
type: parser && parser.type
|
||||
};
|
||||
if(parser) {
|
||||
return {
|
||||
parser: parser,
|
||||
parseTreeNodes: parser.tree,
|
||||
parseAsInline: parseAsInline,
|
||||
text: parser.source,
|
||||
type: parser.type
|
||||
};
|
||||
} else {
|
||||
// If there's no parse tree then return the missing slot value
|
||||
return {
|
||||
parser: null,
|
||||
parseTreeNodes: (this.slotFillParseTrees["ts-missing"] || []),
|
||||
parseAsInline: parseAsInline,
|
||||
text: null,
|
||||
type: null
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -182,7 +182,8 @@ Widget.prototype.getVariableInfo = function(name,options) {
|
||||
}
|
||||
return {
|
||||
text: text,
|
||||
resultList: [text]
|
||||
resultList: [text],
|
||||
srcVariable: {}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -379,8 +380,6 @@ Widget.prototype.computeAttribute = function(attribute) {
|
||||
} else if(attribute.type === "macro") {
|
||||
var variableInfo = this.getVariableInfo(attribute.value.name,{params: attribute.value.params});
|
||||
value = variableInfo.text;
|
||||
} else if(attribute.type === "substituted") {
|
||||
value = this.wiki.getSubstitutedText(attribute.rawValue,this) || "";
|
||||
} else { // String attribute
|
||||
value = attribute.value;
|
||||
}
|
||||
|
||||
@@ -1063,34 +1063,6 @@ exports.getTextReferenceParserInfo = function(title,field,index,options) {
|
||||
return parserInfo;
|
||||
}
|
||||
|
||||
/*
|
||||
Parse a block of text of a specified MIME type
|
||||
text: text on which to perform substitutions
|
||||
widget
|
||||
options: see below
|
||||
Options include:
|
||||
substitutions: an optional array of substitutions
|
||||
*/
|
||||
exports.getSubstitutedText = function(text,widget,options) {
|
||||
options = options || {};
|
||||
text = text || "";
|
||||
var self = this,
|
||||
substitutions = options.substitutions || [],
|
||||
output;
|
||||
// Evaluate embedded filters and substitute with first result
|
||||
output = text.replace(/\$\{([\S\s]+?)\}\$/g, function(match,filter) {
|
||||
return self.filterTiddlers(filter,widget)[0] || "";
|
||||
});
|
||||
// Process any substitutions provided in options
|
||||
$tw.utils.each(substitutions,function(substitute) {
|
||||
output = $tw.utils.replaceString(output,new RegExp("\\$" + $tw.utils.escapeRegExp(substitute.name) + "\\$","mg"),substitute.value);
|
||||
});
|
||||
// Substitute any variable references with their values
|
||||
return output.replace(/\$\(([^\)\$]+)\)\$/g, function(match,varname) {
|
||||
return widget.getVariable(varname,{defaultValue: ""})
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
Make a widget tree for a parse tree
|
||||
parser: parser object
|
||||
|
||||
@@ -3,7 +3,6 @@ tags: $:/tags/Exporter
|
||||
description: {{$:/language/Exporters/StaticRiver}}
|
||||
extension: .html
|
||||
|
||||
\define tv-config-static() yes
|
||||
\define tv-wikilink-template() #$uri_encoded$
|
||||
\define tv-config-toolbar-icons() no
|
||||
\define tv-config-toolbar-text() no
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
title: $:/core/templates/server/static.tiddler.html
|
||||
|
||||
\whitespace trim
|
||||
\define tv-config-static() yes
|
||||
\define tv-wikilink-template() $uri_encoded$
|
||||
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
||||
<html>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
title: $:/core/templates/static.template.html
|
||||
type: text/vnd.tiddlywiki-html
|
||||
|
||||
\define tv-config-static() yes
|
||||
\define tv-wikilink-template() static/$uri_doubleencoded$.html
|
||||
\define tv-config-toolbar-icons() no
|
||||
\define tv-config-toolbar-text() no
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
title: $:/core/templates/static.tiddler.html
|
||||
|
||||
\define tv-wikilink-template() $uri_doubleencoded$.html
|
||||
\define tv-config-static() yes
|
||||
\define tv-config-toolbar-icons() no
|
||||
\define tv-config-toolbar-text() no
|
||||
\define tv-config-toolbar-class() tc-btn-invisible
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
code-body: yes
|
||||
title: $:/core/ui/AlertTemplate
|
||||
|
||||
\whitespace trim
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
code-body: yes
|
||||
title: $:/core/ui/EditTemplate
|
||||
|
||||
\define delete-edittemplate-state-tiddlers()
|
||||
|
||||
@@ -18,7 +18,7 @@ title: $:/core/ui/EditorToolbar/link-dropdown
|
||||
|
||||
\define external-link()
|
||||
\whitespace trim
|
||||
<$button class="tc-btn-invisible tc-btn-mini" style="width: auto; display: inline-block; background-colour: inherit;" actions=<<add-link-actions>>>
|
||||
<$button class="tc-btn-invisible" style="width: auto; display: inline-block; background-colour: inherit;" actions=<<add-link-actions>>>
|
||||
{{$:/core/images/chevron-right}}
|
||||
</$button>
|
||||
\end
|
||||
@@ -45,7 +45,7 @@ title: $:/core/ui/EditorToolbar/link-dropdown
|
||||
<$reveal tag="span" state=<<storeTitle>> type="nomatch" text="">
|
||||
<<external-link>>
|
||||
 
|
||||
<$button class="tc-btn-invisible tc-btn-mini" style="width: auto; display: inline-block; background-colour: inherit;">
|
||||
<$button class="tc-btn-invisible" style="width: auto; display: inline-block; background-colour: inherit;">
|
||||
<<cancel-search-actions>><$set name="cssEscapedTitle" value={{{ [<storyTiddler>escapecss[]] }}}><$action-sendmessage $message="tm-focus-selector" $param=<<get-focus-selector>>/></$set>
|
||||
{{$:/core/images/close-button}}
|
||||
</$button>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
title: $:/core/ui/ImportPreviews/Text
|
||||
tags: $:/tags/ImportPreview
|
||||
caption: {{$:/language/Import/Listing/Preview/Text}}
|
||||
code-body: yes
|
||||
|
||||
<$transclude tiddler=<<currentTiddler>> subtiddler=<<payloadTiddler>> mode="block"/>
|
||||
|
||||
@@ -3,14 +3,15 @@ tags: $:/tags/MoreSideBar
|
||||
caption: {{$:/language/SideBar/Tags/Caption}}
|
||||
|
||||
\whitespace trim
|
||||
|
||||
<$let tv-config-toolbar-icons="yes" tv-config-toolbar-text="yes" tv-config-toolbar-class="">
|
||||
<div class="tc-tiny-v-gap-bottom">
|
||||
{{$:/core/ui/Buttons/tag-manager}}
|
||||
{{$:/core/ui/Buttons/tag-manager}}
|
||||
</div>
|
||||
</$let>
|
||||
<$list filter={{$:/core/Filters/AllTags!!filter}}>
|
||||
<div class="tc-tiny-v-gap-bottom">
|
||||
<$transclude tiddler="$:/core/ui/TagTemplate"/>
|
||||
<$transclude tiddler="$:/core/ui/TagTemplate"/>
|
||||
</div>
|
||||
</$list>
|
||||
<hr class="tc-untagged-separator">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
title: $:/core/ui/PageStylesheet
|
||||
code-body: yes
|
||||
|
||||
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
||||
\whitespace trim
|
||||
|
||||
@@ -2,7 +2,6 @@ title: $:/core/ui/PageTemplate
|
||||
name: {{$:/language/PageTemplate/Name}}
|
||||
description: {{$:/language/PageTemplate/Description}}
|
||||
icon: $:/core/images/layout-button
|
||||
code-body: yes
|
||||
|
||||
\whitespace trim
|
||||
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
title: $:/core/ui/RootTemplate
|
||||
code-body: yes
|
||||
|
||||
<$transclude tiddler={{{ [{$:/layout}has[text]] ~[[$:/core/ui/PageTemplate]] }}} mode="inline"/>
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
title: $:/core/ui/StoryTiddlerTemplate
|
||||
code-body: yes
|
||||
|
||||
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/StoryTiddlerTemplateFilter]!is[draft]get[text]] :and[has[title]else[$:/core/ui/ViewTemplate]] }}} />
|
||||
|
||||
@@ -2,29 +2,22 @@ title: $:/core/ui/TagPickerTagTemplate
|
||||
|
||||
\whitespace trim
|
||||
<$button class=<<button-classes>> tag="a" tooltip={{$:/language/EditTemplate/Tags/Add/Button/Hint}}>
|
||||
<$list filter="[<saveTiddler>minlength[1]]">
|
||||
<$action-listops $tiddler=<<saveTiddler>> $field=<<tagField>> $subfilter="[<tag>]"/>
|
||||
</$list>
|
||||
<$set name="currentTiddlerCSSEscaped" value={{{ [<saveTiddler>escapecss[]] }}}>
|
||||
<$action-sendmessage $message="tm-focus-selector" $param=<<get-tagpicker-focus-selector>> preventScroll="true"/>
|
||||
</$set>
|
||||
<<delete-tag-state-tiddlers>>
|
||||
<$list filter="[<refreshTitle>minlength[1]]">
|
||||
<$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
|
||||
</$list>
|
||||
<<actions>>
|
||||
<$set name="backgroundColor"
|
||||
value={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}
|
||||
>
|
||||
<$wikify name="foregroundColor"
|
||||
text="""<$macrocall $name="contrastcolour" target=<<backgroundColor>> fallbackTarget=<<fallbackTarget>> colourA=<<colourA>> colourB=<<colourB>>/>"""
|
||||
>
|
||||
<span class="tc-tag-label tc-btn-invisible"
|
||||
style=<<tag-pill-styles>>
|
||||
data-tag-title=<<currentTiddler>>
|
||||
>
|
||||
{{||$:/core/ui/TiddlerIcon}}<$view field="title" format="text"/>
|
||||
</span>
|
||||
</$wikify>
|
||||
</$set>
|
||||
<$list filter="[<saveTiddler>minlength[1]]">
|
||||
<$action-listops $tiddler=<<saveTiddler>> $field=<<tagField>> $subfilter="[<tag>]"/>
|
||||
</$list>
|
||||
<$set name="currentTiddlerCSSEscaped" value={{{ [<saveTiddler>escapecss[]] }}}>
|
||||
<$action-sendmessage $message="tm-focus-selector" $param=<<get-tagpicker-focus-selector>> preventScroll="true"/>
|
||||
</$set>
|
||||
<<delete-tag-state-tiddlers>>
|
||||
<$list filter="[<refreshTitle>minlength[1]]">
|
||||
<$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
|
||||
</$list>
|
||||
<<actions>>
|
||||
<$set name="backgroundColor" value={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}>
|
||||
<$wikify name="foregroundColor" text="""<$macrocall $name="contrastcolour" target=<<backgroundColor>> fallbackTarget=<<fallbackTarget>> colourA=<<colourA>> colourB=<<colourB>>/>""">
|
||||
<span class="tc-tag-label tc-btn-invisible" style=<<tag-pill-styles>> data-tag-title=<<currentTiddler>> >
|
||||
{{||$:/core/ui/TiddlerIcon}}<$view field="title" format="text"/>
|
||||
</span>
|
||||
</$wikify>
|
||||
</$set>
|
||||
</$button>
|
||||
|
||||
@@ -3,23 +3,16 @@ title: $:/core/ui/TagTemplate
|
||||
\whitespace trim
|
||||
<span class="tc-tag-list-item" data-tag-title=<<currentTiddler>>>
|
||||
<$set name="transclusion" value=<<currentTiddler>>>
|
||||
<$macrocall $name="tag-pill-body"
|
||||
tag=<<currentTiddler>>
|
||||
icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}}
|
||||
colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}
|
||||
palette={{$:/palette}}
|
||||
element-tag="$button"
|
||||
element-attributes="""popup=<<qualify "$:/state/popup/tag">> dragFilter="[all[current]tagging[]]" tag='span'"""
|
||||
/>
|
||||
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below" animate="yes" class="tc-drop-down">
|
||||
<$set name="tv-show-missing-links" value="yes">
|
||||
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
|
||||
</$set>
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TagDropdown]!has[draft.of]]" variable="listItem">
|
||||
<$transclude tiddler=<<listItem>>/>
|
||||
</$list>
|
||||
<hr>
|
||||
<$macrocall $name="list-tagged-draggable" tag=<<currentTiddler>>/>
|
||||
</$reveal>
|
||||
<$macrocall $name="tag-pill-body" tag=<<currentTiddler>> icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}} colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}} palette={{$:/palette}} element-tag="""$button""" element-attributes="""popup=<<qualify "$:/state/popup/tag">> dragFilter='[all[current]tagging[]]' tag='span'"""/>
|
||||
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below" animate="yes" class="tc-drop-down">
|
||||
<$set name="tv-show-missing-links" value="yes">
|
||||
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
|
||||
</$set>
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TagDropdown]!has[draft.of]]" variable="listItem">
|
||||
<$transclude tiddler=<<listItem>>/>
|
||||
</$list>
|
||||
<hr>
|
||||
<$macrocall $name="list-tagged-draggable" tag=<<currentTiddler>>/>
|
||||
</$reveal>
|
||||
</$set>
|
||||
</span>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
title: $:/core/ui/ViewTemplate
|
||||
code-body: yes
|
||||
|
||||
\whitespace trim
|
||||
\define folded-state()
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
title: $:/core/ui/ViewTemplate/body/default
|
||||
code-body: yes
|
||||
|
||||
<$transclude>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
title: $:/config/OfficialPluginLibrary
|
||||
tags: $:/tags/PluginLibrary
|
||||
url: https://tiddlywiki.com/library/v5.3.1/index.html
|
||||
url: https://tiddlywiki.com/library/v5.2.8/index.html
|
||||
caption: {{$:/language/OfficialPluginLibrary}}
|
||||
|
||||
{{$:/language/OfficialPluginLibrary/Hint}}
|
||||
|
||||
@@ -2,8 +2,7 @@ title: $:/config/ViewTemplateBodyFilters/
|
||||
tags: $:/tags/ViewTemplateBodyFilter
|
||||
|
||||
stylesheet: [tag[$:/tags/Stylesheet]then[$:/core/ui/ViewTemplate/body/rendered-plain-text]]
|
||||
core-ui-tags: [tag[$:/tags/PageTemplate]] [tag[$:/tags/EditTemplate]] [tag[$:/tags/ViewTemplate]] [tag[$:/tags/KeyboardShortcut]] [tag[$:/tags/ImportPreview]] [tag[$:/tags/EditPreview]][tag[$:/tags/EditorToolbar]] [tag[$:/tags/Actions]] :then[[$:/core/ui/ViewTemplate/body/code]]
|
||||
system: [prefix[$:/boot/]] [prefix[$:/config/]] [prefix[$:/core/macros]] [prefix[$:/core/save/]] [prefix[$:/core/templates/]] [prefix[$:/info/]] [prefix[$:/language/]] [prefix[$:/languages/]] [prefix[$:/snippets/]] [prefix[$:/state/]] [prefix[$:/status/]] [prefix[$:/info/]] [prefix[$:/temp/]] +[!is[image]limit[1]then[$:/core/ui/ViewTemplate/body/code]]
|
||||
system: [prefix[$:/boot/]] [prefix[$:/config/]] [prefix[$:/core/macros]] [prefix[$:/core/save/]] [prefix[$:/core/templates/]] [prefix[$:/core/ui/]split[/]count[]compare:number:eq[4]] [prefix[$:/info/]] [prefix[$:/language/]] [prefix[$:/languages/]] [prefix[$:/snippets/]] [prefix[$:/state/]] [prefix[$:/status/]] [prefix[$:/info/]] [prefix[$:/temp/]] +[!is[image]limit[1]then[$:/core/ui/ViewTemplate/body/code]]
|
||||
code-body: [field:code-body[yes]then[$:/core/ui/ViewTemplate/body/code]]
|
||||
import: [field:plugin-type[import]then[$:/core/ui/ViewTemplate/body/import]]
|
||||
plugin: [has[plugin-type]then[$:/core/ui/ViewTemplate/body/plugin]]
|
||||
|
||||
@@ -9,50 +9,26 @@ color:$(foregroundColor)$;
|
||||
|
||||
<!-- This has no whitespace trim to avoid modifying $actions$. Closing tags omitted for brevity. -->
|
||||
\define tag-pill-inner(tag,icon,colour,fallbackTarget,colourA,colourB,element-tag,element-attributes,actions)
|
||||
\whitespace trim
|
||||
<$vars
|
||||
foregroundColor=<<contrastcolour target:"""$colour$""" fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$""" colourB:"""$colourB$""">>
|
||||
backgroundColor=<<__colour__>>
|
||||
>
|
||||
<$element-tag$
|
||||
backgroundColor="""$colour$"""
|
||||
><$element-tag$
|
||||
$element-attributes$
|
||||
class="tc-tag-label tc-btn-invisible"
|
||||
style=<<tag-pill-styles>>
|
||||
>
|
||||
<<__actions__>>
|
||||
<$transclude tiddler=<<__icon__>>/>
|
||||
<$view tiddler=<<__tag__>> field="title" format="text" />
|
||||
</$element-tag$>
|
||||
>$actions$<$transclude tiddler="""$icon$"""/><$view tiddler=<<__tag__>> field="title" format="text" /></$element-tag$>
|
||||
\end
|
||||
|
||||
\define tag-pill-body(tag,icon,colour,palette,element-tag,element-attributes,actions)
|
||||
\whitespace trim
|
||||
<$macrocall $name="tag-pill-inner"
|
||||
tag=<<__tag__>>
|
||||
icon=<<__icon__>>
|
||||
colour=<<__colour__>>
|
||||
fallbackTarget={{$palette$##tag-background}}
|
||||
colourA={{$palette$##foreground}}
|
||||
colourB={{$palette$##background}}
|
||||
element-tag=<<__element-tag__>>
|
||||
element-attributes=<<__element-attributes__>>
|
||||
actions=<<__actions__>>
|
||||
/>
|
||||
<$macrocall $name="tag-pill-inner" tag=<<__tag__>> icon="""$icon$""" colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
|
||||
\end
|
||||
|
||||
\define tag-pill(tag,element-tag:"span",element-attributes:"",actions:"")
|
||||
\whitespace trim
|
||||
<span class="tc-tag-list-item" data-tag-title=<<__tag__>>>
|
||||
<$let currentTiddler=<<__tag__>>>
|
||||
<$macrocall $name="tag-pill-body"
|
||||
tag=<<__tag__>>
|
||||
icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}}
|
||||
colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}
|
||||
palette={{$:/palette}}
|
||||
element-tag=<<__element-tag__>>
|
||||
element-attributes=<<__element-attributes__>>
|
||||
actions=<<__actions__>>/>
|
||||
</$let>
|
||||
<$let currentTiddler=<<__tag__>>>
|
||||
<$macrocall $name="tag-pill-body" tag=<<__tag__>> icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}} colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}} palette={{$:/palette}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
|
||||
</$let>
|
||||
</span>
|
||||
\end
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ tags: $:/tags/Macro
|
||||
|
||||
\define toc-caption()
|
||||
\whitespace trim
|
||||
<span class="tc-toc-caption tc-tiny-gap-left">
|
||||
<span class="tc-toc-caption">
|
||||
<$set name="tv-wikilinks" value="no">
|
||||
<$transclude field="caption">
|
||||
<$view field="title"/>
|
||||
@@ -19,9 +19,9 @@ tags: $:/tags/Macro
|
||||
\define toc-body(tag,sort:"",itemClassFilter,exclude,path)
|
||||
\whitespace trim
|
||||
<ol class="tc-toc">
|
||||
<$list filter="""[all[shadows+tiddlers]tag<__tag__>!has[draft.of]$sort$] -[<__tag__>] -[subfilter<__exclude__>]""">
|
||||
<$list filter="""[all[shadows+tiddlers]tag<__tag__>!has[draft.of]$sort$] -[<__tag__>] -[enlist<__exclude__>]""">
|
||||
<$let item=<<currentTiddler>> path={{{ [<__path__>addsuffix[/]addsuffix<__tag__>] }}}>
|
||||
<$set name="excluded" filter="[subfilter<__exclude__>] [<__tag__>]">
|
||||
<$set name="excluded" filter="""[enlist<__exclude__>] [<__tag__>]""">
|
||||
<$set name="toc-item-class" filter=<<__itemClassFilter__>> emptyValue="toc-item-selected" value="toc-item">
|
||||
<li class=<<toc-item-class>>>
|
||||
<$list filter="[all[current]toc-link[no]]" emptyMessage="<$link to={{{ [<currentTiddler>get[target]else<currentTiddler>] }}}><<toc-caption>></$link>">
|
||||
@@ -36,8 +36,8 @@ tags: $:/tags/Macro
|
||||
</ol>
|
||||
\end
|
||||
|
||||
\define toc(tag,sort:"",itemClassFilter:"", exclude)
|
||||
<$macrocall $name="toc-body" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<__exclude__>>/>
|
||||
\define toc(tag,sort:"",itemClassFilter:"")
|
||||
<$macrocall $name="toc-body" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> />
|
||||
\end
|
||||
|
||||
\define toc-linked-expandable-body(tag,sort:"",itemClassFilter,exclude,path)
|
||||
@@ -75,7 +75,7 @@ tags: $:/tags/Macro
|
||||
<li class=<<toc-item-class>>>
|
||||
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
|
||||
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
|
||||
<$transclude tiddler=<<toc-closed-icon>> />
|
||||
<$transclude tiddler=<<toc-closed-icon>> />
|
||||
<<toc-caption>>
|
||||
</$button>
|
||||
</$reveal>
|
||||
@@ -100,9 +100,9 @@ tags: $:/tags/Macro
|
||||
\define toc-expandable(tag,sort:"",itemClassFilter:"",exclude,path)
|
||||
\whitespace trim
|
||||
<$let tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> path={{{ [<__path__>addsuffix[/]addsuffix<__tag__>] }}}>
|
||||
<$set name="excluded" filter="[subfilter<__exclude__>] [<__tag__>]">
|
||||
<$set name="excluded" filter="""[enlist<__exclude__>] [<__tag__>]""">
|
||||
<ol class="tc-toc toc-expandable">
|
||||
<$list filter="""[all[shadows+tiddlers]tag<__tag__>!has[draft.of]$sort$] -[<__tag__>] -[subfilter<__exclude__>]""">
|
||||
<$list filter="""[all[shadows+tiddlers]tag<__tag__>!has[draft.of]$sort$] -[<__tag__>] -[enlist<__exclude__>]""">
|
||||
<$list filter="[all[current]toc-link[no]]" emptyMessage=<<toc-expandable-empty-message>> >
|
||||
<$macrocall $name="toc-unlinked-expandable-body" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter="""itemClassFilter""" exclude=<<excluded>> path=<<path>> />
|
||||
</$list>
|
||||
@@ -145,7 +145,7 @@ tags: $:/tags/Macro
|
||||
<$qualify name="toc-state" title={{{ [[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>] }}}>
|
||||
<$set name="toc-item-class" filter=<<__itemClassFilter__>> emptyValue="toc-item-selected" value="toc-item">
|
||||
<li class=<<toc-item-class>>>
|
||||
<$list filter="[all[current]tagging[]$sort$limit[1]]" variable="ignore" emptyMessage="""<$button class="tc-btn-invisible">{{$:/core/images/blank}}</$button><span class="toc-item-muted"><<toc-caption>></span>""">
|
||||
<$list filter="[all[current]tagging[]$sort$limit[1]]" variable="ignore" emptyMessage="<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button> <$view field='caption'><$view field='title'/></$view>">
|
||||
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
|
||||
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
|
||||
<$transclude tiddler=<<toc-closed-icon>> />
|
||||
@@ -174,9 +174,9 @@ tags: $:/tags/Macro
|
||||
\define toc-selective-expandable(tag,sort:"",itemClassFilter,exclude,path)
|
||||
\whitespace trim
|
||||
<$let tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> path={{{ [<__path__>addsuffix[/]addsuffix<__tag__>] }}}>
|
||||
<$set name="excluded" filter="[subfilter<__exclude__>] [<__tag__>]">
|
||||
<$set name="excluded" filter="[enlist<__exclude__>] [<__tag__>]">
|
||||
<ol class="tc-toc toc-selective-expandable">
|
||||
<$list filter="""[all[shadows+tiddlers]tag<__tag__>!has[draft.of]$sort$] -[<__tag__>] -[subfilter<__exclude__>]""">
|
||||
<$list filter="""[all[shadows+tiddlers]tag<__tag__>!has[draft.of]$sort$] -[<__tag__>] -[enlist<__exclude__>]""">
|
||||
<$list filter="[all[current]toc-link[no]]" variable="ignore" emptyMessage=<<toc-selective-expandable-empty-message>> >
|
||||
<$macrocall $name="toc-unlinked-selective-expandable-body" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<excluded>> path=<<path>>/>
|
||||
</$list>
|
||||
@@ -186,13 +186,13 @@ tags: $:/tags/Macro
|
||||
</$let>
|
||||
\end
|
||||
|
||||
\define toc-tabbed-external-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,missingText,template:"",exclude)
|
||||
\define toc-tabbed-external-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,missingText,template:"")
|
||||
\whitespace trim
|
||||
<$tiddler tiddler={{{ [<__selectedTiddler__>get[text]] }}}>
|
||||
<div class="tc-tabbed-table-of-contents">
|
||||
<$linkcatcher to=<<__selectedTiddler__>>>
|
||||
<div class="tc-table-of-contents">
|
||||
<$macrocall $name="toc-selective-expandable" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter="[all[current]] -[<__selectedTiddler__>get[text]]" exclude=<<__exclude__>>/>
|
||||
<$macrocall $name="toc-selective-expandable" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter="[all[current]] -[<__selectedTiddler__>get[text]]"/>
|
||||
</div>
|
||||
</$linkcatcher>
|
||||
<div class="tc-tabbed-table-of-contents-content">
|
||||
@@ -210,9 +210,9 @@ tags: $:/tags/Macro
|
||||
</$tiddler>
|
||||
\end
|
||||
|
||||
\define toc-tabbed-internal-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,missingText,template:"",exclude)
|
||||
\define toc-tabbed-internal-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,missingText,template:"")
|
||||
\whitespace trim
|
||||
<$linkcatcher to=<<__selectedTiddler__>>>
|
||||
<$macrocall $name="toc-tabbed-external-nav" tag=<<__tag__>> sort=<<__sort__>> selectedTiddler=<<__selectedTiddler__>> unselectedText=<<__unselectedText__>> missingText=<<__missingText__>> template=<<__template__>> exclude=<<__exclude__>> />
|
||||
<$macrocall $name="toc-tabbed-external-nav" tag=<<__tag__>> sort=<<__sort__>> selectedTiddler=<<__selectedTiddler__>> unselectedText=<<__unselectedText__>> missingText=<<__missingText__>> template=<<__template__>>/>
|
||||
</$linkcatcher>
|
||||
\end
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
title: $:/tags/ViewTemplateBodyFilter
|
||||
list: $:/config/ViewTemplateBodyFilters/hide-body $:/config/ViewTemplateBodyFilters/code-body $:/config/ViewTemplateBodyFilters/stylesheet $:/config/ViewTemplateBodyFilters/core-ui-advanced-search $:/config/ViewTemplateBodyFilters/core-ui-tags $:/config/ViewTemplateBodyFilters/system $:/config/ViewTemplateBodyFilters/import $:/config/ViewTemplateBodyFilters/plugin $:/config/ViewTemplateBodyFilters/default
|
||||
list: $:/config/ViewTemplateBodyFilters/hide-body $:/config/ViewTemplateBodyFilters/code-body $:/config/ViewTemplateBodyFilters/stylesheet $:/config/ViewTemplateBodyFilters/system $:/config/ViewTemplateBodyFilters/import $:/config/ViewTemplateBodyFilters/plugin $:/config/ViewTemplateBodyFilters/default
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{
|
||||
"file": "../../../tw5.com/tiddlers/images/New Release Banner.png",
|
||||
"fields": {
|
||||
"type": "image/jpeg",
|
||||
"type": "image/jpg",
|
||||
"title": "New Release Banner",
|
||||
"tags": "picture"
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
created: 20230601123245916
|
||||
modified: 20230601125015463
|
||||
title: Widget `destroy` method examples
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
!! When using a v-dom library
|
||||
|
||||
Virtual DOM libraries manages its internal state and apply state to DOM periodically, this is so called [["controlled" component|https://react.dev/learn/sharing-state-between-components#controlled-and-uncontrolled-components]]. When Tiddlywiki remove a DOM element controlled by a v-dom library, it may throws error.
|
||||
|
||||
So when creating a plugin providing v-dom library binding, you need to tell v-dom library (for example, React.js) the DOM element is removed. We will use `destroy` method for this.
|
||||
|
||||
```js
|
||||
render() {
|
||||
// ...other render related code
|
||||
if (this.root === undefined || this.containerElement === undefined) {
|
||||
// initialize the v-dom library
|
||||
this.root = ReactDom.createRoot(document.createElement('div'));
|
||||
}
|
||||
}
|
||||
|
||||
destroy() {
|
||||
// end the lifecycle of v-dom library
|
||||
this.root && this.root.unmount();
|
||||
}
|
||||
```
|
||||
|
||||
The `destroy` method will be called by parent widget. If you widget don't have any child widget, you can just write your own tear down logic. If it may have some child widget, don't forget to call original `destroy` method in the `Widget` class to destroy children widgets.
|
||||
|
||||
```js
|
||||
Widget.prototype.destroy();
|
||||
this.root && this.root.unmount();
|
||||
/** if you are using ESNext
|
||||
super.destroy();
|
||||
this.root?.unmount();
|
||||
*/
|
||||
```
|
||||
@@ -1,8 +1,7 @@
|
||||
created: 20131101130700000
|
||||
modified: 20230601130631884
|
||||
tags: dev moduletypes
|
||||
title: WidgetModules
|
||||
type: text/vnd.tiddlywiki
|
||||
tags: dev moduletypes
|
||||
created: 201311011307
|
||||
modified: 201311011307
|
||||
|
||||
! Introduction
|
||||
|
||||
@@ -79,10 +78,4 @@ The individual methods defined by the widget object are documented in the source
|
||||
!! Widget `refreshChildren` method
|
||||
!! Widget `findNextSiblingDomNode` method
|
||||
!! Widget `findFirstDomNode` method
|
||||
!! Widget `destroy` method
|
||||
|
||||
<<.from-version "5.3.0">> Gets called when any parent widget is unmounted from the widget tree.
|
||||
|
||||
[[Examples|Widget `destroy` method examples]]
|
||||
|
||||
!! Widget `removeChildDomNodes` method
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
created: 20150117152612000
|
||||
modified: 20230325101137075
|
||||
tags: $:/tags/Stylesheet
|
||||
title: $:/editions/tw5.com/doc-styles
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
a.doc-from-version.tc-tiddlylink {
|
||||
display: inline-block;
|
||||
border-radius: 1em;
|
||||
background: <<colour muted-foreground>>;
|
||||
color: <<colour background>>;
|
||||
fill: <<colour background>>;
|
||||
padding: 0 0.4em;
|
||||
font-size: 0.7em;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
line-height: 1.5;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
a.doc-deprecated-version.tc-tiddlylink {
|
||||
display: inline-block;
|
||||
border-radius: 1em;
|
||||
background: red;
|
||||
color: <<colour background>>;
|
||||
fill: <<colour background>>;
|
||||
padding: 0 0.4em;
|
||||
font-size: 0.7em;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
line-height: 1.5;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
.doc-deprecated-version svg,
|
||||
.doc-from-version svg {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
code-body: yes
|
||||
created: 20161008085627406
|
||||
modified: 20221007122259593
|
||||
tags: $:/tags/Macro
|
||||
title: $:/editions/tw5.com/version-macros
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define .from-version(version)
|
||||
<$link to={{{ [<__version__>addprefix[Release ]] }}} class="doc-from-version">{{$:/core/images/warning}} New in: <$text text=<<__version__>>/></$link>
|
||||
\end
|
||||
|
||||
\define .deprecated-since(version, superseded:"TODO-Link")
|
||||
<$link to="Deprecated - What does it mean" class="doc-deprecated-version tc-btn-invisible">{{$:/core/images/warning}} Deprecated since: <$text text=<<__version__>>/></$link> (see <$link to=<<__superseded__>>><$text text=<<__superseded__>>/></$link>)
|
||||
\end
|
||||
@@ -1,18 +1,11 @@
|
||||
caption: 5.3.0
|
||||
created: 20230701123439630
|
||||
modified: 20230701123439630
|
||||
released: 20230701123439630
|
||||
created: 20230506164543446
|
||||
modified: 20230506164543446
|
||||
tags: ReleaseNotes
|
||||
title: Release 5.3.0
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.2.7...v5.3.0]]//
|
||||
|
||||
<<.banner-credits
|
||||
credit:"""Congratulations to [[vilc|https://talk.tiddlywiki.org/u/vilc]] for their winning design for the banner for this release (here is the [[competition thread|https://talk.tiddlywiki.org/t/banner-image-competition-for-v5-3-0/7406/10]]).
|
||||
"""
|
||||
url:"https://raw.githubusercontent.com/Jermolene/TiddlyWiki5/04950452fab7d5cb86f893020355611c4711d361/editions/tw5.com/tiddlers/images/New%20Release%20Banner.jpg"
|
||||
>>
|
||||
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.2.7...master]]//
|
||||
|
||||
! Overview of v5.3.0
|
||||
|
||||
@@ -35,76 +28,49 @@ The approach taken by this release is to add new functionality by extending and
|
||||
|
||||
These changes lay the groundwork for macros and related features to be deprecated (which is the point at which users are advised not to use old features, and instead given clear pointers to the equivalent modern functionality).
|
||||
|
||||
! Text Substitution Improvements
|
||||
|
||||
<<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7526">> The new transclusion architecture is not by itself sufficient to enable us to fully deprecate macros yet. To handle most of the remaining use cases this release adds convenient new ways of using textual substitution without having to create a macro:
|
||||
|
||||
Firstly, the new [[text substitution syntax for widget attributes|Substituted Attribute Values]] allows widget attributes to be assigned the value of a string with certain placeholders being replaced by their processed contents. For example:
|
||||
|
||||
* Substitute variable names with the value: <$codeblock code="attr=`Current tiddler is $(currentTiddler)$`"/>
|
||||
* Substitute filter expressions with the first value they return: <$codeblock code="attr=```There are ${ [tag[Done]count[]] }$ completed tasks```"/>
|
||||
|
||||
Secondly, the new [[substitute operator|substitute Operator]] allows the same textual substitutions to be performed via a filter operator with the addition of positional parameters that use placeholders of the form `$1$`, `$2$`, `$3$` etc.
|
||||
|
||||
```
|
||||
[[https://$1$/$(currentTiddler)$]substitute<domain-name>]
|
||||
```
|
||||
|
||||
! HTTP Requests in WikiText
|
||||
|
||||
<<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7422">> new [[WidgetMessage: tm-http-request]] for performing HTTP requests in WikiText. This opens up some exciting new opportunities:
|
||||
|
||||
* Integration with Web-based APIs. The documentation includes an [[example of using the Zotero API|WidgetMessage: tm-http-request Example - Zotero]] to retrieve academic citation data
|
||||
* Dynamic content loading: additional tiddlers can be imported dynamically after the main wiki has loaded
|
||||
The new transclusion architecture is not by itself sufficient to enable us to fully deprecate macros yet. To handle the remaining use cases we propose a new backtick quoted attribute format that allows for the substitution of variable values. See https://github.com/Jermolene/TiddlyWiki5/issues/6663 for details.
|
||||
|
||||
! Defaulting to Disabling CamelCase Links
|
||||
|
||||
<<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/pull/7513">> CamelCase linking is now disabled by default for new wikis. (Note that this documentation wiki has CamelCase linking explicitly enabled because much of the old content was written relying on them).
|
||||
<<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/pull/7513">> CamelCase linking is now disabled by default. (Note that this wiki has CamelCase linking explicitly enabled)
|
||||
|
||||
! Plugin Improvements
|
||||
|
||||
* <<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/pull/7554">> Google Analytics plugin to use new GA4 code. Note that the update requires manual configuration to use the new "measurement ID" instead of the old "account ID"
|
||||
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/pull/7260">> Dynannotate pugin to support three additional search modes
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7365">> problem with [[BrowserStorage Plugin]] unnecessarily saving shadow tiddlers
|
||||
|
||||
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7398">> [[BrowserStorage Plugin]] to request that browser storage be persisted without eviction
|
||||
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7493">> [[CodeMirror Plugin]] to add an option to make trailing spaces visible
|
||||
|
||||
! Translation improvement
|
||||
|
||||
Improvements to the following translations:
|
||||
|
||||
* French
|
||||
* German
|
||||
* Polish
|
||||
* Chinese
|
||||
*
|
||||
|
||||
! Accessibility Improvements
|
||||
|
||||
*
|
||||
|
||||
! Usability Improvements
|
||||
|
||||
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7524">> consistency of layout of "Settings" tab in $:/ControlPanel
|
||||
|
||||
<!--
|
||||
*
|
||||
|
||||
! Widget Improvements
|
||||
|
||||
-->
|
||||
*
|
||||
|
||||
! Filter improvements
|
||||
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7511"> new [[deserialize Operator]] for converting various textual representations of tiddlers into JSON data
|
||||
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/pull/7292">> [[format Operator]] to support converting Unix timestamps to TiddlyWiki's native date format
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7392">> new [[':then' filter run prefix|Then Filter Run Prefix]]
|
||||
|
||||
|
||||
! Hackability Improvements
|
||||
|
||||
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/pull/7413">> [[Core Icons]] to allow the size to be controlled with a parameter
|
||||
** <<.warning """This change can cause problems with non-standard usage of the core icons where the text is directly rendered instead of being transcluded""">>
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7182">> new [[thisTiddler Variable]] that refers to the tiddler currently being rendered
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7530">> `data-tag-title` attribute to all tag pills, allowing easier [[Custom tag pill styles]]
|
||||
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7332">> [[Story Tiddler Template Cascade]] handling to fall back to the default template if the output of the cascade is not valid
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7378">> missing file extensions for "audio/mpeg" files
|
||||
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/pull/7417">> [[Table-of-Contents Macros]] to add consistent support for an ''exclude'' parameter
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/commit/190613ad2989f70526f86eef17f524087f60eb72">> [[tv-config-static Variable]] for indicating static rendering
|
||||
|
||||
! Bug Fixes
|
||||
|
||||
@@ -113,17 +79,21 @@ Improvements to the following translations:
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7380">> crashes when using an invalid CSS selector for [[WidgetMessage: tm-focus-selector]] and [[WidgetMessage: tm-scroll]]
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7401">> bug whereby scrolling occurs if the linkcatcher widget triggers an action-navigate and the $scroll attribute is set to "no"
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7409">> problem switching between LTR and RTL text
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7448">> bug when the listField attribute of the CheckboxWidget was given the name of a date field (like <<.field created>> or <<.field modified>>)
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7448">> bug when checkbox widget's listField attribute was given the name of a date field (like <<.field created>> or <<.field modified>>)
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7529">> size of buttons in dropdown for editor "link" toolbar button
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/8e132948b6bec623d81d300fbe6dc3a0307bcc6d">> crash when transcluding a lazily loaded tiddler as an attribute value
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7462">> DiffTextWidget crash with missing or empty attributes
|
||||
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7448">> CheckboxWidget to avoid writing to date fields
|
||||
|
||||
! Developer Improvements
|
||||
|
||||
*
|
||||
|
||||
! Node.js Improvements
|
||||
|
||||
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/pull/7471">> [[WebServer Parameter: authenticated-user-header]] to require URI encoding of authenticated username header, permitting non-ASCII characters in usernames
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7253">> support for `filepath` source attribute to [[tiddlywiki.files Files]]
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/commit/48b22abdaab62c281c207127c66883b50898f9dd">> a warning message for JSON errors in [[tiddlywiki.info Files]] or [[plugin.info Files|PluginFolders]]
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7490">> new "explodePlugins" option to SaveWikiFolderCommand
|
||||
|
||||
! Performance Improvements
|
||||
|
||||
@@ -134,15 +104,10 @@ Improvements to the following translations:
|
||||
[[@Jermolene|https://github.com/Jermolene]] would like to thank the contributors to this release who have generously given their time to help improve TiddlyWiki:
|
||||
|
||||
<<.contributors """
|
||||
AnthonyMuscio
|
||||
Arlen22
|
||||
BramChen
|
||||
btheado
|
||||
buggyj
|
||||
carlo-colombo
|
||||
cdruan
|
||||
donmor
|
||||
EvidentlyCube
|
||||
flibbles
|
||||
GameDungeon
|
||||
JoshuaFontany
|
||||
@@ -152,13 +117,10 @@ Marxsal
|
||||
mateuszwilczek
|
||||
michsa
|
||||
muzimuzhi
|
||||
oeyoews
|
||||
pmario
|
||||
rmunn
|
||||
saqimtiaz
|
||||
tavin
|
||||
twMat
|
||||
xcazin
|
||||
yaisog
|
||||
Zacharia2
|
||||
""">>
|
||||
@@ -1,78 +0,0 @@
|
||||
caption: 5.3.1
|
||||
created: 20230720215100983
|
||||
modified: 20230720215100983
|
||||
tags: ReleaseNotes
|
||||
title: Release 5.3.1
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.3.0...master]]//
|
||||
|
||||
! Overview of v5.3.1
|
||||
|
||||
! Reversions of v5.3.0 Changes
|
||||
|
||||
* Reverted adding the `widget.destroy()` method because of performance concerns (see https://github.com/Jermolene/TiddlyWiki5/pull/7468)
|
||||
|
||||
! Plugin Improvements
|
||||
|
||||
*
|
||||
|
||||
! Translation improvement
|
||||
|
||||
Improvements to the following translations:
|
||||
|
||||
* Chinese
|
||||
* Polish
|
||||
|
||||
! Usability Improvements
|
||||
|
||||
*
|
||||
|
||||
! Widget Improvements
|
||||
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7594">> ''tabindex'' attribute to SelectWidget
|
||||
|
||||
! Filter improvements
|
||||
|
||||
*
|
||||
|
||||
! Hackability Improvements
|
||||
|
||||
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7611">> ImportVariablesWidget and [[Pragma: \import]] to trim whitespace when parsing tiddlers
|
||||
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/commit/9b2af1359614f4ad5afd05be7cf9853909334592"> [[WidgetMessage: tm-http-request]] to handle binary responses ([[demo|WidgetMessage: tm-http-request Example - Random Dog]])
|
||||
|
||||
! Bug Fixes
|
||||
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7627">> table of contents indentation
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7595">> bindStatus and bindProgress parameters of [[WidgetMessage: tm-http-request]]
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7606">> attribute substitution to handle variables containing non-word characters
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7624">> the pragmas introduced in v5.3.0 so that they can be indented with whitespace
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7619">> size of tiddler icons
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7622">> drag and drop from Chrome-like browsers to Firefox
|
||||
|
||||
! Node.js Improvements
|
||||
|
||||
*
|
||||
|
||||
! Developer Improvements
|
||||
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/6c7c21a87bdb0d8a00df1c14eea18912164e0b57">> overeager onload handler in Jasmine plugin
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/08bad90e51c45233a196333e101bbbf6ecf702ce">> ordering of shadow tiddler listings to not reflect order of insertion
|
||||
|
||||
Currently shadow tiddler ordering depends upon the order in which the shadows appear in the plugin JSON
|
||||
|
||||
! Acknowledgements
|
||||
|
||||
[[@Jermolene|https://github.com/Jermolene]] would like to thank the contributors to this release who have generously given their time to help improve TiddlyWiki:
|
||||
|
||||
<<.contributors """
|
||||
AnthonyMuscio
|
||||
btheado
|
||||
CrossEye
|
||||
flibbles
|
||||
hffqyd
|
||||
pmario
|
||||
saqimtiaz
|
||||
stevesunypoly
|
||||
twMat
|
||||
""">>
|
||||
@@ -1,6 +1,6 @@
|
||||
title: $:/config/LocalPluginLibrary
|
||||
tags: $:/tags/PluginLibrary
|
||||
url: http://127.0.0.1:8080/prerelease/library/v5.3.1/index.html
|
||||
url: http://127.0.0.1:8080/prerelease/library/v5.2.2/index.html
|
||||
caption: {{$:/language/OfficialPluginLibrary}} (Prerelease Local)
|
||||
|
||||
A locally installed version of the official ~TiddlyWiki plugin library at tiddlywiki.com for testing and debugging. //Requires a local web server to share the library//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
title: $:/config/OfficialPluginLibrary
|
||||
tags: $:/tags/PluginLibrary
|
||||
url: https://tiddlywiki.com/prerelease/library/v5.3.1/index.html
|
||||
url: https://tiddlywiki.com/prerelease/library/v5.2.8/index.html
|
||||
caption: {{$:/language/OfficialPluginLibrary}} (Prerelease)
|
||||
|
||||
The prerelease version of the official ~TiddlyWiki plugin library at tiddlywiki.com. Plugins, themes and language packs are maintained by the core team.
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
title: Filters/substitute
|
||||
description: Test substitute operator
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: substitute filter data 1
|
||||
tags: Hello There [[Welcome to TiddlyWiki]] GettingStarted
|
||||
|
||||
TiddlyWiki
|
||||
+
|
||||
title: substitute filter data 2
|
||||
|
||||
The output of the filter `[[substitute filter data 1]tags[]]` is ${[[substitute filter data 1]tags[]]}$.
|
||||
+
|
||||
title: substitute filter data 3
|
||||
|
||||
Welcome to $(projectname)$ $1$ $2$ $3$. Tiddlers starting with `substitute`: ${[prefix[substitute]format:titlelist[]join[ ]]}$.
|
||||
+
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
<$let projectname="TiddlyWiki">
|
||||
(<$text text={{{ [[]substitute[]] }}}/>)
|
||||
(<$text text={{{ [[Hello There, welcome to $TiddlyWiki$]substitute[]] }}}/>)
|
||||
(<$text text={{{ [[Welcome to $(projectname)$]substitute[]] }}}/>)
|
||||
(<$text text={{{ [[Welcome to $(projectname)$ $1$]substitute[today]] }}}/>)
|
||||
(<$text text={{{ [[This is not a valid embedded filter ${ hello )$]substitute[]] }}}/>)
|
||||
(<$text text={{{ [{substitute filter data 2}substitute[]] }}}/>)
|
||||
(<$text text={{{ [{substitute filter data 3}substitute[every],[day]] }}}/>)
|
||||
</$let>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>()
|
||||
(Hello There, welcome to $TiddlyWiki$)
|
||||
(Welcome to TiddlyWiki)
|
||||
(Welcome to TiddlyWiki today)
|
||||
(This is not a valid embedded filter ${ hello )$)
|
||||
(The output of the filter `[[substitute filter data 1]tags[]]` is Hello.)
|
||||
(Welcome to TiddlyWiki every day $3$. Tiddlers starting with `substitute`: [[substitute filter data 1]] [[substitute filter data 2]] [[substitute filter data 3]].)</p>
|
||||
@@ -1,24 +0,0 @@
|
||||
title: Functions/Function/Indented
|
||||
description: Indented function definition
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
\function .dividebysomething(factor:0.5)
|
||||
[divide<factor>]
|
||||
\end
|
||||
|
||||
\function multiplebysomething(first:ignored,factor:2)
|
||||
[multiply<factor>multiply[2].dividebysomething[0.25]]
|
||||
\end
|
||||
|
||||
<$text text={{{ [[4]function[multiplebysomething]] }}}/>
|
||||
|
|
||||
<$text text={{{ [[6]function[multiplebysomething],[ignored],[4]] }}}/>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>64|192</p>
|
||||
@@ -33,4 +33,4 @@ $param$ with a ''buffalo''
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>Going to lunch with a ''buffalo''</p><p>Going to breakfastwith a<strong>buffalo</strong></p><p>Going to dinner with a <strong>buffalo</strong></p>Going to lunch with a ''buffalo''Going to breakfastwith abuffaloGoing to dinner with a buffalo
|
||||
<p>Going to lunch with a ''buffalo''</p><p>Going to breakfastwith a<strong>buffalo</strong></p><p>Going to dinner with a <strong>buffalo</strong></p>Going to lunch with a buffalo with a buffaloGoing to dinner with a buffalo
|
||||
@@ -1,23 +0,0 @@
|
||||
title: ImportVariables/WithSetWidgets
|
||||
description: Import variables defined with a set widget
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
\import Definitions
|
||||
<$text text=<<one>>/>,
|
||||
<$text text=<<two>>/>
|
||||
+
|
||||
title: Definitions
|
||||
|
||||
\whitespace trim
|
||||
<$set name="one" value="elephant">
|
||||
<$set name="two" value="giraffe">
|
||||
</$set>
|
||||
</$set>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>elephant,giraffe</p>
|
||||
@@ -1,22 +0,0 @@
|
||||
title: ImportVariables/WithSetWidgets2
|
||||
description: Import variables defined with a set widget without whitespace pragma
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
\import Definitions
|
||||
<$text text=<<one>>/>,
|
||||
<$text text=<<two>>/>
|
||||
+
|
||||
title: Definitions
|
||||
|
||||
<$set name="one" value="elephant">
|
||||
<$set name="two" value="giraffe">
|
||||
</$set>
|
||||
</$set>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>elephant,giraffe</p>
|
||||
@@ -1,29 +0,0 @@
|
||||
title: ImportVariables/WithSetWidgetsAndMacros
|
||||
description: Import variables defined with a set widget without whitespace pragma
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
\import Definitions
|
||||
<$text text=<<name>>/>,
|
||||
<$text text=<<address>>/>,
|
||||
<$text text=<<one>>/>,
|
||||
<$text text=<<two>>/>
|
||||
+
|
||||
title: Definitions
|
||||
|
||||
\define name() Bugs Bunny
|
||||
\procedure address()
|
||||
Bunny Hill
|
||||
\end
|
||||
|
||||
<$set name="one" value="elephant">
|
||||
<$set name="two" value="giraffe">
|
||||
</$set>
|
||||
</$set>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>Bugs Bunny,Bunny Hill,elephant,giraffe</p>
|
||||
@@ -1,20 +0,0 @@
|
||||
title: Procedures/Nested/Indented
|
||||
description: Nested Procedures that are indented
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
\procedure alpha(x)
|
||||
\procedure beta(y)
|
||||
<$text text=<<y>>/>
|
||||
\end beta
|
||||
<$transclude $variable="beta" y={{{ [<x>addprefix<x>] }}}/>
|
||||
\end alpha
|
||||
|
||||
<<alpha "Elephant">>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>ElephantElephant</p>
|
||||
@@ -1,22 +0,0 @@
|
||||
title: Procedures/TrailingNewlines
|
||||
description: Trailing newlines in procedures must not be dropped
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\procedure inner()
|
||||
Paragraph 1
|
||||
|
||||
Paragraph 2
|
||||
\end
|
||||
\procedure outer()
|
||||
<$macrocall $name=inner />
|
||||
|
||||
\end
|
||||
<<outer>>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>Paragraph 1</p><p>Paragraph 2</p>
|
||||
@@ -1,33 +0,0 @@
|
||||
title: Transclude/CustomWidget/Simple/Indented
|
||||
description: Custom widget definition indented
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
<$transclude $tiddler='TiddlerOne' one='Ferret'>
|
||||
</$transclude>
|
||||
+
|
||||
title: TiddlerOne
|
||||
|
||||
\whitespace trim
|
||||
<!-- Define the <$my.widget> widget by defining a transcludable variable with that name -->
|
||||
\widget $my.widget(one:'Jaguar')
|
||||
\whitespace trim
|
||||
<$text text=<<one>>/>
|
||||
<$slot $name="ts-raw">
|
||||
Whale
|
||||
</$slot>
|
||||
\end
|
||||
<$my.widget one="Dingo">
|
||||
Crocodile
|
||||
</$my.widget>
|
||||
<$my.widget one="BumbleBee">
|
||||
Squirrel
|
||||
</$my.widget>
|
||||
<$my.widget/>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>DingoCrocodileBumbleBeeSquirrelJaguarWhale</p>
|
||||
@@ -1,20 +0,0 @@
|
||||
title: Transclude/Parameterised/Shortcut/ParametersIndented
|
||||
description: Simple parameterised transclusion using the parameters pragma (indented)
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
<$transclude $tiddler='TiddlerOne' one='Ferret'/>
|
||||
<$transclude $tiddler='TiddlerOne'/>
|
||||
+
|
||||
title: TiddlerOne
|
||||
|
||||
\whitespace trim
|
||||
\parameters(one:'Jaguar')
|
||||
<$text text=<<one>>/>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>FerretJaguar</p>
|
||||
@@ -1,26 +0,0 @@
|
||||
title: Procedures/Double/Underscore
|
||||
description: Checking that procedures don't expose parameters as variables wrapped in double underscores
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
\procedure mamacro(one:"red",two:"green")
|
||||
It is $one$ and $two$<<__one__>><<__two__>>.
|
||||
\end
|
||||
|
||||
<$macrocall $name="mamacro"/>
|
||||
|
||||
<$transclude $variable="mamacro"/>
|
||||
|
||||
<$transclude $variable="mamacro" one="orange"/>
|
||||
|
||||
<$transclude $variable="mamacro" 0="pink"/>
|
||||
|
||||
<$transclude $variable="mamacro" one="purple" 1="pink"/>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>It is $one$ and $two$.</p><p>It is $one$ and $two$.</p><p>It is $one$ and $two$.</p><p>It is $one$ and $two$.</p><p>It is $one$ and $two$.</p>
|
||||
@@ -1,21 +0,0 @@
|
||||
title: Widgets/SubstitutedAttributes
|
||||
description: Attributes specified as string that should have substitution performed.
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
<$set name="var with spaces" value="spaces">
|
||||
<$let project="TiddlyWiki" disabled="true" var-with-dashes="dashes">
|
||||
<div class=`$(project)$
|
||||
${ [[Hello]addsuffix[There]] }$` attrib=`myvalue` otherattrib=`$(1)$` blankattrib=`` quoted="here" disabled=```$(disabled)$``` dashes=`$(var-with-dashes)$` spaces=`$(var with spaces)$`>
|
||||
</div>
|
||||
</$let>
|
||||
</$set>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p><div attrib="myvalue" blankattrib="" class="TiddlyWiki
|
||||
HelloThere" dashes="dashes" disabled="true" otherattrib="" quoted="here" spaces="spaces"></div></p>
|
||||
@@ -397,8 +397,8 @@ Tests the filtering mechanism.
|
||||
expect(wiki.filterTiddlers("[all[shadows]tag[two]]").join(",")).toBe("$:/TiddlerFive");
|
||||
expect(wiki.filterTiddlers("[all[shadows+tiddlers]tag[two]]").join(",")).toBe("$:/TiddlerFive,$:/TiddlerTwo,Tiddler Three");
|
||||
expect(wiki.filterTiddlers("[all[tiddlers+shadows]tag[two]]").join(",")).toBe("$:/TiddlerTwo,Tiddler Three,$:/TiddlerFive");
|
||||
expect(wiki.filterTiddlers("[all[shadows+tiddlers]]").join(",")).toBe("$:/TiddlerFive,Tiddler8,TiddlerSeventh,TiddlerSix,$:/ShadowPlugin,$:/TiddlerTwo,a fourth tiddler,filter regexp test,has filter,hasList,one,Tiddler Three,TiddlerOne");
|
||||
expect(wiki.filterTiddlers("[all[tiddlers+shadows]]").join(",")).toBe("$:/ShadowPlugin,$:/TiddlerTwo,a fourth tiddler,filter regexp test,has filter,hasList,one,Tiddler Three,TiddlerOne,$:/TiddlerFive,Tiddler8,TiddlerSeventh,TiddlerSix");
|
||||
expect(wiki.filterTiddlers("[all[shadows+tiddlers]]").join(",")).toBe("$:/TiddlerFive,TiddlerSix,TiddlerSeventh,Tiddler8,$:/ShadowPlugin,$:/TiddlerTwo,a fourth tiddler,filter regexp test,has filter,hasList,one,Tiddler Three,TiddlerOne");
|
||||
expect(wiki.filterTiddlers("[all[tiddlers+shadows]]").join(",")).toBe("$:/ShadowPlugin,$:/TiddlerTwo,a fourth tiddler,filter regexp test,has filter,hasList,one,Tiddler Three,TiddlerOne,$:/TiddlerFive,TiddlerSix,TiddlerSeventh,Tiddler8");
|
||||
expect(wiki.filterTiddlers("[all[tiddlers]tag[two]]").join(",")).toBe("$:/TiddlerTwo,Tiddler Three");
|
||||
expect(wiki.filterTiddlers("[all[orphans+tiddlers+tags]]").join(",")).toBe("$:/ShadowPlugin,$:/TiddlerTwo,a fourth tiddler,filter regexp test,has filter,hasList,Tiddler Three,TiddlerOne,two,one");
|
||||
});
|
||||
@@ -420,10 +420,10 @@ Tests the filtering mechanism.
|
||||
|
||||
it("should handle the tagging operator", function() {
|
||||
expect(wiki.filterTiddlers("[[one]tagging[]sort[title]]").join(",")).toBe("Tiddler Three,Tiddler8,TiddlerOne,TiddlerSeventh");
|
||||
expect(wiki.filterTiddlers("[[one]tagging[]]").join(",")).toBe("Tiddler Three,TiddlerOne,Tiddler8,TiddlerSeventh");
|
||||
expect(wiki.filterTiddlers("[[one]tagging[]]").join(",")).toBe("Tiddler Three,TiddlerOne,TiddlerSeventh,Tiddler8");
|
||||
expect(wiki.filterTiddlers("[[two]tagging[]sort[title]]").join(",")).toBe("$:/TiddlerFive,$:/TiddlerTwo,Tiddler Three");
|
||||
var fakeWidget = {wiki: wiki, getVariable: function(name) {return name === "currentTiddler" ? "one": undefined;}};
|
||||
expect(wiki.filterTiddlers("[all[current]tagging[]]",fakeWidget).join(",")).toBe("Tiddler Three,TiddlerOne,Tiddler8,TiddlerSeventh");
|
||||
expect(wiki.filterTiddlers("[all[current]tagging[]]",fakeWidget).join(",")).toBe("Tiddler Three,TiddlerOne,TiddlerSeventh,Tiddler8");
|
||||
});
|
||||
|
||||
it("should handle the untagged operator", function() {
|
||||
@@ -1066,11 +1066,7 @@ Tests the filtering mechanism.
|
||||
});
|
||||
|
||||
it("should handle the deserializers operator", function() {
|
||||
var expectedDeserializers = ["application/javascript","application/json","application/x-tiddler","application/x-tiddler-html-div","application/x-tiddlers","text/css","text/html","text/plain"];
|
||||
if($tw.browser) {
|
||||
expectedDeserializers.unshift("(DOM)");
|
||||
}
|
||||
expect(wiki.filterTiddlers("[deserializers[]]").join(",")).toBe(expectedDeserializers.join(","));
|
||||
expect(wiki.filterTiddlers("[deserializers[]]").join(",")).toBe("application/javascript,application/json,application/x-tiddler,application/x-tiddler-html-div,application/x-tiddlers,text/css,text/html,text/plain");
|
||||
});
|
||||
|
||||
it("should handle the charcode operator", function() {
|
||||
|
||||
@@ -161,16 +161,6 @@ describe("HTML tag new parser tests", function() {
|
||||
expect($tw.utils.parseAttribute(" attrib1>",0)).toEqual(
|
||||
{ type : 'string', value : 'true', start : 0, name : 'attrib1', end : 8 }
|
||||
);
|
||||
expect($tw.utils.parseAttribute("p=`blah` ",1)).toEqual(null);
|
||||
expect($tw.utils.parseAttribute("p=`blah` ",0)).toEqual(
|
||||
{ start: 0, name: 'p', type: 'substituted', rawValue: 'blah', end: 8 }
|
||||
);
|
||||
expect($tw.utils.parseAttribute("p=```blah``` ",0)).toEqual(
|
||||
{ start: 0, name: 'p', type: 'substituted', rawValue: 'blah', end: 12 }
|
||||
);
|
||||
expect($tw.utils.parseAttribute("p=`Hello \"There\"`",0)).toEqual(
|
||||
{ start: 0, name: 'p', type: 'substituted', rawValue: 'Hello "There"', end: 17 }
|
||||
);
|
||||
});
|
||||
|
||||
it("should parse HTML tags", function() {
|
||||
|
||||
@@ -434,15 +434,6 @@ describe("'reduce' and 'intersection' filter prefix tests", function() {
|
||||
expect(wiki.filterTiddlers("[tag[shopping]] :map[get[title]addprefix[-]addprefix<length>addprefix[of]addprefix<index>]").join(",")).toBe("0of4-Brownies,1of4-Chick Peas,2of4-Milk,3of4-Rice Pudding");
|
||||
});
|
||||
|
||||
it("should handle the :then prefix", function() {
|
||||
expect(wiki.filterTiddlers("[[one]] :then[[two]]").join(",")).toBe("two");
|
||||
expect(wiki.filterTiddlers("[[one]] :then[tag[shopping]]").join(",")).toBe("Brownies,Chick Peas,Milk,Rice Pudding");
|
||||
expect(wiki.filterTiddlers("[[one]] [[two]] [[three]] :then[[four]]").join(",")).toBe("four");
|
||||
expect(wiki.filterTiddlers("[[one]] :then[tag[nonexistent]]").join(",")).toBe("one");
|
||||
expect(wiki.filterTiddlers(":then[[two]]").length).toBe(0);
|
||||
expect(wiki.filterTiddlers("[[notatiddler]is[tiddler]] :then[[two]]").length).toBe(0);
|
||||
});
|
||||
|
||||
it("should handle macro parameters for filter run prefixes",function() {
|
||||
var widget = require("$:/core/modules/widgets/widget.js");
|
||||
var rootWidget = new widget.widget({ type:"widget", children:[ {type:"widget", children:[]} ] },
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
caption: ~TiddlyStow (experimental)
|
||||
caption: TiddlyStow (experimental)
|
||||
color: #FF8A65
|
||||
created: 20230403170650008
|
||||
delivery: Saver
|
||||
@@ -13,4 +13,4 @@ url: https://github.com/btheado/tiddlystow
|
||||
''Link:'' {{!!url}}
|
||||
|
||||
Tiddlystow saves TiddlyWiki files locally using the browser file system API (Chrome-based browsers currently).
|
||||
This is a simple web page for loading a local TiddlyWiki file and storing it back to the same local file requiring no plugins or extensions.
|
||||
This is a simple web page for loading a local TiddlyWiki file and storing it back to the same local file requiring no plugins or extensions.
|
||||
@@ -9,13 +9,9 @@ tags: Concepts
|
||||
<$button actions=<<actions>>>$text$</$button>
|
||||
\end
|
||||
|
||||
ShadowTiddlers are tiddlers that are loaded from [[Plugins]] at the wiki startup. Unlike ordinary tiddlers, they don't appear in most lists.
|
||||
ShadowTiddlers are tiddlers that are loaded from within [[Plugins]]. Unlike ordinary tiddlers, they don't appear in most lists.
|
||||
|
||||
!! Overriding Shadow Tiddlers to modify plugins
|
||||
|
||||
A ShadowTiddler can be overridden with an ordinary tiddler of the same name. This leaves the shadow tiddler intact but the plugin will use the overriding tiddler in its place, effectively allowing users to modify the behaviour of plugins.
|
||||
|
||||
Users are cautioned against overriding shadow tiddlers because if the shadow tiddler is changed in a plugin update, the overriding tiddler may no longer perform as intended. To remedy this, the overriding tiddler may be modified or deleted. If the overriding tiddler is deleted, then the plugin falls back to using the original shadow tiddler.
|
||||
ShadowTiddlers can be overridden with an ordinary tiddler of the same name. If that tiddler is subsequently deleted then the original shadow tiddler is automatically restored.
|
||||
|
||||
!! Overridden Shadow Tiddlers
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
caption: Fourth-Caption
|
||||
created: 20150221194405000
|
||||
modified: 20211114013601188
|
||||
tags: Contents [[Table-of-Contents Demonstrations]]
|
||||
title: Fourth
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.toc-lorem>>
|
||||
|
||||
@@ -2,15 +2,5 @@ created: 20150221194423000
|
||||
modified: 20211114013601189
|
||||
tags: SecondThree [[Table-of-Contents Demonstrations]]
|
||||
title: SecondThreeThree
|
||||
toc-link: no
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
''Important''
|
||||
|
||||
It's important that this tiddler has no "child" to be able to visually test every possible toc code-path.
|
||||
|
||||
* This tiddler has a field ''toc-link: no''
|
||||
* Do not tag any other tiddler with the title of this one
|
||||
|
||||
|
||||
|
||||
<<.toc-lorem>>
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
caption: Third-Caption
|
||||
created: 20150221194436000
|
||||
list: ThirdOne ThirdTwo ThirdThree
|
||||
modified: 20211114013601191
|
||||
tags: Contents [[Table-of-Contents Demonstrations]]
|
||||
title: Third
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.toc-lorem>>
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
created: 20230627093650105
|
||||
modified: 20230627094356394
|
||||
tags: Features
|
||||
title: Deserializers
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
Deserializer [[modules|Modules]] parse text in various formats into their JSON representation as tiddlers. The deserializer modules available in a wiki can be seen using the [[deserializers operator|deserializers Operator]] and can be used with the [[deserialize Operator]].
|
||||
|
||||
The TiddlyWiki core provides the following deserializers:
|
||||
|
||||
|!Deserializer |!Description |
|
||||
|(DOM)|Extracts tiddlers from a DOM node, should not be used with the <<.op deserialize[]>> operator |
|
||||
|application/javascript|Parses a JavaScript module as a tiddler extracting fields from the header comment|
|
||||
|application/json|Parses [[JSON|JSON in TiddlyWiki]] into tiddlers|
|
||||
|application/x-tiddler|Parses the [[.tid file format|TiddlerFiles]] as a tiddler|
|
||||
|application/x-tiddler-html-div|Parses the [[<DIV>.tiddler file format|TiddlerFiles]] as a tiddler|
|
||||
|application/x-tiddlers|Parses the [[MultiTiddlerFile format|MultiTiddlerFiles]] as tiddlers|
|
||||
|text/css|Parses CSS as a tiddler extracting fields from the header comment|
|
||||
|text/html|Parses an HTML file into tiddlers. Supports ~TiddlyWiki Classic HTML files, ~TiddlyWiki5 HTML files and ordinary HTML files|
|
||||
|text/plain|Parses plain text as a tiddler|
|
||||
@@ -1,12 +1,12 @@
|
||||
created: 20190802113703788
|
||||
modified: 20230501175143648
|
||||
modified: 20190802132727925
|
||||
tags: Filters
|
||||
title: Conditional Operators
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.from-version "5.1.20">>The conditional filter operators allow for ''if-then-else'' logic to be expressed within filters.
|
||||
<<.from-version "5.1.20">>The conditional filter operators allow ''if-then-else'' logic to be expressed within filters.
|
||||
|
||||
The foundation is the convention that an empty list can be used to represent the Boolean value <<.value false>> and a list with at one (or more) entries to represent <<.value true>>.
|
||||
The foundation is the convention that an empty list can be used to represent the boolean value ''false'' and a list with at one (or more) entries to represent ''true''.
|
||||
|
||||
The conditional operators are:
|
||||
|
||||
@@ -19,12 +19,10 @@ The conditional operators are:
|
||||
|
||||
These operators can be combined. For example:
|
||||
|
||||
<<.operator-example 1 "[[New Tiddler]is[missing]then[I am missing]else[No I am not missing]]">>
|
||||
<<.inline-operator-example "[[New Tiddler]is[missing]then[I am missing]else[No I am not missing]]">>
|
||||
|
||||
The <<.olink else>> operator can be used to apply a defaults for missing values. In this example, we take advantage of the fact that the <<.olink get>> operator returns an empty list if the field or tiddler does not exist:
|
||||
The [[else Operator]] can be used to apply a defaults for missing values. In this example, we take advantage of the fact that the [[get Operator]] returns an empty list if the field or tiddler does not exist:
|
||||
|
||||
<<.operator-example 2 "[[HelloThere]get[custom-field]else[default-value]]">>
|
||||
<<.inline-operator-example "[[HelloThere]get[custom-field]else[default-value]]">>
|
||||
|
||||
! Filter Run Prefixes
|
||||
|
||||
The [[:then|:then Filter Run Prefix]] and [[:else|:else Filter Run Prefix]] filter run prefixes serve a similar purpose as the conditional operators. Refer to their documentation for more information.
|
||||
<<list-links "[tag[Conditional Operators]]">>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
caption: deserialize
|
||||
created: 20230601195749377
|
||||
from-version: 5.3.0
|
||||
modified: 20230627094109762
|
||||
modified: 20230602105513132
|
||||
op-input: a selection of strings
|
||||
op-output: JSON representations of tiddlers extracted from input titles.
|
||||
op-parameter: the deserializer module to be used to extract tiddlers from the input
|
||||
@@ -10,8 +10,17 @@ tags: [[Filter Operators]] [[Special Operators]]
|
||||
title: deserialize Operator
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
{{Deserializers}}
|
||||
|
||||
<<.tip "Deserializer modules parse text in various formats into their JSON representation as tiddlers. You can see the deserializers available in a wiki using the [[deserializers operator|deserializers Operator]].">>
|
||||
|
||||
|!Deserializer |!Description |
|
||||
|(DOM)|Extracts tiddlers from a DOM node, should not be used with the <<.op deserialize[]>> operator |
|
||||
|application/javascript|Parses a JavaScript module as a tiddler extracting fields from the header comment|
|
||||
|application/json|Parses [[JSON|JSON in TiddlyWiki]] into tiddlers|
|
||||
|application/x-tiddler|Parses the [[.tid file format|TiddlerFiles]] as a tiddler|
|
||||
|application/x-tiddler-html-div|Parses the [[<DIV>.tiddler file format|TiddlerFiles]] as a tiddler|
|
||||
|application/x-tiddlers|Parses the [[MultiTiddlerFile format|MultiTiddlerFiles]] as tiddlers|
|
||||
|text/css|Parses CSS as a tiddler extracting fields from the header comment|
|
||||
|text/html|Parses an HTML file into tiddlers. Supports ~TiddlyWiki Classic HTML files, ~TiddlyWiki5 HTML files and ordinary HTML files|
|
||||
|text/plain|Parses plain text as a tiddler|
|
||||
|
||||
<<.operator-examples "deserialize">>
|
||||
@@ -1,14 +1,14 @@
|
||||
caption: deserializers
|
||||
created: 20210506115203172
|
||||
from-version: 5.2.0
|
||||
modified: 20230627094238610
|
||||
modified: 20210506130322593
|
||||
op-input: ignored
|
||||
op-output: the title of each available deserializer
|
||||
op-parameter: none
|
||||
tags: [[Filter Operators]] [[Special Operators]] [[Selection Constructors]]
|
||||
tags: [[Filter Operators]] [[Special Operators]] [[Selection Constructors]]
|
||||
title: deserializers Operator
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.tip "You can specify a specific [[deserializer|Deserializers]] for a DropzoneWidget to use">>
|
||||
<<.tip "You can specify a specific deserializer for a DropzoneWidget to use">>
|
||||
|
||||
<<.operator-examples "deserializers">>
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
created: 20230614225302905
|
||||
modified: 20230614233448662
|
||||
tags: [[Operator Examples]] [[substitute Operator]]
|
||||
title: substitute Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define time() morning
|
||||
\define field() modified
|
||||
\procedure sentence() This tiddler was last $(field)$ on ${[{!!modified}format:date[DDth MMM YYYY]]}$
|
||||
\define name() Bugs Bunny
|
||||
\define address() Rabbit Hole Hill
|
||||
|
||||
!Substitute <<.op substitute[]>> operator parameters
|
||||
<<.operator-example 1 "[[Hi, I'm $1$ and I live in $2$]substitute[Bugs Bunny],[Rabbit Hole Hill]]">>
|
||||
|
||||
!Substitute variables
|
||||
This example uses the following variables:
|
||||
|
||||
* name: <$codeblock code=<<name>>/>
|
||||
* address: <$codeblock code=<<address>>/>
|
||||
|
||||
<<.operator-example 2 "[[Hi, I'm $(name)$ and I live in $(address)$]substitute[]]">>
|
||||
|
||||
!Substitute variables and operator parameters
|
||||
This example uses the following variable:
|
||||
|
||||
* time: <$codeblock code=<<time>>/>
|
||||
|
||||
<<.operator-example 3 "[[Something in the $(time)$ at $2$ about $1$ ]substitute[Maths],[the Library]]">>
|
||||
|
||||
!Substitute a filter expression and a variable
|
||||
This example uses the following variables:
|
||||
|
||||
* field: <$codeblock code=<<field>>/>
|
||||
* sentence: <$codeblock code=<<sentence>>/>
|
||||
|
||||
<<.operator-example 4 "[<sentence>substitute[]]">>
|
||||
@@ -1,27 +0,0 @@
|
||||
caption: substitute
|
||||
created: 20230614223551834
|
||||
modified: 20230615173049692
|
||||
op-input: a [[selection of titles|Title Selection]]
|
||||
op-output: the input titles with placeholders for filter expressions, parameter and variables replaced with their corresponding values
|
||||
op-parameter: the <<.op substitute>> operator optionally accepts a variable number of parameters, see below for details
|
||||
op-purpose: returns each item in the list, replacing within each title placeholders for filters, parameters and variables with their corresponding values
|
||||
tags: [[Filter Operators]] [[String Operators]]
|
||||
title: substitute Operator
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.from-version "5.3.0">>
|
||||
|
||||
The <<.op substitute>> operator replaces any placeholders in the input titles in the following order:
|
||||
|
||||
# filter expressions
|
||||
# parameters to the <<.op substitute>> operator
|
||||
# variables
|
||||
|
||||
|placeholder syntax|description|h
|
||||
|`$n$`|Text substitution of a parameter provided to the operator, where n is the position of the parameter starting with 1 for the first parameter. Unmatched placeholders pass through unchanged. |
|
||||
|`$(varname)$`|Text substitution of a variable. Undefined variables are replaced with an empty string. |
|
||||
|`${ filter expression }$`|Text substitution of the first result of evaluating a filter expression. In other words, if the filter returns multiple titles only the first one will be used. |
|
||||
|
||||
<<.tip """Placeholders that contain square bracket characters are not valid filter syntax when used directly in a filter expression. However they can be provided as input to the <$macrocall $name=".op" _="substitute"/> operator as text references or variables""">>
|
||||
|
||||
<<.operator-examples "substitute">>
|
||||
@@ -1,49 +0,0 @@
|
||||
created: 20230617183745774
|
||||
modified: 20230617183745774
|
||||
tags: [[Then Filter Run Prefix]]
|
||||
title: Then Filter Run Prefix (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
|
||||
!! Conditional Execution
|
||||
|
||||
The <<.op :then>> filter run prefix can be used to avoid the need for nested [[ListWidget]]s or [[Macro Definitions in WikiText]].
|
||||
|
||||
<$macrocall $name='wikitext-example-without-html'
|
||||
src="""<$edit-text field="search" placeholder="Search title"/>
|
||||
|
||||
<$let searchTerm={{!!search}}>
|
||||
<$list filter="[<searchTerm>minlength[3]] :then[!is[system]search:title<searchTerm>]" template="$:/core/ui/ListItemTemplate"/>
|
||||
</$let>"""/>
|
||||
|
||||
|
||||
!! Conditional (Sub)Filters
|
||||
|
||||
The <<.op :then>> filter run prefix can be combined with the <<.op :else>> prefix to create conditional filters. In this example, the fields used in <<.var searchSubfilter>> for searching depend on the value of [[$:/temp/searchFields]] and the sort order used by <<.var sortSubfilter>> depends on the value of [[$:/temp/searchSort]]. Checkboxes are used to set the values of these tiddlers.
|
||||
|
||||
<<.tip "Note that each filter run of the subfilter receives the input of the <<.olink subfilter>> operator as input">>
|
||||
|
||||
Since the <<.olink then>> and <<.olink else>> operators cannot call subfilters or perform additional filter steps, they cannot be used for such applications.
|
||||
|
||||
<$macrocall $name='wikitext-example-without-html'
|
||||
src="""<$checkbox tiddler="$:/temp/searchSort"
|
||||
field="text"
|
||||
checked="chrono" unchecked="alpha" default="alpha">
|
||||
Sort chronologically (newest first)
|
||||
</$checkbox><br/>
|
||||
<$checkbox tiddler="$:/temp/searchFields"
|
||||
field="text"
|
||||
checked="title" unchecked="default" default="title">
|
||||
Search <<.field title>> only
|
||||
</$checkbox><p/>
|
||||
<$let searchSubfilter="[{$:/temp/searchFields}match[default]] :then[search[prefix]] :else[search:title[prefix]]"
|
||||
sortSubfilter="[{$:/temp/searchSort}match[chrono]] :then[!nsort[modified]] :else[sort[title]]"
|
||||
limit=10 >
|
||||
<$list filter="[all[tiddlers]!is[system]subfilter<searchSubfilter>subfilter<sortSubfilter>first<limit>]">
|
||||
<$link/> (<$text text={{{ [{!!modified}format:date[YYYY-0MM-0DD]] }}} />)<br/>
|
||||
</$list>
|
||||
<$list filter="[all[tiddlers]!is[system]subfilter<searchSubfilter>rest<limit>count[]]">
|
||||
... and <<currentTiddler>> more.
|
||||
</$list>
|
||||
</$let>"""/>
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
created: 20210618133745003
|
||||
from-version: 5.3.0
|
||||
modified: 20230506172920710
|
||||
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:
|
||||
tags: [[Filter Run Prefix]] [[Filter Syntax]]
|
||||
title: Then Filter Run Prefix
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define .op-row()
|
||||
<$macrocall $name=".if"
|
||||
cond="""$(op-body)$"""
|
||||
then="""<tr><th align="left">$(op-head)$</th><td><<.op-place>>$(op-body)$</td></tr>"""
|
||||
else=""/>
|
||||
\end
|
||||
|
||||
<$list filter="[all[current]has[from-version]]" variable="listItem">
|
||||
<$macrocall $name=".from-version" version={{!!from-version}}/>
|
||||
</$list>
|
||||
<$let op-head="" op-body="" op-name="">
|
||||
<table class="doc-table">
|
||||
<!-- purpose -->
|
||||
<$let op-head="purpose" op-body={{!!rp-purpose}}>
|
||||
<<.op-row>>
|
||||
</$let>
|
||||
<!-- input -->
|
||||
<$let op-head="[[input|Filter Expression]]" op-body={{!!rp-input}}>
|
||||
<<.op-row>>
|
||||
</$let>
|
||||
<!-- suffix -->
|
||||
<$let op-head="suffix" op-body={{!!rp-suffix}} op-name={{!!rp-suffix-name}}>
|
||||
<<.op-row>>
|
||||
</$let>
|
||||
<!-- output -->
|
||||
<$let op-head="output" op-body={{!!rp-output}}>
|
||||
<<.op-row>>
|
||||
</$let>
|
||||
</table>
|
||||
</$let>
|
||||
|
||||
<$railroad text="""
|
||||
\start none
|
||||
\end none
|
||||
":then"
|
||||
[[run|"Filter Run"]]
|
||||
"""/>
|
||||
|
||||
!Introduction
|
||||
|
||||
The <<.op :then>> filter run prefix is used to replace the result of all previous filter runs with its output.
|
||||
|
||||
If the result of all previous runs is an empty list, the <<.op :then>> prefixed filter run is not evaluated.
|
||||
|
||||
If the output of a <<.op :then>> prefixed filter run is itself an empty list, the result of all previous filter runs is passed through unaltered.
|
||||
|
||||
<<.tip "Note that a list with a single empty string item is not an empty list.">>
|
||||
|
||||
|
||||
!! <<.op :then>> run prefix versus the <<.olink then>> operator
|
||||
|
||||
The major difference between the <<.op then>> operator and a <<.op :then>> prefixed filter run is that the operator will replace //each item// of the input [[Title List]] with its parameter while <<.op :then>> will replace the //whole input list// with the result of its run.
|
||||
|
||||
|doc-op-comparison tc-center|k
|
||||
| !<<.op :then>> Filter Run Prefix | !<<.op then>> Operator |
|
||||
|^<<.operator-example m1-1 "[tag[WikiText]] :then[[true]]">>|^<<.operator-example m1-2 "[tag[WikiText]then[true]]">><p>To make them equivalent, additional filter steps may be added:</p> <<.operator-example m1-3 "[tag[WikiText]count[]compare:number:gt[0]then[true]]">>|
|
||||
|
||||
|
||||
! [[Examples|Then Filter Run Prefix (Examples)]]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
caption: then
|
||||
created: 20190802112756430
|
||||
modified: 20230501174334627
|
||||
modified: 20190802113849579
|
||||
op-input: a [[selection of titles|Title Selection]]
|
||||
op-output: the input titles with each one replaced by the string <<.place T>>
|
||||
op-parameter: a string
|
||||
@@ -12,6 +12,4 @@ type: text/vnd.tiddlywiki
|
||||
|
||||
<<.from-version "5.1.20">> See [[Conditional Operators]] for an overview.
|
||||
|
||||
<<.tip "The [[Then Filter Run Prefix]] has a similar purpose to the <<.op then>> operator. See its documentation for a comparison of usage.">>
|
||||
|
||||
<<.operator-examples "then">>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
created: 20130822170200000
|
||||
list: [[A Gentle Guide to TiddlyWiki]] [[Discover TiddlyWiki]] [[Some of the things you can do with TiddlyWiki]] [[Ten reasons to switch to TiddlyWiki]] Examples [[What happened to the original TiddlyWiki?]]
|
||||
modified: 20230701123439630
|
||||
modified: 20230326083239710
|
||||
tags: TableOfContents
|
||||
title: HelloThere
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
created: 20160424150551727
|
||||
modified: 20230615114519672
|
||||
modified: 20211230153027382
|
||||
tags: Learning
|
||||
title: Concatenating text and variables using macro substitution
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.from-version "5.3.0">> It is recommended to use [[substituted attributes|Substituted Attribute Values]] or the [[substitute filter operator|substitute Operator]] to concatenate text and variables.
|
||||
|
||||
It's a frequent use case in ~TiddlyWiki that you will want to put the results of variables together with various bits of strings of text. This process in some programming languages is often referred to as "concatenating" text.
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@ title: Using Excise
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
! Excise text
|
||||
From the EditorToolbar you can export selected text to a new tiddler and insert a [[link|Linking in WikiText]], [[Transclusion]] or [[macro|Macros]] in its place. Click ''Excise text'' (<<.icon $:/core/images/excise>>), input name of the new tiddler, and choose excise method.
|
||||
From the EditorToolbar you can export selected text to a new tiddler and insert a [[link|Linking in WikiText]] [[Transclusion]] or [[macro|Macros]] in its place. Click ''Excise text'' (<<.icon $:/core/images/excise>>), input name of the new tiddler, and choose excise method.
|
||||
|
||||
!! How to excise text
|
||||
# Highlight the relevant piece of text
|
||||
# Click ''Excise text'' (<<.icon $:/core/images/excise>>)
|
||||
# Give the new tiddler a title.
|
||||
# Choose if the new tiddler will be tagged with the title of the current tiddler (see note below).
|
||||
# Chosse if the new tiddler will be tagged with the title of the current tiddler (see note below).
|
||||
# Choose replacing method: [[link|Linking in WikiText]], [[transclusion|Transclusion]], or [[macro|Macros]].
|
||||
# Click the ''{{$:/language/Buttons/Excise/Caption/Excise}}'' button
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 49 KiB |
@@ -1,3 +1,3 @@
|
||||
title: New Release Banner
|
||||
type: image/png
|
||||
type: image/jpeg
|
||||
tags: picture
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
created: 20140919155729620
|
||||
modified: 20230427125500432
|
||||
modified: 20220819093733569
|
||||
tags: Macros [[Core Macros]]
|
||||
title: Table-of-Contents Macros
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -53,21 +53,15 @@ These two parameters are combined into a single [[filter expression|Filter Expre
|
||||
|
||||
<<.var toc-tabbed-internal-nav>> and <<.var toc-tabbed-external-nav>> take additional parameters:
|
||||
|
||||
; selectedTiddler
|
||||
;selectedTiddler
|
||||
: The title of the [[state tiddler|StateMechanism]] for noting the currently selected tiddler, defaulting to `$:/temp/toc/selectedTiddler`. It is recommended that this be a [[system tiddler|SystemTiddlers]]
|
||||
|
||||
; unselectedText
|
||||
;unselectedText
|
||||
: The text to display when no tiddler is selected in the tree
|
||||
|
||||
; missingText
|
||||
;missingText
|
||||
: The text to display if the selected tiddler doesn't exist
|
||||
|
||||
; template
|
||||
;template
|
||||
: Optionally, the title of a tiddler to use as a [[template|TemplateTiddlers]] for transcluding the selected tiddler into the right-hand panel
|
||||
|
||||
; exclude <<.from-version "5.3.0">>
|
||||
: This optional parameter can be used to exclude tiddlers from the TOC list. It allows a [[Title List]] or a <<.olink subfilter>>. Eg: `exclude:"HelloThere [[Title with spaces]]"` or `exclude:"[has[excludeTOC]]"`. Where the former will exclude two tiddlers and the later would exclude every tiddler that has a field <<.field excludeTOC>> independent of its value.<br>''Be aware'' that eg: `[prefix[H]]` is a shortcut for `[all[tiddlers]prefix[H]]`, which can have a performance impact, if used carelessly. So use $:/AdvancedSearch -> ''Filters'' tab to test the <<.param exclude>> parameter
|
||||
|
||||
!! Custom Icons
|
||||
|
||||
<<.from-version "5.2.4">>
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
title: WidgetMessage: tm-http-request Example - Random Dog
|
||||
tags: $:/tags/Global
|
||||
|
||||
\procedure download-dog(url)
|
||||
|
||||
\procedure completion-download-dog()
|
||||
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
||||
<$action-log msg="In completion-download-dog"/>
|
||||
<$action-log/>
|
||||
<!-- Success -->
|
||||
<$list filter="[<status>compare:number:gteq[200]compare:number:lteq[299]]" variable="ignore">
|
||||
<!-- Create the dog tiddler -->
|
||||
<$action-createtiddler
|
||||
$basetitle=`$:/RandomDog/$(title)$`
|
||||
text=<<data>>
|
||||
tags="$:/tags/RandomDog"
|
||||
type={{{ [<headers>jsonget[content-type]] }}}
|
||||
credits="https://random.dog/"
|
||||
>
|
||||
<$action-log msg="Created tiddler" title=<<createTiddler-title>>/>
|
||||
</$createtiddler>
|
||||
</$list>
|
||||
\end completion-download-dog
|
||||
|
||||
<$action-sendmessage
|
||||
$message="tm-http-request"
|
||||
url=<<url>>
|
||||
method="GET"
|
||||
binary="yes"
|
||||
oncompletion=<<completion-download-dog>>
|
||||
var-title=<<url>>
|
||||
/>
|
||||
\end download-dog
|
||||
|
||||
\procedure get-random-dog()
|
||||
|
||||
\procedure completion-get-json()
|
||||
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
||||
<$action-log msg="In completion-get-json"/>
|
||||
<$action-log/>
|
||||
<!-- Success -->
|
||||
<$list filter="[<status>compare:number:gteq[200]compare:number:lteq[299]]" variable="ignore">
|
||||
<!-- Download the dog -->
|
||||
<$macrocall $name="download-dog" url={{{ [<data>jsonget[url]] }}}/>
|
||||
</$list>
|
||||
\end completion-get-json
|
||||
|
||||
<$action-sendmessage
|
||||
$message="tm-http-request"
|
||||
url="https://random.dog/woof.json"
|
||||
method="GET"
|
||||
oncompletion=<<completion-get-json>>
|
||||
/>
|
||||
\end get-random-dog
|
||||
|
||||
!! Random Dogs
|
||||
|
||||
This demo uses the API of the website https://random.dog/ to import a random dog image or video.
|
||||
|
||||
<$button actions=<<get-random-dog>>>
|
||||
Import a random dog image or video
|
||||
</$button>
|
||||
|
||||
<$list filter="[tag[$:/tags/RandomDog]limit[1]]" variable="ignore">
|
||||
|
||||
!! Imported Tiddlers
|
||||
|
||||
<$button>
|
||||
<$action-deletetiddler $filter="[tag[$:/tags/RandomDog]]"/>
|
||||
Delete all imported random dogs
|
||||
</$button>
|
||||
|
||||
Export all imported random dogs: <$macrocall $name="exportButton" exportFilter="[tag[$:/tags/RandomDog]]" lingoBase="$:/language/Buttons/ExportTiddlers/"/>
|
||||
|
||||
</$list>
|
||||
|
||||
<ol>
|
||||
<$list filter="[tag[$:/tags/RandomDog]!sort[modified]]">
|
||||
<li>
|
||||
<$link>
|
||||
<$text text=<<currentTiddler>>/>
|
||||
</$link>
|
||||
<div style="width:300px;height:300px;">
|
||||
<$transclude $tiddler=<<currentTiddler>>/>
|
||||
</div>
|
||||
</li>
|
||||
</$list>
|
||||
</ol>
|
||||
@@ -1,12 +1,12 @@
|
||||
title: WidgetMessage: tm-http-request Example - Zotero
|
||||
tags: $:/tags/Global
|
||||
tags: $:/tags/Macro
|
||||
|
||||
\procedure select-zotero-group()
|
||||
Specify the Zotero group ID to import
|
||||
<$edit-text tiddler="$:/config/zotero-group" tag="input"/> or
|
||||
<$select tiddler="$:/config/zotero-group">
|
||||
<option value="4813312">com216</option>
|
||||
<option value="4914891">steve-sunypoly</option>
|
||||
<option value="4913310">pos252</option>
|
||||
<option value="4747244">idt575</option>
|
||||
</$select>
|
||||
\end
|
||||
@@ -16,7 +16,6 @@ Specify the Zotero group ID to import
|
||||
$basetitle={{{ =[[_zotero_import ]] =[<item>jsonget[key]] =[[ ]] =[<item>jsonget[title]] +[join[]] }}}
|
||||
text={{{ [<item>jsonget[title]] }}}
|
||||
tags="$:/tags/ZoteroImport"
|
||||
zotero-group={{$:/config/zotero-group}}
|
||||
>
|
||||
<$action-setmultiplefields $tiddler=<<createTiddler-title>> $fields="[<item>jsonindexes[]addprefix[zotero-]]" $values="[<item>jsonindexes[]] :map[<item>jsonget<currentTiddler>else[.XXXXX.]]"/>
|
||||
<$list filter="[<item>jsonindexes[creators]]" variable="creatorIndex">
|
||||
@@ -34,7 +33,7 @@ Specify the Zotero group ID to import
|
||||
\procedure zotero-get-items(start:"0",limit:"25")
|
||||
|
||||
\procedure completion()
|
||||
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
||||
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
|
||||
<$action-log msg="In completion"/>
|
||||
<$action-log/>
|
||||
<!-- Success -->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
caption: tm-http-request
|
||||
created: 20230429161453032
|
||||
modified: 20230717104212742
|
||||
modified: 20230429161453032
|
||||
tags: Messages
|
||||
title: WidgetMessage: tm-http-request
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -18,7 +18,6 @@ The following parameters are used:
|
||||
|!Name |!Description |
|
||||
|method |HTTP method (eg "GET", "POST") |
|
||||
|body |String data to be sent with the request |
|
||||
|binary |<<.from-version "5.3.1">> Set to "yes" to cause the response body to be treated as binary data and returned in base64 format |
|
||||
|query-* |Query string parameters with string values |
|
||||
|header-* |Headers with string values |
|
||||
|password-header-* |Headers with values taken from the password store |
|
||||
@@ -50,4 +49,3 @@ Note that the state tiddler $:/state/http-requests contains a number representin
|
||||
!! Examples
|
||||
|
||||
* [[Zotero's|https://www.zotero.org/]] API for retrieving reference items: [[WidgetMessage: tm-http-request Example - Zotero]]
|
||||
* [[Random Dog's|https://random.dog/]] API for retrieving random pictures of dogs showing how to retrieve binary data: [[WidgetMessage: tm-http-request Example - Random Dogs]]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
created: 20220917112416666
|
||||
modified: 20230721064409436
|
||||
modified: 20230419103154329
|
||||
tags: Concepts [[WikiText Parser Modes]]
|
||||
title: Pragmas
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -8,8 +8,6 @@ A <<.def pragma>> is a special component of WikiText that provides control over
|
||||
|
||||
Pragmas occupy lines that start with `\`. They can only appear at the start of the text of a tiddler, but blank lines and comments are allowed between them. If a pragma appears in the main body of the text, it is treated as if it was ordinary text.
|
||||
|
||||
<<.from-version "5.2.6">> Pragmas can have preceding optional whitespace characters.
|
||||
|
||||
The following pragmas are available:
|
||||
|
||||
<<list-links "[tag[Pragmas]]">>
|
||||
|
||||
@@ -4,6 +4,6 @@ tags: About
|
||||
title: Releases
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
New releases of TiddlyWiki and TiddlyDesktop are announced via the [[official discussion groups|Forums]] and [[Twitter|https://twitter.com/TiddlyWiki]]
|
||||
New releases of TiddlyWiki and TiddlyDesktop are announced via the [[official discussion groups|Forums]] and [[Twitter|https://twitter.com/TiddlyWiki]] (you can also subscribe to an Atom/RSS feed of [[TiddlyWiki releases from GitHub|https://github.com/jermolene/tiddlywiki5/releases.atom]])
|
||||
|
||||
<<tabs "[[TiddlyWiki Releases]] [[TiddlyDesktop Releases]]" "TiddlyWiki Releases" "$:/state/tab">>
|
||||
|
||||
@@ -5,7 +5,7 @@ tags: Releases
|
||||
title: TiddlyWiki Releases
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
Here are the details of recent releases of TiddlyWiki5. See [[TiddlyWiki5 Versioning]] for details of how releases are named.
|
||||
Here are the details of recent releases of TiddlyWiki5. See [[TiddlyWiki5 Versioning]] for details of how releases are named. Note that archived versions of release source files are available at https://github.com/Jermolene/TiddlyWiki5/releases
|
||||
|
||||
If you are using node.js, you can also install prior versions like this:
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
caption: tw5server
|
||||
caption: tw5-server
|
||||
color: #70c9a0
|
||||
community-author: hffqyd
|
||||
created: 20230302011710789
|
||||
@@ -10,23 +10,27 @@ tags: Android Chrome Firefox [[Internet Explorer]] Linux Mac Opera Safari Saving
|
||||
title: Saving via a Minimal Web Server
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
A local mini binary server for TiddlyWiki5 that saves and backups wikis and uploads files for TiddlyWiki, inspired by
|
||||
A local server for TiddlyWiki5 that saves and backups wikis, inspired by
|
||||
[[tw5-server.rb | https://gist.github.com/jimfoltz/ee791c1bdd30ce137bc23cce826096da]].
|
||||
|
||||
tw5server provides features of:
|
||||
tw5-server provides features of:
|
||||
|
||||
* Server for TiddlyWiki5, as well as other files (e.g. images used in TW5 `[img[images/*.png]]`);
|
||||
* Easy to save wiki via browsers;
|
||||
* Backup wiki in compress format (.gz), to save disk space;
|
||||
* Auto clean backups: keep one newest per previous month, keep all backups in current month.
|
||||
* Upload files/images to server via pressing button or drag-and-drop, for use in tiddlywiki as external links.
|
||||
* Offer binary executable for Linux, macos, Android and windows.
|
||||
* Upload files/images to server, for use in tiddlywiki as external links.
|
||||
* Offer binary executable for Linux, macos and windows.
|
||||
|
||||
Download executable binary at the github.com [[tw5-server|https://github.com/hffqyd/tw5-server]].
|
||||
Download executable script and binary at the github.com [[tw5-server|https://github.com/hffqyd/tw5-server]].
|
||||
|
||||
! Usage
|
||||
|
||||
```bash
|
||||
# python script:
|
||||
python tw5-server.py -p 8000 -d ./ -b backup_dir
|
||||
|
||||
# binary file:
|
||||
tw5server -a:192.168.0.10 -p:8000 -d:./ -b:backup
|
||||
|
||||
-h usage help
|
||||
@@ -40,7 +44,6 @@ Backups auto-clean strategy:
|
||||
Keep all backups in current month, keep only the newest one for previous months.
|
||||
```
|
||||
|
||||
In Unix/Linux, maybe first `chmod +x tw5server`), then run it.
|
||||
For Android version, run it in Termux, or some other terminals.
|
||||
In Unix/Linux, just excute `./tw5-server.py` (with `chmod +x tw5-server.py`).
|
||||
|
||||
Then go to http://localhost:8000 (or other address:port specified in command) in your web browser, and click on your wiki html file.
|
||||
|
||||
@@ -285,14 +285,6 @@ ol.doc-github-contributors li {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.doc-op-comparison {
|
||||
table-layout: fixed;
|
||||
width: 80%;
|
||||
}
|
||||
.doc-op-comparison th .doc-operator {
|
||||
background-color: unset;
|
||||
color: #666;
|
||||
}
|
||||
.doc-tabs.tc-tab-buttons button {
|
||||
font-size: 1rem;
|
||||
padding: 0.5em;
|
||||
@@ -303,4 +295,4 @@ ol.doc-github-contributors li {
|
||||
}
|
||||
.doc-tab-link .doc-attr {
|
||||
color: unset;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,17 @@
|
||||
created: 20150117152607000
|
||||
modified: 20230617183916622
|
||||
modified: 20220227210111054
|
||||
tags: $:/tags/Macro
|
||||
title: $:/editions/tw5.com/operator-macros
|
||||
|
||||
\define .operator-examples(op,text:"Examples") <$link to="$op$ Operator (Examples)">$text$</$link>
|
||||
|
||||
\procedure .operator-example-tryit-actions() <$action-setfield $tiddler=<<.state>> text="show" filter=<<eg>>/>
|
||||
\procedure .operator-example(n,eg,ie)
|
||||
\define .operator-example-tryit-actions() <$action-setfield $tiddler=<<.state>> text="show" filter=<<__eg__>>/>
|
||||
\define .operator-example(n,eg,ie)
|
||||
<div class="doc-example">
|
||||
<$list filter="[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix<n>]" variable=".state">
|
||||
<$list filter="[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix[$n$]]" variable=".state">
|
||||
<$reveal state=<<.state>> type="nomatch" text="show">
|
||||
<code><$text text=<<eg>>/></code>
|
||||
<$macrocall $name=".if" cond=<<ie>> then={{{[[<dd>→ ]addsuffix<ie>addsuffix[</dd>]]}}}/>
|
||||
`$eg$`
|
||||
<$macrocall $name=".if" cond="""$ie$""" then="""<dd>→ $ie$</dd>"""/>
|
||||
<dl>
|
||||
<dd><$button actions=<<.operator-example-tryit-actions>>>Try it</$button></dd>
|
||||
</dl>
|
||||
@@ -21,7 +21,7 @@ title: $:/editions/tw5.com/operator-macros
|
||||
<dl>
|
||||
<dd>
|
||||
<$button set=<<.state>> setTo="">Hide</$button>
|
||||
<$reveal stateTitle=<<.state>> stateField="filter" type="nomatch" text=<<eg>>>
|
||||
<$reveal stateTitle=<<.state>> stateField="filter" type="nomatch" text=<<__eg__>>>
|
||||
<$button actions=<<.operator-example-tryit-actions>>>Reset</$button>
|
||||
</$reveal>
|
||||
</dd>
|
||||
|
||||
@@ -151,4 +151,4 @@ Below is an example macro, procedure and function definition. All three forms o
|
||||
*''variables'' - \define, <<.wlink SetWidget>>, <<.wlink LetWidget>>, <<.wlink VarsWidget>>, \procedure, \widget, \function all create variables. If the same name is used, then later define will overwrite earlier defined
|
||||
*''<<.op function>> filter operator parameter'' - only variables defined using \function can be called using the <<.olink function>> operator
|
||||
*''filter operators'' - only the [[javascript defined filter operators|Filter Operators]] and variables defined using \function with name containing a dot can be called
|
||||
*''widgets'' - variables defined using \widget can be invoked using `<$widget/>` syntax ONLY if the name starts a dollar sign. Without the dollar sign prefix, defining variables using \widget is no different than using \procedure.
|
||||
*''widgets'' - variables defined using \widget can be invoked using `<$widget/>` syntax ONLY if the name starts a dollar sign (to override existing javascript defined widgets) or double dollar sign (to define [[custom widgets|Custom Widgets]]). Without the dollar sign prefix, defining variables using \widget is no different than using \procedure.
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
created: 20230617085524754
|
||||
modified: 20230617085524754
|
||||
title: tv-config-static Variable
|
||||
tags: Variables [[Core Variables]] [[Configuration Variables]]
|
||||
type: text/vnd.tiddlywiki
|
||||
caption: tv-config-static
|
||||
|
||||
<<.from-version "5.3.0">> The <<.def tv-config-static>> [[variable|Variables]] is set to `yes` within static rendering templates, and is unset in other contexts.
|
||||
|
||||
It is useful for selectively hiding or showing content depending on whether a rendering is static or interactive.
|
||||
@@ -41,7 +41,7 @@ The content of the `<$select>` widget should be one or more HTML `<option>` or `
|
||||
|size |The number of rows to display in multiple selection mode |
|
||||
|actions |A string containing ActionWidgets to be triggered when the key combination is detected |
|
||||
|focus |<<.from-version "5.2.4">> Optional. Set to "yes" to automatically focus the HTML select element after creation |
|
||||
|tabindex |<<.from-version "5.3.1">> Optional. Sets the `tabindex` attribute of the HTML select element to the given value |
|
||||
|
||||
! Examples
|
||||
|
||||
!! Simple Lists
|
||||
|
||||
@@ -46,7 +46,7 @@ That's it.
|
||||
<a id="#Bottom_of_tiddler"></a>
|
||||
```
|
||||
|
||||
*Add an <<.attr id>> attribute to any HTML5 tag and place a single `#` before the 'address' value. <a href=<<qualify "##Suggestions-for-elements">>>Here are some suggestions of tags you can use.</a>
|
||||
*Add an <<.attr id>> attribute to any HTML5 tag and place a single `#` before the 'address' value. <a href="##Suggestions%0">Here are some suggestions of tags you can use.</a>
|
||||
* Place this code at the target location. E.g. at the bottom of the tiddler.
|
||||
|
||||
''Step 2: Create a link to the target anchor''
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
created: 20230615045132842
|
||||
modified: 20230615045231048
|
||||
tags: WikiText [[Widget Attributes]]
|
||||
title: Filtered Attribute Values
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
Filtered attribute values are indicated with triple curly braces around a [[Filter Expression]]. The value will be the first item in the resulting list, or the empty string if the list is empty.
|
||||
|
||||
<<.from-version "5.2.2">> To improve readability, newlines can be included anywhere that whitespace is allowed within filtered attributes.
|
||||
|
||||
This example shows how to add a prefix to a value:
|
||||
|
||||
```
|
||||
<$text text={{{ [<currentTiddler>addprefix[$:/myprefix/]] }}} />
|
||||
```
|
||||
<<.warning "The value of the attribute will be the exact text from the first item in the resulting list. Any wiki syntax in that text will be left as-is.">>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user