Merge branch 'Jermolene:master' into MenuBar-plugin-PR20230713

This commit is contained in:
tw-FRed 2023-07-23 11:41:21 +00:00 committed by GitHub
commit 3e14c5a071
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
53 changed files with 435 additions and 109 deletions

View File

@ -596,11 +596,11 @@ $tw.utils.evalGlobal = function(code,context,filename,sandbox,allowGlobals) {
// Add the code prologue and epilogue
code = [
"(function(" + contextNames.join(",") + ") {",
" (function(){\n" + code + "\n;})();",
" (function(){" + code + "\n;})();\n",
(!$tw.browser && sandbox && !allowGlobals) ? globalCheck : "",
" return exports;\n",
"\nreturn exports;\n",
"})"
].join("\n");
].join("");
// 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);
shadowTiddlerTitles = Object.keys(shadowTiddlers).sort(function(a,b) {return a.localeCompare(b);});
}
return shadowTiddlerTitles;
},

View File

@ -1,6 +1,4 @@
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>

View File

@ -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\\\\end[^\\S\\n\\r]*(?:" + $tw.utils.escapeRegExp(this.match[2]) + ")?(?:$|\\r?\\n))","mg");
reEnd = new RegExp("(\\r?\\n[^\\S\\n\\r]*\\\\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;

View File

@ -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;
};
/*

View File

@ -38,6 +38,7 @@ 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"],

View File

@ -27,6 +27,11 @@ 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 = {};

View File

@ -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,7 +106,9 @@ 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));
} else {
}
// If browser is Chrome-like and has a touch-input device do NOT .setData
if(!($tw.browser.isMobileChrome)) {
dataTransfer.setData("URL","data:text/vnd.tiddler," + encodeURIComponent(jsonData));
}
dataTransfer.setData("Text",titleString);

View File

@ -90,6 +90,7 @@ 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
@ -110,6 +111,7 @@ function HttpClientRequest(options) {
this.bindProgress = options["bindProgress"];
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) {
@ -156,6 +158,8 @@ 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",
@ -175,6 +179,16 @@ 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,
}));
@ -212,6 +226,7 @@ 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",
@ -264,6 +279,7 @@ exports.httpRequest = function(options) {
}
}
}
request.responseType = options.responseType || "text";
// Set up the state change handler
request.onreadystatechange = function() {
if(this.readyState === 4) {

View File

@ -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});
var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true, configTrimWhiteSpace:true});
if(parser) {
var parseTreeNode = parser.tree[0];
while(parseTreeNode && ["setvariable","set","parameters"].indexOf(parseTreeNode.type) !== -1) {

View File

@ -41,16 +41,19 @@ TranscludeWidget.prototype.execute = function() {
this.collectAttributes();
this.collectStringParameters();
this.collectSlotFillParameters();
// Get the parse tree nodes that we are transcluding
// Get the target text and parse tree nodes that we are transcluding
var target = this.getTransclusionTarget(),
parseTreeNodes = target.parseTreeNodes;
parseTreeNodes;
this.sourceText = target.text;
this.parserType = target.type;
this.parseAsInline = target.parseAsInline;
// Set 'thisTiddler'
this.setVariable("thisTiddler",this.transcludeTitle);
// Process the transclusion according to the output type
switch(this.transcludeOutput || "text/html") {
case "text/html":
// No further processing required
// Return the parse tree nodes
parseTreeNodes = target.parseTreeNodes;
break;
case "text/raw":
// Just return the raw text
@ -158,7 +161,7 @@ TranscludeWidget.prototype.collectSlotFillParameters = function() {
};
/*
Get transcluded parse tree nodes as an object {parser:,text:,type:}
Get transcluded parse tree nodes as an object {text:,type:,parseTreeNodes:,parseAsInline:}
*/
TranscludeWidget.prototype.getTransclusionTarget = function() {
var self = this;
@ -265,12 +268,9 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
defaultType: this.transcludeType
});
}
// Set 'thisTiddler'
this.setVariable("thisTiddler",this.transcludeTitle);
// Return the parse tree
if(parser) {
return {
parser: parser,
parseTreeNodes: parser.tree,
parseAsInline: parseAsInline,
text: parser.source,
@ -279,7 +279,6 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
} 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,

View File

@ -719,46 +719,23 @@ Widget.prototype.findFirstDomNode = function() {
};
/*
Entry into destroy procedure
*/
Widget.prototype.destroyChildren = function() {
$tw.utils.each(this.children,function(childWidget) {
childWidget.destroy();
});
};
/*
Legacy entry into destroy procedure
Remove any DOM nodes created by this widget or its children
*/
Widget.prototype.removeChildDomNodes = function() {
this.destroy();
};
/*
Default destroy
*/
Widget.prototype.destroy = function() {
// call children to remove their resources
this.destroyChildren();
// remove our resources
this.children = [];
this.removeLocalDomNodes();
};
/*
Remove any DOM nodes created by this widget
*/
Widget.prototype.removeLocalDomNodes = function() {
// If this widget has directly created DOM nodes, delete them and exit.
// If this widget has directly created DOM nodes, delete them and exit. This assumes that any child widgets are contained within the created DOM nodes, which would normally be the case
if(this.domNodes.length > 0) {
$tw.utils.each(this.domNodes,function(domNode) {
if(domNode.parentNode) {
domNode.parentNode.removeChild(domNode);
}
domNode.parentNode.removeChild(domNode);
});
this.domNodes = [];
} else {
// Otherwise, ask the child widgets to delete their DOM nodes
$tw.utils.each(this.children,function(childWidget) {
childWidget.removeChildDomNodes();
});
}
};
/*
Invoke the action widgets that are descendents of the current widget.
*/

View File

@ -1086,7 +1086,7 @@ exports.getSubstitutedText = function(text,widget,options) {
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(/\$\((\w+)\)\$/g, function(match,varname) {
return output.replace(/\$\(([^\)\$]+)\)\$/g, function(match,varname) {
return widget.getVariable(varname,{defaultValue: ""})
});
};

View File

@ -1,3 +1,4 @@
code-body: yes
title: $:/core/ui/AlertTemplate
\whitespace trim

View File

@ -1,3 +1,4 @@
code-body: yes
title: $:/core/ui/EditTemplate
\define delete-edittemplate-state-tiddlers()

View File

@ -1,5 +1,6 @@
title: $:/core/ui/ImportPreviews/Text
tags: $:/tags/ImportPreview
caption: {{$:/language/Import/Listing/Preview/Text}}
code-body: yes
<$transclude tiddler=<<currentTiddler>> subtiddler=<<payloadTiddler>> mode="block"/>

View File

@ -1,4 +1,5 @@
title: $:/core/ui/PageStylesheet
code-body: yes
\import [subfilter{$:/core/config/GlobalImportFilter}]
\whitespace trim

View File

@ -2,6 +2,7 @@ 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}]

View File

@ -1,4 +1,5 @@
title: $:/core/ui/RootTemplate
code-body: yes
<$transclude tiddler={{{ [{$:/layout}has[text]] ~[[$:/core/ui/PageTemplate]] }}} mode="inline"/>

View File

@ -1,3 +1,4 @@
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]] }}} />

View File

@ -1,4 +1,5 @@
title: $:/core/ui/ViewTemplate
code-body: yes
\whitespace trim
\define folded-state()

View File

@ -1,4 +1,5 @@
title: $:/core/ui/ViewTemplate/body/default
code-body: yes
<$transclude>

View File

@ -2,7 +2,8 @@ title: $:/config/ViewTemplateBodyFilters/
tags: $:/tags/ViewTemplateBodyFilter
stylesheet: [tag[$:/tags/Stylesheet]then[$:/core/ui/ViewTemplate/body/rendered-plain-text]]
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]]
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]]
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]]

View File

@ -7,7 +7,7 @@ tags: $:/tags/Macro
\define toc-caption()
\whitespace trim
<span class="tc-toc-caption">
<span class="tc-toc-caption tc-tiny-gap-left">
<$set name="tv-wikilinks" value="no">
<$transclude field="caption">
<$view field="title"/>
@ -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> <$view field='caption'><$view field='title'/></$view>">
<$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>""">
<$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>> />

View File

@ -1,3 +1,2 @@
title: $:/tags/ViewTemplateBodyFilter
list: $:/config/ViewTemplateBodyFilters/hide-body $:/config/ViewTemplateBodyFilters/code-body $:/config/ViewTemplateBodyFilters/stylesheet $:/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/core-ui-advanced-search $:/config/ViewTemplateBodyFilters/core-ui-tags $:/config/ViewTemplateBodyFilters/system $:/config/ViewTemplateBodyFilters/import $:/config/ViewTemplateBodyFilters/plugin $:/config/ViewTemplateBodyFilters/default

View File

@ -1,6 +1,6 @@
caption: 5.3.1
created: 20230701133439630
modified: 20230701133439630
created: 20230720215100983
modified: 20230720215100983
tags: ReleaseNotes
title: Release 5.3.1
type: text/vnd.tiddlywiki
@ -9,6 +9,9 @@ type: text/vnd.tiddlywiki
! 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
@ -27,7 +30,7 @@ Improvements to the following translations:
! Widget Improvements
*
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7594">> ''tabindex'' attribute to SelectWidget
! Filter improvements
@ -35,23 +38,41 @@ Improvements to the following translations:
! 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
*
! Performance 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
""">>

View File

@ -0,0 +1,24 @@
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>

View File

@ -0,0 +1,23 @@
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>

View File

@ -0,0 +1,22 @@
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>

View File

@ -0,0 +1,29 @@
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>

View File

@ -0,0 +1,20 @@
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>

View File

@ -0,0 +1,22 @@
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>

View File

@ -0,0 +1,33 @@
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>

View File

@ -0,0 +1,20 @@
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>

View File

@ -6,14 +6,16 @@ tags: [[$:/tags/wiki-test-spec]]
title: Output
\whitespace trim
<$let project="TiddlyWiki" disabled="true">
<$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)$```>
${ [[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" disabled="true" otherattrib="" quoted="here"></div></p>
HelloThere" dashes="dashes" disabled="true" otherattrib="" quoted="here" spaces="spaces"></div></p>

View File

@ -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,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[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[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,TiddlerSeventh,Tiddler8");
expect(wiki.filterTiddlers("[[one]tagging[]]").join(",")).toBe("Tiddler Three,TiddlerOne,Tiddler8,TiddlerSeventh");
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,TiddlerSeventh,Tiddler8");
expect(wiki.filterTiddlers("[all[current]tagging[]]",fakeWidget).join(",")).toBe("Tiddler Three,TiddlerOne,Tiddler8,TiddlerSeventh");
});
it("should handle the untagged operator", function() {

View File

@ -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.

View File

@ -1,6 +1,8 @@
caption: Fourth-Caption
created: 20150221194405000
modified: 20211114013601188
tags: Contents [[Table-of-Contents Demonstrations]]
title: Fourth
type: text/vnd.tiddlywiki
<<.toc-lorem>>

View File

@ -2,5 +2,15 @@ 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>>

View File

@ -1,7 +1,9 @@
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>>

View File

@ -18,9 +18,9 @@ The <<.op substitute>> operator replaces any placeholders in the input titles in
# 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 with the first result of evaluating the filter expression. |
|`$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""">>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -0,0 +1,88 @@
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>

View File

@ -1,12 +1,12 @@
title: WidgetMessage: tm-http-request Example - Zotero
tags: $:/tags/Macro
tags: $:/tags/Global
\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="4913310">pos252</option>
<option value="4914891">steve-sunypoly</option>
<option value="4747244">idt575</option>
</$select>
\end
@ -16,6 +16,7 @@ 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">
@ -33,7 +34,7 @@ Specify the Zotero group ID to import
\procedure zotero-get-items(start:"0",limit:"25")
\procedure completion()
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
\import [subfilter{$:/core/config/GlobalImportFilter}]
<$action-log msg="In completion"/>
<$action-log/>
<!-- Success -->

View File

@ -1,6 +1,6 @@
caption: tm-http-request
created: 20230429161453032
modified: 20230429161453032
modified: 20230717104212742
tags: Messages
title: WidgetMessage: tm-http-request
type: text/vnd.tiddlywiki
@ -18,6 +18,7 @@ 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 |
@ -49,3 +50,4 @@ 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]]

View File

@ -1,5 +1,5 @@
created: 20220917112416666
modified: 20230419103154329
modified: 20230721064409436
tags: Concepts [[WikiText Parser Modes]]
title: Pragmas
type: text/vnd.tiddlywiki
@ -8,6 +8,8 @@ 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]]">>

View File

@ -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]] (you can also subscribe to an Atom/RSS feed of [[TiddlyWiki releases from GitHub|https://github.com/jermolene/tiddlywiki5/releases.atom]])
New releases of TiddlyWiki and TiddlyDesktop are announced via the [[official discussion groups|Forums]] and [[Twitter|https://twitter.com/TiddlyWiki]]
<<tabs "[[TiddlyWiki Releases]] [[TiddlyDesktop Releases]]" "TiddlyWiki Releases" "$:/state/tab">>

View File

@ -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. Note that archived versions of release source files are available at https://github.com/Jermolene/TiddlyWiki5/releases
Here are the details of recent releases of TiddlyWiki5. See [[TiddlyWiki5 Versioning]] for details of how releases are named.
If you are using node.js, you can also install prior versions like this:

View File

@ -1,4 +1,4 @@
caption: tw5-server
caption: tw5server
color: #70c9a0
community-author: hffqyd
created: 20230302011710789
@ -10,27 +10,23 @@ tags: Android Chrome Firefox [[Internet Explorer]] Linux Mac Opera Safari Saving
title: Saving via a Minimal Web Server
type: text/vnd.tiddlywiki
A local server for TiddlyWiki5 that saves and backups wikis, inspired by
A local mini binary server for TiddlyWiki5 that saves and backups wikis and uploads files for TiddlyWiki, inspired by
[[tw5-server.rb | https://gist.github.com/jimfoltz/ee791c1bdd30ce137bc23cce826096da]].
tw5-server provides features of:
tw5server provides features of:
* Server for TiddlyWiki5, as well as other files (e.g. images used in TW5 `[img[images/*.png]]`);
* Easy to save wiki via browsers;
* Backup wiki in compress format (.gz), to save disk space;
* Auto clean backups: keep one newest per previous month, keep all backups in current month.
* Upload files/images to server, for use in tiddlywiki as external links.
* Offer binary executable for Linux, macos and windows.
* 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.
Download executable script and binary at the github.com [[tw5-server|https://github.com/hffqyd/tw5-server]].
Download executable 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
@ -44,6 +40,7 @@ Backups auto-clean strategy:
Keep all backups in current month, keep only the newest one for previous months.
```
In Unix/Linux, just excute `./tw5-server.py` (with `chmod +x tw5-server.py`).
In Unix/Linux, maybe first `chmod +x tw5server`), then run it.
For Android version, run it in Termux, or some other terminals.
Then go to http://localhost:8000 (or other address:port specified in command) in your web browser, and click on your wiki html file.

View File

@ -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="##Suggestions%0">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=<<qualify "##Suggestions-for-elements">>>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''

View File

@ -8,7 +8,7 @@ Attributes of HTML elements and widgets can be specified in several different wa
* [[a literal string|Literal Attribute Values]]
* [[a transclusion of a textReference|Transcluded Attribute Values]]
* [[a transclusion of a macro/variable|Transcluded Attribute Values]]
* [[a transclusion of a macro/variable|Variable Attribute Values]]
* [[as the result of a filter expression|Filtered Attribute Values]]
* <<.from-version "5.3.0">> [[as the result of performing filter and variable substitutions on the given string|Substituted Attribute Values]]

View File

@ -3,7 +3,7 @@ title: $:/plugins/tiddlywiki/googleanalytics/googleanalytics.js
type: application/javascript
module-type: startup
Runs Google Analytics with the account number in the tiddler `$:/GoogleAnalyticsAccount` and the domain name in `$:/GoogleAnalyticsDomain`
Runs Google Analytics with the measurement ID in the tiddler `$:/GoogleAnalyticsMeasurementID`
\*/
(function(){

View File

@ -1,6 +1,4 @@
title: $:/plugins/tiddlywiki/googleanalytics/settings
You have only two value to set, only the first is mandatory:
# ''[[Google Analytics Measurement ID|$:/GoogleAnalyticsMeasurementID]]'': (mandatory) a code of the form `G-XXXXXXXXXX` where X are digits or uppercase letters<br/><$edit-text tiddler="$:/GoogleAnalyticsMeasurementID" default="" tag="input"/>
''[[Google Analytics Measurement ID|$:/GoogleAnalyticsMeasurementID]]'': (mandatory) a code of the form `G-XXXXXXXXXX` where X are digits or uppercase letters<br/><$edit-text tiddler="$:/GoogleAnalyticsMeasurementID" default="" tag="input"/>

View File

@ -580,7 +580,7 @@ button svg, button img, label svg, label img {
}
button:disabled.tc-btn-invisible {
cursor: default;
cursor: default;
color: <<colour muted-foreground>>;
}
@ -1172,6 +1172,11 @@ button.tc-btn-invisible.tc-remove-tag-button {
margin-right: .1em;
}
.tc-tiddler-title-icon svg {
width: 0.9em;
height: 0.9em;
}
.tc-system-title-prefix {
color: <<colour muted-foreground>>;
}
@ -2774,15 +2779,11 @@ input.tc-palette-manager-colour-input {
white-space: nowrap;
}
.tc-table-of-contents button {
.tc-table-of-contents button,
.tc-table-of-contents .toc-item-muted {
color: <<colour sidebar-foreground>>;
}
button + .tc-toc-caption,
button > .tc-toc-caption{
margin-left: .25em;
}
.tc-table-of-contents svg {
width: 0.7em;
height: 0.7em;