1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-30 13:29:56 +00:00

Merge branch 'master' into multi-wiki-support

This commit is contained in:
Jeremy Ruston 2024-06-22 16:56:46 +01:00
commit 38e1ea8f90
146 changed files with 924 additions and 770 deletions

View File

@ -65,6 +65,10 @@ sidebar-tab-foreground-selected: Sidebar tab foreground for selected tabs
sidebar-tab-foreground: Sidebar tab foreground sidebar-tab-foreground: Sidebar tab foreground
sidebar-tiddler-link-foreground-hover: Sidebar tiddler link foreground hover sidebar-tiddler-link-foreground-hover: Sidebar tiddler link foreground hover
sidebar-tiddler-link-foreground: Sidebar tiddler link foreground sidebar-tiddler-link-foreground: Sidebar tiddler link foreground
stability-stable: Badge for stability level "stable"
stability-experimental: Badge for stability level "experimental"
stability-deprecated: Badge for stability level "deprecated"
stability-legacy: Badge for stability level "legacy"
testcase-accent-level-1: Test case accent colour with no nesting testcase-accent-level-1: Test case accent colour with no nesting
testcase-accent-level-2: Test case accent colour with 2nd level nesting testcase-accent-level-2: Test case accent colour with 2nd level nesting
testcase-accent-level-3: Test case accent colour with 3rd level nesting or higher testcase-accent-level-3: Test case accent colour with 3rd level nesting or higher

View File

@ -16,11 +16,11 @@ Filter operator for returning all the backtranscludes from a tiddler
Export our filter function Export our filter function
*/ */
exports.backtranscludes = function(source,operator,options) { exports.backtranscludes = function(source,operator,options) {
var results = []; var results = new $tw.utils.LinkedList();
source(function(tiddler,title) { source(function(tiddler,title) {
$tw.utils.pushTop(results,options.wiki.getTiddlerBacktranscludes(title)); results.pushTop(options.wiki.getTiddlerBacktranscludes(title));
}); });
return results; return results.makeTiddlerIterator(options.wiki);
}; };
})(); })();

View File

@ -217,7 +217,10 @@ exports.splitregexp = function(source,operator,options) {
return ["RegExp error: " + ex]; return ["RegExp error: " + ex];
} }
source(function(tiddler,title) { source(function(tiddler,title) {
Array.prototype.push.apply(result,title.split(regExp)); var parts = title.split(regExp).map(function(part){
return part || ""; // make sure it's a string
});
Array.prototype.push.apply(result,parts);
}); });
return result; return result;
}; };

View File

@ -20,7 +20,7 @@ exports.transcludes = function(source,operator,options) {
source(function(tiddler,title) { source(function(tiddler,title) {
results.pushTop(options.wiki.getTiddlerTranscludes(title)); results.pushTop(options.wiki.getTiddlerTranscludes(title));
}); });
return results.toArray(); return results.makeTiddlerIterator(options.wiki);
}; };
})(); })();

View File

@ -75,7 +75,7 @@ BackSubIndexer.prototype._getTarget = function(tiddler) {
} }
var parser = this.wiki.parseText(tiddler.fields.type, tiddler.fields.text, {}); var parser = this.wiki.parseText(tiddler.fields.type, tiddler.fields.text, {});
if(parser) { if(parser) {
return this.wiki[this.extractor](parser.tree); return this.wiki[this.extractor](parser.tree, tiddler.fields.title);
} }
return []; return [];
} }

View File

@ -29,13 +29,16 @@ exports.init = function(parser) {
exports.parse = function() { exports.parse = function() {
var reEnd = /(\r?\n```$)/mg; var reEnd = /(\r?\n```$)/mg;
var languageStart = this.parser.pos + 3,
languageEnd = languageStart + this.match[1].length;
// Move past the match // Move past the match
this.parser.pos = this.matchRegExp.lastIndex; this.parser.pos = this.matchRegExp.lastIndex;
// Look for the end of the block // Look for the end of the block
reEnd.lastIndex = this.parser.pos; reEnd.lastIndex = this.parser.pos;
var match = reEnd.exec(this.parser.source), var match = reEnd.exec(this.parser.source),
text; text,
codeStart = this.parser.pos;
// Process the block // Process the block
if(match) { if(match) {
text = this.parser.source.substring(this.parser.pos,match.index); text = this.parser.source.substring(this.parser.pos,match.index);
@ -48,8 +51,8 @@ exports.parse = function() {
return [{ return [{
type: "codeblock", type: "codeblock",
attributes: { attributes: {
code: {type: "string", value: text}, code: {type: "string", value: text, start: codeStart, end: this.parser.pos},
language: {type: "string", value: this.match[1]} language: {type: "string", value: this.match[1], start: languageStart, end: languageEnd}
} }
}]; }];
}; };

View File

@ -33,7 +33,8 @@ exports.parse = function() {
// Look for the end marker // Look for the end marker
reEnd.lastIndex = this.parser.pos; reEnd.lastIndex = this.parser.pos;
var match = reEnd.exec(this.parser.source), var match = reEnd.exec(this.parser.source),
text; text,
start = this.parser.pos;
// Process the text // Process the text
if(match) { if(match) {
text = this.parser.source.substring(this.parser.pos,match.index); text = this.parser.source.substring(this.parser.pos,match.index);
@ -47,7 +48,9 @@ exports.parse = function() {
tag: "code", tag: "code",
children: [{ children: [{
type: "text", type: "text",
text: text text: text,
start: start,
end: this.parser.pos
}] }]
}]; }];
}; };

View File

@ -31,6 +31,7 @@ exports.init = function(parser) {
exports.parse = function() { exports.parse = function() {
// Move past the match // Move past the match
var start = this.parser.pos;
this.parser.pos = this.matchRegExp.lastIndex; this.parser.pos = this.matchRegExp.lastIndex;
// Create the link unless it is suppressed // Create the link unless it is suppressed
if(this.match[0].substr(0,1) === "~") { if(this.match[0].substr(0,1) === "~") {
@ -46,7 +47,7 @@ exports.parse = function() {
rel: {type: "string", value: "noopener noreferrer"} rel: {type: "string", value: "noopener noreferrer"}
}, },
children: [{ children: [{
type: "text", text: this.match[0] type: "text", text: this.match[0], start: start, end: this.parser.pos
}] }]
}]; }];
} }

View File

@ -31,6 +31,16 @@ exports.init = function(parser) {
exports.parse = function() { exports.parse = function() {
// Move past the match // Move past the match
var filterStart = this.parser.pos + 3;
var filterEnd = filterStart + this.match[1].length;
var toolTipStart = filterEnd + 1;
var toolTipEnd = toolTipStart + (this.match[2] ? this.match[2].length : 0);
var templateStart = toolTipEnd + 2;
var templateEnd = templateStart + (this.match[3] ? this.match[3].length : 0);
var styleStart = templateEnd + 2;
var styleEnd = styleStart + (this.match[4] ? this.match[4].length : 0);
var classesStart = styleEnd + 1;
var classesEnd = classesStart + (this.match[5] ? this.match[5].length : 0);
this.parser.pos = this.matchRegExp.lastIndex; this.parser.pos = this.matchRegExp.lastIndex;
// Get the match details // Get the match details
var filter = this.match[1], var filter = this.match[1],
@ -42,21 +52,21 @@ exports.parse = function() {
var node = { var node = {
type: "list", type: "list",
attributes: { attributes: {
filter: {type: "string", value: filter} filter: {type: "string", value: filter, start: filterStart, end: filterEnd},
}, },
isBlock: true isBlock: true
}; };
if(tooltip) { if(tooltip) {
node.attributes.tooltip = {type: "string", value: tooltip}; node.attributes.tooltip = {type: "string", value: tooltip, start: toolTipStart, end: toolTipEnd};
} }
if(template) { if(template) {
node.attributes.template = {type: "string", value: template}; node.attributes.template = {type: "string", value: template, start: templateStart, end: templateEnd};
} }
if(style) { if(style) {
node.attributes.style = {type: "string", value: style}; node.attributes.style = {type: "string", value: style, start: styleStart, end: styleEnd};
} }
if(classes) { if(classes) {
node.attributes.itemClass = {type: "string", value: classes.split(".").join(" ")}; node.attributes.itemClass = {type: "string", value: classes.split(".").join(" "), start: classesStart, end: classesEnd};
} }
return [node]; return [node];
}; };

View File

@ -30,6 +30,16 @@ exports.init = function(parser) {
}; };
exports.parse = function() { exports.parse = function() {
var filterStart = this.parser.pos + 3;
var filterEnd = filterStart + this.match[1].length;
var toolTipStart = filterEnd + 1;
var toolTipEnd = toolTipStart + (this.match[2] ? this.match[2].length : 0);
var templateStart = toolTipEnd + 2;
var templateEnd = templateStart + (this.match[3] ? this.match[3].length : 0);
var styleStart = templateEnd + 2;
var styleEnd = styleStart + (this.match[4] ? this.match[4].length : 0);
var classesStart = styleEnd + 1;
var classesEnd = classesStart + (this.match[5] ? this.match[5].length : 0);
// Move past the match // Move past the match
this.parser.pos = this.matchRegExp.lastIndex; this.parser.pos = this.matchRegExp.lastIndex;
// Get the match details // Get the match details
@ -42,20 +52,20 @@ exports.parse = function() {
var node = { var node = {
type: "list", type: "list",
attributes: { attributes: {
filter: {type: "string", value: filter} filter: {type: "string", value: filter, start: filterStart, end: filterEnd},
} }
}; };
if(tooltip) { if(tooltip) {
node.attributes.tooltip = {type: "string", value: tooltip}; node.attributes.tooltip = {type: "string", value: tooltip, start: toolTipStart, end: toolTipEnd};
} }
if(template) { if(template) {
node.attributes.template = {type: "string", value: template}; node.attributes.template = {type: "string", value: template, start: templateStart, end: templateEnd};
} }
if(style) { if(style) {
node.attributes.style = {type: "string", value: style}; node.attributes.style = {type: "string", value: style, start: styleStart, end: styleEnd};
} }
if(classes) { if(classes) {
node.attributes.itemClass = {type: "string", value: classes.split(".").join(" ")}; node.attributes.itemClass = {type: "string", value: classes.split(".").join(" "), start: classesStart, end: classesEnd};
} }
return [node]; return [node];
}; };

View File

@ -45,10 +45,11 @@ exports.parse = function() {
reEnd.lastIndex = this.parser.pos; reEnd.lastIndex = this.parser.pos;
match = reEnd.exec(this.parser.source); match = reEnd.exec(this.parser.source);
if(match) { if(match) {
var start = this.parser.pos;
this.parser.pos = reEnd.lastIndex; this.parser.pos = reEnd.lastIndex;
// Add a line break if the terminator was a line break // Add a line break if the terminator was a line break
if(match[2]) { if(match[2]) {
tree.push({type: "element", tag: "br"}); tree.push({type: "element", tag: "br", start: start, end: this.parser.pos});
} }
} }
} while(match && !match[1]); } while(match && !match[1]);

View File

@ -30,7 +30,9 @@ exports.parse = function() {
// Move past the !s // Move past the !s
this.parser.pos = this.matchRegExp.lastIndex; this.parser.pos = this.matchRegExp.lastIndex;
// Parse any classes, whitespace and then the heading itself // Parse any classes, whitespace and then the heading itself
var classStart = this.parser.pos;
var classes = this.parser.parseClasses(); var classes = this.parser.parseClasses();
var classEnd = this.parser.pos;
this.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true}); this.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});
var tree = this.parser.parseInlineRun(/(\r?\n)/mg); var tree = this.parser.parseInlineRun(/(\r?\n)/mg);
// Return the heading // Return the heading
@ -38,7 +40,7 @@ exports.parse = function() {
type: "element", type: "element",
tag: "h" + headingLevel, tag: "h" + headingLevel,
attributes: { attributes: {
"class": {type: "string", value: classes.join(" ")} "class": {type: "string", value: classes.join(" "), start: classStart, end: classEnd}
}, },
children: tree children: tree
}]; }];

View File

@ -44,6 +44,10 @@ Parse the most recent match
exports.parse = function() { exports.parse = function() {
// Retrieve the most recent match so that recursive calls don't overwrite it // Retrieve the most recent match so that recursive calls don't overwrite it
var tag = this.nextTag; var tag = this.nextTag;
if (!tag.isSelfClosing) {
tag.openTagStart = tag.start;
tag.openTagEnd = tag.end;
}
this.nextTag = null; this.nextTag = null;
// Advance the parser position to past the tag // Advance the parser position to past the tag
this.parser.pos = tag.end; this.parser.pos = tag.end;
@ -60,6 +64,27 @@ exports.parse = function() {
var reEnd = new RegExp("(" + reEndString + ")","mg"); var reEnd = new RegExp("(" + reEndString + ")","mg");
tag.children = this.parser.parseInlineRun(reEnd,{eatTerminator: true}); tag.children = this.parser.parseInlineRun(reEnd,{eatTerminator: true});
} }
tag.end = this.parser.pos;
tag.closeTagEnd = tag.end;
if (tag.closeTagEnd === tag.openTagEnd || this.parser.source[tag.closeTagEnd - 1] !== '>') {
tag.closeTagStart = tag.end;
} else {
tag.closeTagStart = tag.closeTagEnd - 2;
var closeTagMinPos = tag.children.length > 0 ? tag.children[tag.children.length-1].end : tag.openTagEnd;
if (!Number.isSafeInteger(closeTagMinPos)) closeTagMinPos = tag.openTagEnd;
while (tag.closeTagStart >= closeTagMinPos) {
var char = this.parser.source[tag.closeTagStart];
if (char === '>') {
tag.closeTagStart = -1;
break;
}
if (char === '<') break;
tag.closeTagStart -= 1;
}
if (tag.closeTagStart < closeTagMinPos) {
tag.closeTagStart = tag.end;
}
}
} }
// Return the tag // Return the tag
return [tag]; return [tag];

View File

@ -122,9 +122,9 @@ exports.parseImage = function(source,pos) {
} }
pos = token.end; pos = token.end;
if(token.match[1]) { if(token.match[1]) {
node.attributes.tooltip = {type: "string", value: token.match[1].trim()}; node.attributes.tooltip = {type: "string", value: token.match[1].trim(),start: token.start,end:token.start + token.match[1].length - 1};
} }
node.attributes.source = {type: "string", value: (token.match[2] || "").trim()}; node.attributes.source = {type: "string", value: (token.match[2] || "").trim(), start: token.start + (token.match[1] ? token.match[1].length : 0), end: token.end - 2};
// Update the end position // Update the end position
node.end = pos; node.end = pos;
return node; return node;

View File

@ -38,13 +38,14 @@ exports.parse = function() {
// Parse the filter terminated by a line break // Parse the filter terminated by a line break
var reMatch = /(.*)(?:$|\r?\n)/mg; var reMatch = /(.*)(?:$|\r?\n)/mg;
reMatch.lastIndex = this.parser.pos; reMatch.lastIndex = this.parser.pos;
var filterStart = this.parser.source;
var match = reMatch.exec(this.parser.source); var match = reMatch.exec(this.parser.source);
this.parser.pos = reMatch.lastIndex; this.parser.pos = reMatch.lastIndex;
// Parse tree nodes to return // Parse tree nodes to return
return [{ return [{
type: "importvariables", type: "importvariables",
attributes: { attributes: {
filter: {type: "string", value: match[1]} filter: {type: "string", value: match[1], start: filterStart, end: this.parser.pos}
}, },
children: [] children: []
}]; }];

View File

@ -74,6 +74,7 @@ exports.parse = function() {
// Match the list marker // Match the list marker
var reMatch = /([\*#;:>]+)/mg; var reMatch = /([\*#;:>]+)/mg;
reMatch.lastIndex = this.parser.pos; reMatch.lastIndex = this.parser.pos;
var start = this.parser.pos;
var match = reMatch.exec(this.parser.source); var match = reMatch.exec(this.parser.source);
if(!match || match.index !== this.parser.pos) { if(!match || match.index !== this.parser.pos) {
break; break;
@ -94,9 +95,21 @@ exports.parse = function() {
} }
// Construct the list element or reuse the previous one at this level // Construct the list element or reuse the previous one at this level
if(listStack.length <= t) { if(listStack.length <= t) {
var listElement = {type: "element", tag: listInfo.listTag, children: [ var listElement = {
{type: "element", tag: listInfo.itemTag, children: []} type: "element",
]}; tag: listInfo.listTag,
children: [
{
type: "element",
tag: listInfo.itemTag,
children: [],
start: start,
end: this.parser.pos,
}
],
start: start,
end: this.parser.pos,
};
// Link this list element into the last child item of the parent list item // Link this list element into the last child item of the parent list item
if(t) { if(t) {
var prevListItem = listStack[t-1].children[listStack[t-1].children.length-1]; var prevListItem = listStack[t-1].children[listStack[t-1].children.length-1];
@ -105,21 +118,33 @@ exports.parse = function() {
// Save this element in the stack // Save this element in the stack
listStack[t] = listElement; listStack[t] = listElement;
} else if(t === (match[0].length - 1)) { } else if(t === (match[0].length - 1)) {
listStack[t].children.push({type: "element", tag: listInfo.itemTag, children: []}); listStack[t].children.push({
type: "element",
tag: listInfo.itemTag,
children: [],
start: start,
end: this.parser.pos,
});
} }
} }
if(listStack.length > match[0].length) { if(listStack.length > match[0].length) {
listStack.splice(match[0].length,listStack.length - match[0].length); listStack.splice(match[0].length,listStack.length - match[0].length);
} }
// Process the body of the list item into the last list item // Process the body of the list item into the last list item
var classStart = this.parser.pos;
var lastListChildren = listStack[listStack.length-1].children, var lastListChildren = listStack[listStack.length-1].children,
lastListItem = lastListChildren[lastListChildren.length-1], lastListItem = lastListChildren[lastListChildren.length-1],
classes = this.parser.parseClasses(); classes = this.parser.parseClasses();
var classEnd = this.parser.pos;
this.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true}); this.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});
var tree = this.parser.parseInlineRun(/(\r?\n)/mg); var tree = this.parser.parseInlineRun(/(\r?\n)/mg);
lastListItem.children.push.apply(lastListItem.children,tree); lastListItem.children.push.apply(lastListItem.children,tree);
lastListItem.end = this.parser.pos;
listStack[listStack.length-1].end = this.parser.pos;
if(classes.length > 0) { if(classes.length > 0) {
$tw.utils.addClassToParseTreeNode(lastListItem,classes.join(" ")); $tw.utils.addClassToParseTreeNode(lastListItem,classes.join(" "));
lastListItem.attributes.class.start = classStart;
lastListItem.attributes.class.end = classEnd;
} }
// Consume any whitespace following the list item // Consume any whitespace following the list item
this.parser.skipWhitespace(); this.parser.skipWhitespace();

View File

@ -96,15 +96,20 @@ exports.parseLink = function(source,pos) {
splitPos = null; splitPos = null;
} }
// Pull out the tooltip and URL // Pull out the tooltip and URL
var tooltip, URL; var tooltip, URL, urlStart;
textNode.start = pos;
if(splitPos) { if(splitPos) {
urlStart = splitPos + 1;
URL = source.substring(splitPos + 1,closePos).trim(); URL = source.substring(splitPos + 1,closePos).trim();
textNode.text = source.substring(pos,splitPos).trim(); textNode.text = source.substring(pos,splitPos).trim();
textNode.end = splitPos;
} else { } else {
urlStart = pos;
URL = source.substring(pos,closePos).trim(); URL = source.substring(pos,closePos).trim();
textNode.text = URL; textNode.text = URL;
textNode.end = closePos;
} }
node.attributes.href = {type: "string", value: URL}; node.attributes.href = {type: "string", value: URL, start: urlStart, end: closePos};
node.attributes.target = {type: "string", value: "_blank"}; node.attributes.target = {type: "string", value: "_blank"};
node.attributes.rel = {type: "string", value: "noopener noreferrer"}; node.attributes.rel = {type: "string", value: "noopener noreferrer"};
// Update the end position // Update the end position

View File

@ -29,32 +29,39 @@ exports.init = function(parser) {
exports.parse = function() { exports.parse = function() {
// Move past the match // Move past the match
var start = this.parser.pos + 2;
this.parser.pos = this.matchRegExp.lastIndex; this.parser.pos = this.matchRegExp.lastIndex;
// Process the link // Process the link
var text = this.match[1], var text = this.match[1],
link = this.match[2] || text; link = this.match[2] || text,
textEndPos = this.parser.source.indexOf("|", start);
if (textEndPos < 0 || textEndPos > this.matchRegExp.lastIndex) {
textEndPos = this.matchRegExp.lastIndex - 2;
}
var linkStart = this.match[2] ? (start + this.match[1].length + 1) : start;
var linkEnd = linkStart + link.length;
if($tw.utils.isLinkExternal(link)) { if($tw.utils.isLinkExternal(link)) {
return [{ return [{
type: "element", type: "element",
tag: "a", tag: "a",
attributes: { attributes: {
href: {type: "string", value: link}, href: {type: "string", value: link, start: linkStart, end: linkEnd},
"class": {type: "string", value: "tc-tiddlylink-external"}, "class": {type: "string", value: "tc-tiddlylink-external"},
target: {type: "string", value: "_blank"}, target: {type: "string", value: "_blank"},
rel: {type: "string", value: "noopener noreferrer"} rel: {type: "string", value: "noopener noreferrer"}
}, },
children: [{ children: [{
type: "text", text: text type: "text", text: text, start: start, end: textEndPos
}] }]
}]; }];
} else { } else {
return [{ return [{
type: "link", type: "link",
attributes: { attributes: {
to: {type: "string", value: link} to: {type: "string", value: link, start: linkStart, end: linkEnd}
}, },
children: [{ children: [{
type: "text", text: text type: "text", text: text, start: start, end: textEndPos
}] }]
}]; }];
} }

View File

@ -28,9 +28,13 @@ exports.parse = function() {
// Move past the <s // Move past the <s
this.parser.pos = this.matchRegExp.lastIndex; this.parser.pos = this.matchRegExp.lastIndex;
// Parse any classes, whitespace and then the optional cite itself // Parse any classes, whitespace and then the optional cite itself
var classStart = this.parser.pos;
classes.push.apply(classes, this.parser.parseClasses()); classes.push.apply(classes, this.parser.parseClasses());
var classEnd = this.parser.pos;
this.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true}); this.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});
var citeStart = this.parser.pos;
var cite = this.parser.parseInlineRun(/(\r?\n)/mg); var cite = this.parser.parseInlineRun(/(\r?\n)/mg);
var citeEnd = this.parser.pos;
// before handling the cite, parse the body of the quote // before handling the cite, parse the body of the quote
var tree = this.parser.parseBlocks(reEndString); var tree = this.parser.parseBlocks(reEndString);
// If we got a cite, put it before the text // If we got a cite, put it before the text
@ -38,18 +42,24 @@ exports.parse = function() {
tree.unshift({ tree.unshift({
type: "element", type: "element",
tag: "cite", tag: "cite",
children: cite children: cite,
start: citeStart,
end: citeEnd
}); });
} }
// Parse any optional cite // Parse any optional cite
this.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true}); this.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});
citeStart = this.parser.pos;
cite = this.parser.parseInlineRun(/(\r?\n)/mg); cite = this.parser.parseInlineRun(/(\r?\n)/mg);
citeEnd = this.parser.pos;
// If we got a cite, push it // If we got a cite, push it
if(cite.length > 0) { if(cite.length > 0) {
tree.push({ tree.push({
type: "element", type: "element",
tag: "cite", tag: "cite",
children: cite children: cite,
start: citeStart,
end: citeEnd
}); });
} }
// Return the blockquote element // Return the blockquote element
@ -57,7 +67,7 @@ exports.parse = function() {
type: "element", type: "element",
tag: "blockquote", tag: "blockquote",
attributes: { attributes: {
class: { type: "string", value: classes.join(" ") }, class: { type: "string", value: classes.join(" "), start: classStart, end: classEnd },
}, },
children: tree children: tree
}]; }];

View File

@ -29,10 +29,11 @@ exports.init = function(parser) {
exports.parse = function() { exports.parse = function() {
var match = this.match[0]; var match = this.match[0];
// Move past the match // Move past the match
var start = this.parser.pos;
this.parser.pos = this.matchRegExp.lastIndex; this.parser.pos = this.matchRegExp.lastIndex;
// Create the link unless it is suppressed // Create the link unless it is suppressed
if(match.substr(0,1) === "~") { if(match.substr(0,1) === "~") {
return [{type: "text", text: match.substr(1)}]; return [{type: "text", text: match.substr(1), start: start+1, end: this.parser.pos}];
} else { } else {
return [{ return [{
type: "link", type: "link",
@ -41,7 +42,9 @@ exports.parse = function() {
}, },
children: [{ children: [{
type: "text", type: "text",
text: match text: match,
start: start,
end: this.parser.pos
}] }]
}]; }];
} }

View File

@ -150,7 +150,7 @@ exports.parse = function() {
} else { } else {
// Otherwise, create a new row if this one is of a different type // Otherwise, create a new row if this one is of a different type
if(rowType !== currRowType) { if(rowType !== currRowType) {
rowContainer = {type: "element", tag: rowContainerTypes[rowType], children: []}; rowContainer = {type: "element", tag: rowContainerTypes[rowType], children: [], start: this.parser.pos, end: this.parser.pos};
table.children.push(rowContainer); table.children.push(rowContainer);
currRowType = rowType; currRowType = rowType;
} }
@ -178,6 +178,7 @@ exports.parse = function() {
// Increment the row count // Increment the row count
rowCount++; rowCount++;
} }
rowContainer.end = this.parser.pos;
} }
rowMatch = rowRegExp.exec(this.parser.source); rowMatch = rowRegExp.exec(this.parser.source);
} }

View File

@ -46,6 +46,7 @@ exports.parse = function() {
renderType = this.match[2]; renderType = this.match[2];
// Move past the match // Move past the match
this.parser.pos = this.matchRegExp.lastIndex; this.parser.pos = this.matchRegExp.lastIndex;
var start = this.parser.pos;
// Look for the end of the block // Look for the end of the block
reEnd.lastIndex = this.parser.pos; reEnd.lastIndex = this.parser.pos;
var match = reEnd.exec(this.parser.source), var match = reEnd.exec(this.parser.source),
@ -74,7 +75,9 @@ exports.parse = function() {
tag: "pre", tag: "pre",
children: [{ children: [{
type: "text", type: "text",
text: text text: text,
start: start,
end: this.parser.pos
}] }]
}]; }];
} }

View File

@ -36,6 +36,7 @@ exports.parse = function() {
// Get the details of the match // Get the details of the match
var linkText = this.match[0]; var linkText = this.match[0];
// Move past the macro call // Move past the macro call
var start = this.parser.pos;
this.parser.pos = this.matchRegExp.lastIndex; this.parser.pos = this.matchRegExp.lastIndex;
// If the link starts with the unwikilink character then just output it as plain text // If the link starts with the unwikilink character then just output it as plain text
if(linkText.substr(0,1) === $tw.config.textPrimitives.unWikiLink) { if(linkText.substr(0,1) === $tw.config.textPrimitives.unWikiLink) {
@ -57,7 +58,9 @@ exports.parse = function() {
}, },
children: [{ children: [{
type: "text", type: "text",
text: linkText text: linkText,
start: start,
end: this.parser.pos
}] }]
}]; }];
}; };

View File

@ -91,6 +91,11 @@ var WikiParser = function(type,text,options) {
} else { } else {
topBranch.push.apply(topBranch,this.parseBlocks()); topBranch.push.apply(topBranch,this.parseBlocks());
} }
// Build rules' name map
this.usingRuleMap = {};
$tw.utils.each(this.pragmaRules, function (ruleInfo) { self.usingRuleMap[ruleInfo.rule.name] = Object.getPrototypeOf(ruleInfo.rule); });
$tw.utils.each(this.blockRules, function (ruleInfo) { self.usingRuleMap[ruleInfo.rule.name] = Object.getPrototypeOf(ruleInfo.rule); });
$tw.utils.each(this.inlineRules, function (ruleInfo) { self.usingRuleMap[ruleInfo.rule.name] = Object.getPrototypeOf(ruleInfo.rule); });
// Return the parse tree // Return the parse tree
}; };
@ -209,8 +214,13 @@ WikiParser.prototype.parsePragmas = function() {
break; break;
} }
// Process the pragma rule // Process the pragma rule
var start = this.pos;
var subTree = nextMatch.rule.parse(); var subTree = nextMatch.rule.parse();
if(subTree.length > 0) { if(subTree.length > 0) {
// Set the start and end positions of the pragma rule if
if (subTree[0].start === undefined) subTree[0].start = start;
if (subTree[subTree.length - 1].end === undefined) subTree[subTree.length - 1].end = this.pos;
$tw.utils.each(subTree, function (node) { node.rule = nextMatch.rule.name; });
// Quick hack; we only cope with a single parse tree node being returned, which is true at the moment // Quick hack; we only cope with a single parse tree node being returned, which is true at the moment
currentTreeBranch.push.apply(currentTreeBranch,subTree); currentTreeBranch.push.apply(currentTreeBranch,subTree);
subTree[0].children = []; subTree[0].children = [];
@ -235,7 +245,15 @@ WikiParser.prototype.parseBlock = function(terminatorRegExpString) {
// Look for a block rule that applies at the current position // Look for a block rule that applies at the current position
var nextMatch = this.findNextMatch(this.blockRules,this.pos); var nextMatch = this.findNextMatch(this.blockRules,this.pos);
if(nextMatch && nextMatch.matchIndex === this.pos) { if(nextMatch && nextMatch.matchIndex === this.pos) {
return nextMatch.rule.parse(); var start = this.pos;
var subTree = nextMatch.rule.parse();
// Set the start and end positions of the first and last blocks if they're not already set
if (subTree.length > 0) {
if (subTree[0].start === undefined) subTree[0].start = start;
if (subTree[subTree.length - 1].end === undefined) subTree[subTree.length - 1].end = this.pos;
}
$tw.utils.each(subTree, function (node) { node.rule = nextMatch.rule.name; });
return subTree;
} }
// Treat it as a paragraph if we didn't find a block rule // Treat it as a paragraph if we didn't find a block rule
var start = this.pos; var start = this.pos;
@ -332,7 +350,16 @@ WikiParser.prototype.parseInlineRunUnterminated = function(options) {
this.pos = nextMatch.matchIndex; this.pos = nextMatch.matchIndex;
} }
// Process the run rule // Process the run rule
tree.push.apply(tree,nextMatch.rule.parse()); var start = this.pos;
var subTree = nextMatch.rule.parse();
// Set the start and end positions of the first and last child if they're not already set
if (subTree.length > 0) {
// Set the start and end positions of the first and last child if they're not already set
if (subTree[0].start === undefined) subTree[0].start = start;
if (subTree[subTree.length - 1].end === undefined) subTree[subTree.length - 1].end = this.pos;
}
$tw.utils.each(subTree, function (node) { node.rule = nextMatch.rule.name; });
tree.push.apply(tree,subTree);
// Look for the next run rule // Look for the next run rule
nextMatch = this.findNextMatch(this.inlineRules,this.pos); nextMatch = this.findNextMatch(this.inlineRules,this.pos);
} }
@ -383,7 +410,15 @@ WikiParser.prototype.parseInlineRunTerminatedExtended = function(terminatorRegEx
this.pos = inlineRuleMatch.matchIndex; this.pos = inlineRuleMatch.matchIndex;
} }
// Process the inline rule // Process the inline rule
tree.push.apply(tree,inlineRuleMatch.rule.parse()); var start = this.pos;
var subTree = inlineRuleMatch.rule.parse();
// Set the start and end positions of the first and last child if they're not already set
if (subTree.length > 0) {
if (subTree[0].start === undefined) subTree[0].start = start;
if (subTree[subTree.length - 1].end === undefined) subTree[subTree.length - 1].end = this.pos;
}
$tw.utils.each(subTree, function (node) { node.rule = inlineRuleMatch.rule.name; });
tree.push.apply(tree,subTree);
// Look for the next inline rule // Look for the next inline rule
inlineRuleMatch = this.findNextMatch(this.inlineRules,this.pos); inlineRuleMatch = this.findNextMatch(this.inlineRules,this.pos);
// Look for the next terminator match // Look for the next terminator match
@ -462,4 +497,3 @@ WikiParser.prototype.amendRules = function(type,names) {
exports["text/vnd.tiddlywiki"] = WikiParser; exports["text/vnd.tiddlywiki"] = WikiParser;
})(); })();

View File

@ -37,7 +37,9 @@ HeaderAuthenticator.prototype.authenticateRequest = function(request,response,st
return false; return false;
} else { } else {
// authenticatedUsername will be undefined for anonymous users // authenticatedUsername will be undefined for anonymous users
if(username) {
state.authenticatedUsername = $tw.utils.decodeURIComponentSafe(username); state.authenticatedUsername = $tw.utils.decodeURIComponentSafe(username);
}
return true; return true;
} }
}; };

View File

@ -66,8 +66,13 @@ LogWidget.prototype.log = function() {
}); });
for(var v in this.variables) { for(var v in this.variables) {
var variable = this.parentWidget && this.parentWidget.variables[v];
if(variable && variable.isFunctionDefinition) {
allVars[v] = variable.value;
} else {
allVars[v] = this.getVariable(v,{defaultValue:""}); allVars[v] = this.getVariable(v,{defaultValue:""});
} }
}
if(this.filter) { if(this.filter) {
filteredVars = this.wiki.compileFilter(this.filter).call(this.wiki,this.wiki.makeTiddlerIterator(allVars)); filteredVars = this.wiki.compileFilter(this.filter).call(this.wiki,this.wiki.makeTiddlerIterator(allVars));
$tw.utils.each(filteredVars,function(name) { $tw.utils.each(filteredVars,function(name) {

View File

@ -262,7 +262,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
*/ */
ButtonWidget.prototype.refresh = function(changedTiddlers) { ButtonWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes(); var changedAttributes = this.computeAttributes();
if(changedAttributes.actions || changedAttributes.to || changedAttributes.message || changedAttributes.param || changedAttributes.set || changedAttributes.setTo || changedAttributes.popup || changedAttributes.hover || changedAttributes.selectedClass || changedAttributes.style || changedAttributes.dragFilter || changedAttributes.dragTiddler || (this.set && changedTiddlers[this.set]) || (this.popup && changedTiddlers[this.popup]) || (this.popupTitle && changedTiddlers[this.popupTitle]) || changedAttributes.popupAbsCoords || changedAttributes.setTitle || changedAttributes.setField || changedAttributes.setIndex || changedAttributes.popupTitle || changedAttributes.disabled || changedAttributes["default"]) { if(changedAttributes.tooltip || changedAttributes.actions || changedAttributes.to || changedAttributes.message || changedAttributes.param || changedAttributes.set || changedAttributes.setTo || changedAttributes.popup || changedAttributes.hover || changedAttributes.selectedClass || changedAttributes.style || changedAttributes.dragFilter || changedAttributes.dragTiddler || (this.set && changedTiddlers[this.set]) || (this.popup && changedTiddlers[this.popup]) || (this.popupTitle && changedTiddlers[this.popupTitle]) || changedAttributes.popupAbsCoords || changedAttributes.setTitle || changedAttributes.setField || changedAttributes.setIndex || changedAttributes.popupTitle || changedAttributes.disabled || changedAttributes["default"]) {
this.refreshSelf(); this.refreshSelf();
return true; return true;
} else { } else {

View File

@ -551,24 +551,37 @@ exports.getTiddlerBacklinks = function(targetTitle) {
/* /*
Return an array of tiddler titles that are directly transcluded within the given parse tree Return an array of tiddler titles that are directly transcluded within the given parse tree. `title` is the tiddler being parsed, we will ignore its self-referential transclusions, only return
*/ */
exports.extractTranscludes = function(parseTreeRoot) { exports.extractTranscludes = function(parseTreeRoot, title) {
// Count up the transcludes // Count up the transcludes
var transcludes = [], var transcludes = [],
checkParseTree = function(parseTree, parentNode) { checkParseTree = function(parseTree, parentNode) {
for(var t=0; t<parseTree.length; t++) { for(var t=0; t<parseTree.length; t++) {
var parseTreeNode = parseTree[t]; var parseTreeNode = parseTree[t];
if(parseTreeNode.type === "transclude" && parseTreeNode.attributes.$tiddler && parseTreeNode.attributes.$tiddler.type === "string") { if(parseTreeNode.type === "transclude") {
if(parseTreeNode.attributes.$tiddler && parseTreeNode.attributes.$tiddler.type === "string") {
var value; var value;
// if it is Transclusion with Templates like `{{Index||$:/core/ui/TagTemplate}}`, the `$tiddler` will point to the template. We need to find the actual target tiddler from parent node // if it is Transclusion with Templates like `{{Index||$:/core/ui/TagTemplate}}`, the `$tiddler` will point to the template. We need to find the actual target tiddler from parent node
if(parentNode && parentNode.type === "tiddler" && parentNode.attributes.tiddler && parentNode.attributes.tiddler.type === "string") { if(parentNode && parentNode.type === "tiddler" && parentNode.attributes.tiddler && parentNode.attributes.tiddler.type === "string") {
value = parentNode.attributes.tiddler.value; // Empty value (like `{{!!field}}`) means self-referential transclusion.
value = parentNode.attributes.tiddler.value || title;
} else { } else {
value = parseTreeNode.attributes.$tiddler.value; value = parseTreeNode.attributes.$tiddler.value;
} }
if(transcludes.indexOf(value) === -1) { } else if(parseTreeNode.attributes.tiddler && parseTreeNode.attributes.tiddler.type === "string") {
transcludes.push(value); // Old transclude widget usage
value = parseTreeNode.attributes.tiddler.value;
} else if(parseTreeNode.attributes.$field && parseTreeNode.attributes.$field.type === "string") {
// Empty value (like `<$transclude $field='created'/>`) means self-referential transclusion.
value = title;
} else if(parseTreeNode.attributes.field && parseTreeNode.attributes.field.type === "string") {
// Old usage with Empty value (like `<$transclude field='created'/>`)
value = title;
}
// Deduplicate the result.
if(value && transcludes.indexOf(value) === -1) {
$tw.utils.pushTop(transcludes,value);
} }
} }
if(parseTreeNode.children) { if(parseTreeNode.children) {
@ -591,7 +604,8 @@ exports.getTiddlerTranscludes = function(title) {
// Parse the tiddler // Parse the tiddler
var parser = self.parseTiddler(title); var parser = self.parseTiddler(title);
if(parser) { if(parser) {
return self.extractTranscludes(parser.tree); // this will ignore self-referential transclusions from `title`
return self.extractTranscludes(parser.tree,title);
} }
return []; return [];
}); });

View File

@ -82,6 +82,10 @@ sidebar-tab-foreground: <<colour tab-foreground>>
sidebar-tiddler-link-foreground-hover: #444444 sidebar-tiddler-link-foreground-hover: #444444
sidebar-tiddler-link-foreground: #999999 sidebar-tiddler-link-foreground: #999999
site-title-foreground: <<colour tiddler-title-foreground>> site-title-foreground: <<colour tiddler-title-foreground>>
stability-stable: #008000
stability-experimental: #c07c00
stability-deprecated: #ff0000
stability-legacy: #0000ff
static-alert-foreground: #aaaaaa static-alert-foreground: #aaaaaa
tab-background-selected: #ffffff tab-background-selected: #ffffff
tab-background: #d8d8d8 tab-background: #d8d8d8

View File

@ -9,7 +9,7 @@ list-before:
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Settings]]"> <$list filter="[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Settings]]">
<div class="tc-control-panel-setting" data-setting-title=<<currentTiddler>> style="border-top:1px solid #eee;"> <div class="tc-control-panel-setting" data-setting-title=<<currentTiddler>> >
!!.tc-control-panel-accent <$link><$transclude field="caption"/></$link> !!.tc-control-panel-accent <$link><$transclude field="caption"/></$link>

View File

@ -1,24 +1,10 @@
title: $:/core/macros/lingo title: $:/core/macros/lingo
tags: $:/tags/Global tags: $:/tags/Macro
<!-- Note that lingo-base should end with a trailing slash character --> \define lingo-base()
\procedure lingo-base()
$:/language/ $:/language/
\end lingo-base \end
\procedure lingo(title,override-lingo-base) \define lingo(title)
<!-- Lingo procedure --> {{$(lingo-base)$$title$}}
<!-- Get the parse mode used to invoke this procedure --> \end
<$parameters $parseMode="parseMode">
<!-- Compute the lingo-base-->
<$let active-lingo-base={{{ [<override-lingo-base>!match[]else<lingo-base>] }}}>
<!-- First try the old school <active-lingo-base><title> format -->
<$transclude $tiddler={{{ [<active-lingo-base>addsuffix<title>] }}} $mode=<<parseMode>>>
<!-- If that didn't work, try the new <lingo-base><langcode>/<title> format -->
<$let language-code={{{ [[$:/language]get[text]get[name]else[en-GB]] }}}>
<$transclude $tiddler={{{ [<active-lingo-base>addsuffix<language-code>addsuffix[/]addsuffix<title>] }}} $mode=<<parseMode>>/>
</$let>
</$transclude>
</$let>
</$parameters>
\end lingo

View File

@ -52,10 +52,11 @@ The easiest way to use the <<.wlink TestCaseWidget>> is by creating TestCaseTidd
! Translation improvements ! Translation improvements
Improvements to the following translations: This release also includes improvements to the following translations:
* Chinese * Chinese
* French * French
* German
* Macedonian * Macedonian
* Polish * Polish
@ -69,7 +70,7 @@ Improvements to the following translations:
! Filter Improvements ! Filter Improvements
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7966">> new [[backtranscludes Operator]] * <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6081">> new [[transcludes|transcludes Operator]] and [[backtranscludes|backtranscludes Operator]] operators
! Usability Improvements ! Usability Improvements
@ -78,12 +79,13 @@ Improvements to the following translations:
! Hackability Improvements ! Hackability Improvements
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7866">> the wikitext parser to generate start/end properties for all nodes
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/pull/8109">> [[WidgetMessage: tm-http-request]] to be able to use Basic Authentication * <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/pull/8109">> [[WidgetMessage: tm-http-request]] to be able to use Basic Authentication
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/8225">> [[WidgetMessage: tm-http-request]] to allow the default headers to be suppressed
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7882">> infinite recursion handling using a custom exception * <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7882">> infinite recursion handling using a custom exception
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7966">> button to the JavaScript error popup allowing tiddlers to be saved to a local JSON file * <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7966">> button to the JavaScript error popup allowing tiddlers to be saved to a local JSON file
* <<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/issues/8120">> to latest version of modern-normalize 2.0.0 * <<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/issues/8120">> to latest version of modern-normalize 2.0.0
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/8211">> [[tm-permalink|WidgetMessage: tm-permalink]], [[tm-permaview|WidgetMessage: tm-permaview]] and [[tm-copy-to-clipboard|WidgetMessage: tm-copy-to-clipboard]] messages to allow the notification text to be customised * <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/8211">> [[tm-permalink|WidgetMessage: tm-permalink]], [[tm-permaview|WidgetMessage: tm-permaview]] and [[tm-copy-to-clipboard|WidgetMessage: tm-copy-to-clipboard]] messages to allow the notification text to be customised
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/8225">> [[WidgetMessage: tm-http-request]] to allow the default headers to be suppressed
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/8097">> window title rendering to automatically include global definitions * <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/8097">> window title rendering to automatically include global definitions
! Bug Fixes ! Bug Fixes
@ -108,11 +110,15 @@ Improvements to the following translations:
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7945">> theme font size settings to open in new window CSS * <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7945">> theme font size settings to open in new window CSS
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/8098">> backlink parser to prevent it parsing binary tiddlers * <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/8098">> backlink parser to prevent it parsing binary tiddlers
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/8203">> issue where default parameters were not applied when a ParametersWidget did not find a parent TranscludeWidget * <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/8203">> issue where default parameters were not applied when a ParametersWidget did not find a parent TranscludeWidget
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/8222">> crash when using [[splitregexp Operator]] with a regular expression that includes capture groups
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/8239">> ActionLogWidget evaluating all variables in scope
! Node.js Improvements ! Node.js Improvements
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/8141">> usage of "Cache-Control" header * <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/8141">> usage of "Cache-Control" header
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7878">> SaveCommand not overwriting files when required * <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7878">> SaveCommand not overwriting files when required
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/8237">> server header authentication when header is missing
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/8253">> ButtonWidget should refresh when "tooltip" attribute changes
! Performance Improvements ! Performance Improvements
@ -122,7 +128,7 @@ Improvements to the following translations:
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/8195">> issue with fakedom TW_Node inheritence * <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/8195">> issue with fakedom TW_Node inheritence
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/8099">> SJCL library creating variables in global scope * <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/8099">> SJCL library creating variables in global scope
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/8179">> fix `widget.getVariableInfo()` to always return a `params` property * <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/8179">> `widget.getVariableInfo()` to always return a `params` property
! Infrastructure Improvements ! Infrastructure Improvements
@ -145,6 +151,7 @@ eschlon
etardiff etardiff
flibbles flibbles
FSpark FSpark
Gk0Wk
hoelzro hoelzro
jinix6 jinix6
joshuafontany joshuafontany

View File

@ -58,7 +58,10 @@ title: ExpectedResult
"value": "Something" "value": "Something"
} }
], ],
"isProcedureDefinition": true "isProcedureDefinition": true,
"start": 0,
"end": 43,
"rule": "fnprocdef"
} }
] ]
</p> </p>

View File

@ -11,7 +11,7 @@ Tests the backtranscludes mechanism.
/*global $tw: false */ /*global $tw: false */
"use strict"; "use strict";
describe('Backtranscludes tests', function() { describe('Backtranscludes and transclude filter tests', function() {
describe('a tiddler with no transcludes to it', function() { describe('a tiddler with no transcludes to it', function() {
var wiki = new $tw.Wiki(); var wiki = new $tw.Wiki();
@ -22,6 +22,9 @@ describe('Backtranscludes tests', function() {
it('should have no backtranscludes', function() { it('should have no backtranscludes', function() {
expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe(''); expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe('');
}); });
it('should have no transcludes', function() {
expect(wiki.filterTiddlers('TestIncoming +[transcludes[]]').join(',')).toBe('');
});
}); });
describe('A tiddler added to the wiki with a transclude to it', function() { describe('A tiddler added to the wiki with a transclude to it', function() {
@ -38,6 +41,9 @@ describe('Backtranscludes tests', function() {
it('should have a backtransclude', function() { it('should have a backtransclude', function() {
expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe('TestOutgoing'); expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe('TestOutgoing');
}); });
it('should have a transclude', function() {
expect(wiki.filterTiddlers('TestOutgoing +[transcludes[]]').join(',')).toBe('TestIncoming');
});
}); });
describe('A tiddler transclude with template will still use the tiddler as result.', function() { describe('A tiddler transclude with template will still use the tiddler as result.', function() {
@ -56,6 +62,26 @@ describe('Backtranscludes tests', function() {
}); });
}); });
describe('A data tiddler transclude will still use the tiddler as result.', function() {
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: 'TestIncoming',
type: 'application/x-tiddler-dictionary',
text: 'name: value'});
wiki.addTiddler({
title: 'TestOutgoing',
text: 'A transclude to {{TestIncoming##name}}'});
it('should have a backtransclude', function() {
expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe('TestOutgoing');
});
it('should have a transclude', function() {
expect(wiki.filterTiddlers('TestOutgoing +[transcludes[]]').join(',')).toBe('TestIncoming');
});
});
describe('A tiddler that has a transclude added to it later', function() { describe('A tiddler that has a transclude added to it later', function() {
it('should have an additional backtransclude', function() { it('should have an additional backtransclude', function() {
var wiki = new $tw.Wiki(); var wiki = new $tw.Wiki();
@ -143,6 +169,73 @@ describe('Backtranscludes tests', function() {
expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe(''); expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe('');
}); });
}); });
describe('a tiddler with some transcludes on it in order', function() {
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: 'TestOutgoing',
text: "{{New Tiddler!!created}}\n\nA transclude to {{TestIncoming}}"
});
it('should have a transclude', function() {
expect(wiki.filterTiddlers('TestOutgoing +[transcludes[]]').join(',')).toBe('New Tiddler,TestIncoming');
});
it('should have a back transclude', function() {
expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe('TestOutgoing');
expect(wiki.filterTiddlers('[[New Tiddler]] +[backtranscludes[]]').join(',')).toBe('TestOutgoing');
});
});
describe('include implicit self transclusion', function() {
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: 'TestOutgoing',
text: "{{!!created}}\n\nAn implicit self-referential transclude to <$transclude $field='created'/> and <$transclude field='created'/>"});
it('should have no transclude', function() {
expect(wiki.filterTiddlers('TestOutgoing +[transcludes[]]').join(',')).toBe('TestOutgoing');
});
it('should have no back transcludes', function() {
expect(wiki.filterTiddlers('TestOutgoing +[backtranscludes[]]').join(',')).toBe('TestOutgoing');
});
});
describe('include explicit self transclusion', function() {
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: 'TestOutgoing',
text: "{{TestOutgoing!!created}}\n\n<$transclude $tiddler='TestOutgoing' $field='created'/> and <$transclude tiddler='TestOutgoing' field='created'/>"});
it('should have no transclude', function() {
expect(wiki.filterTiddlers('TestOutgoing +[transcludes[]]').join(',')).toBe('TestOutgoing');
});
it('should have no back transcludes', function() {
expect(wiki.filterTiddlers('TestOutgoing +[backtranscludes[]]').join(',')).toBe('TestOutgoing');
});
});
describe('recognize transclusion defined by widget', function() {
var wiki = new $tw.Wiki();
wiki.addTiddler({
title: 'TestOutgoing',
text: "<$tiddler tiddler='TestIncoming'><$transclude $tiddler /></$tiddler>\n\n<$transclude tiddler='TiddlyWiki Pre-release'/>"});
it('should have a transclude', function() {
expect(wiki.filterTiddlers('TestOutgoing +[transcludes[]]').join(',')).toBe('TestIncoming,TiddlyWiki Pre-release');
});
it('should have a back transclude', function() {
expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe('TestOutgoing');
expect(wiki.filterTiddlers('[[TiddlyWiki Pre-release]] +[backtranscludes[]]').join(',')).toBe('TestOutgoing');
});
});
}); });
})(); })();

View File

@ -26,7 +26,7 @@ describe("WikiText parser tests", function() {
it("should parse tags", function() { it("should parse tags", function() {
expect(parse("<br>")).toEqual( expect(parse("<br>")).toEqual(
[ { type : 'element', tag : 'p', start : 0, end : 4, children : [ { type : 'element', tag : 'br', start : 0, end : 4, isBlock : false, attributes : { }, orderedAttributes: [ ] } ] } ] [ { type : 'element', tag : 'p', start : 0, end : 4, children : [ { type : 'element', tag : 'br', start : 0, end : 4, openTagStart: 0, openTagEnd: 4, rule: 'html', isBlock : false, attributes : { }, orderedAttributes: [ ] } ] } ]
); );
expect(parse("</br>")).toEqual( expect(parse("</br>")).toEqual(
@ -36,78 +36,77 @@ describe("WikiText parser tests", function() {
); );
expect(parse("<div>")).toEqual( expect(parse("<div>")).toEqual(
[ { type : 'element', tag : 'p', start : 0, end : 5, children : [ { type : 'element', tag : 'div', start : 0, end : 5, isBlock : false, attributes : { }, orderedAttributes: [ ], children : [ ] } ] } ] [ { type : 'element', tag : 'p', start : 0, end : 5, children : [ { type : 'element', tag : 'div', start : 0, end : 5, openTagStart: 0, openTagEnd: 5, closeTagStart: 5, closeTagEnd: 5, rule: 'html', isBlock : false, attributes : { }, orderedAttributes: [ ], children : [ ] } ] } ]
); );
expect(parse("<div/>")).toEqual( expect(parse("<div/>")).toEqual(
[ { type : 'element', tag : 'p', start : 0, end : 6, children : [ { type : 'element', tag : 'div', isSelfClosing : true, isBlock : false, attributes : { }, orderedAttributes: [ ], start : 0, end : 6 } ] } ] [ { type : 'element', tag : 'p', start : 0, end : 6, children : [ { type : 'element', tag : 'div', isSelfClosing : true, isBlock : false, attributes : { }, orderedAttributes: [ ], start : 0, end : 6, rule: 'html' } ] } ]
); );
expect(parse("<div></div>")).toEqual( expect(parse("<div></div>")).toEqual(
[ { type : 'element', tag : 'p', start : 0, end : 11, children : [ { type : 'element', tag : 'div', isBlock : false, attributes : { }, orderedAttributes: [ ], children : [ ], start : 0, end : 5 } ] } ] [ { type : 'element', tag : 'p', start : 0, end : 11, children : [ { type : 'element', tag : 'div', isBlock : false, attributes : { }, orderedAttributes: [ ], children : [ ], start : 0, end : 11, openTagStart: 0, openTagEnd: 5, closeTagStart: 5, closeTagEnd: 11, rule: 'html' } ] } ]
); );
expect(parse("<div>some text</div>")).toEqual( expect(parse("<div>some text</div>")).toEqual(
[ { type : 'element', tag : 'p', start : 0, end : 20, children : [ { type : 'element', tag : 'div', start : 0, end : 20, isBlock : false, attributes : { }, orderedAttributes: [ ], children : [ { type : 'text', text : 'some text', start : 5, end : 14 } ], start : 0, end : 5 } ] } ] [ { type : 'element', tag : 'p', start : 0, end : 20, children : [ { type : 'element', tag : 'div', openTagStart: 0, openTagEnd: 5, closeTagStart: 14, closeTagEnd: 20, rule: 'html', isBlock : false, attributes : { }, orderedAttributes: [ ], children : [ { type : 'text', text : 'some text', start : 5, end : 14 } ], start : 0, end : 20 } ] } ]
); );
expect(parse("<div attribute>some text</div>")).toEqual( expect(parse("<div attribute>some text</div>")).toEqual(
[ { type : 'element', tag : 'p', start : 0, end : 30, children : [ { type : 'element', tag : 'div', isBlock : false, attributes : { attribute : { type : 'string', value : 'true', start : 4, end : 14, name: 'attribute' } }, orderedAttributes: [ { type : 'string', value : 'true', start : 4, end : 14, name: 'attribute' } ], children : [ { type : 'text', text : 'some text', start : 15, end : 24 } ], start : 0, end : 15 } ] } ] [ { type : 'element', tag : 'p', start : 0, end : 30, children : [ { type : 'element', tag : 'div', isBlock : false, attributes : { attribute : { type : 'string', value : 'true', start : 4, end : 14, name: 'attribute' } }, orderedAttributes: [ { type : 'string', value : 'true', start : 4, end : 14, name: 'attribute' } ], children : [ { type : 'text', text : 'some text', start : 15, end : 24 } ], start : 0, end : 30, openTagStart: 0, openTagEnd: 15, closeTagStart: 24, closeTagEnd: 30, rule: 'html' } ] } ]
); );
expect(parse("<div attribute='value'>some text</div>")).toEqual( expect(parse("<div attribute='value'>some text</div>")).toEqual(
[ { type : 'element', tag : 'p', start : 0, end : 38, children : [ { type : 'element', tag : 'div', openTagStart: 0, openTagEnd: 23, closeTagStart: 32, closeTagEnd: 38, rule: 'html', isBlock : false, attributes : { attribute : { type : 'string', name: 'attribute', value : 'value', start: 4, end: 22 } }, orderedAttributes: [ { type: 'string', name: 'attribute', value : 'value', start: 4, end: 22 } ], children : [ { type : 'text', text : 'some text', start : 23, end : 32 } ], start : 0, end : 38 } ] } ]
[ { type : 'element', tag : 'p', start : 0, end : 38, children : [ { type : 'element', tag : 'div', start: 0, end: 38, isBlock : false, attributes : { attribute : { type : 'string', name: 'attribute', value : 'value', start: 4, end: 22 } }, orderedAttributes: [ { type: 'string', name: 'attribute', value : 'value', start: 4, end: 22 } ], children : [ { type : 'text', text : 'some text', start : 23, end : 32 } ], start : 0, end : 23 } ] } ]
); );
expect(parse("<div attribute={{TiddlerTitle}}>some text</div>")).toEqual( expect(parse("<div attribute={{TiddlerTitle}}>some text</div>")).toEqual(
[ { type : 'element', tag : 'p', start: 0, end: 47, children : [ { type : 'element', tag : 'div', isBlock : false, attributes : { attribute : { type : 'indirect', name: 'attribute', textReference : 'TiddlerTitle', start : 4, end : 31 } }, orderedAttributes: [ { type : 'indirect', name: 'attribute', textReference : 'TiddlerTitle', start : 4, end : 31 } ], children : [ { type : 'text', text : 'some text', start : 32, end : 41 } ], start : 0, end : 32 } ] } ] [ { type : 'element', tag : 'p', start: 0, end: 47, children : [ { type : 'element', tag : 'div', isBlock : false, attributes : { attribute : { type : 'indirect', name: 'attribute', textReference : 'TiddlerTitle', start : 4, end : 31 } }, orderedAttributes: [ { type : 'indirect', name: 'attribute', textReference : 'TiddlerTitle', start : 4, end : 31 } ], children : [ { type : 'text', text : 'some text', start : 32, end : 41 } ], start : 0, end : 47, openTagStart: 0, openTagEnd: 32, closeTagStart: 41, closeTagEnd: 47, rule: 'html' } ] } ]
); );
expect(parse("<$reveal state='$:/temp/search' type='nomatch' text=''>")).toEqual( expect(parse("<$reveal state='$:/temp/search' type='nomatch' text=''>")).toEqual(
[ { type : 'element', tag : 'p', start: 0, end: 55, children : [ { type : 'reveal', tag: '$reveal', start : 0, attributes : { state : { start : 8, name : 'state', type : 'string', value : '$:/temp/search', end : 31 }, type : { start : 31, name : 'type', type : 'string', value : 'nomatch', end : 46 }, text : { start : 46, name : 'text', type : 'string', value : '', end : 54 } }, orderedAttributes: [ { start : 8, name : 'state', type : 'string', value : '$:/temp/search', end : 31 }, { start : 31, name : 'type', type : 'string', value : 'nomatch', end : 46 }, { start : 46, name : 'text', type : 'string', value : '', end : 54 } ], end : 55, isBlock : false, children : [ ] } ] } ] [ { type : 'element', tag : 'p', start: 0, end: 55, children : [ { type : 'reveal', tag: '$reveal', rule: 'html', attributes : { state : { start : 8, name : 'state', type : 'string', value : '$:/temp/search', end : 31 }, type : { start : 31, name : 'type', type : 'string', value : 'nomatch', end : 46 }, text : { start : 46, name : 'text', type : 'string', value : '', end : 54 } }, orderedAttributes: [ { start : 8, name : 'state', type : 'string', value : '$:/temp/search', end : 31 }, { start : 31, name : 'type', type : 'string', value : 'nomatch', end : 46 }, { start : 46, name : 'text', type : 'string', value : '', end : 54 } ], start: 0, end : 55, openTagStart: 0, openTagEnd: 55, closeTagStart: 55, closeTagEnd: 55, isBlock : false, children : [ ] } ] } ]
); );
expect(parse("<div attribute={{TiddlerTitle!!field}}>some text</div>")).toEqual( expect(parse("<div attribute={{TiddlerTitle!!field}}>some text</div>")).toEqual(
[ { type : 'element', tag : 'p', start: 0, end: 54, children : [ { type : 'element', tag : 'div', isBlock : false, attributes : { attribute : { type : 'indirect', name : 'attribute', textReference : 'TiddlerTitle!!field', start : 4, end : 38 } }, orderedAttributes: [ { type : 'indirect', name : 'attribute', textReference : 'TiddlerTitle!!field', start : 4, end : 38 } ], children : [ { type : 'text', text : 'some text', start : 39, end : 48 } ], start : 0, end : 39 } ] } ] [ { type : 'element', tag : 'p', start: 0, end: 54, children : [ { type : 'element', tag : 'div', rule: 'html', isBlock : false, attributes : { attribute : { type : 'indirect', name : 'attribute', textReference : 'TiddlerTitle!!field', start : 4, end : 38 } }, orderedAttributes: [ { type : 'indirect', name : 'attribute', textReference : 'TiddlerTitle!!field', start : 4, end : 38 } ], children : [ { type : 'text', text : 'some text', start : 39, end : 48 } ], start : 0, end : 54, openTagStart: 0, openTagEnd: 39, closeTagStart: 48, closeTagEnd: 54 } ] } ]
); );
expect(parse("<div attribute={{Tiddler Title!!field}}>some text</div>")).toEqual( expect(parse("<div attribute={{Tiddler Title!!field}}>some text</div>")).toEqual(
[ { type : 'element', tag : 'p', start: 0, end: 55, children : [ { type : 'element', tag : 'div', isBlock : false, attributes : { attribute : { type : 'indirect', name : 'attribute', textReference : 'Tiddler Title!!field', start : 4, end : 39 } }, orderedAttributes: [ { type : 'indirect', name : 'attribute', textReference : 'Tiddler Title!!field', start : 4, end : 39 } ], children : [ { type : 'text', text : 'some text', start : 40, end : 49 } ], start : 0, end : 40 } ] } ] [ { type : 'element', tag : 'p', start: 0, end: 55, children : [ { type : 'element', tag : 'div', rule: 'html', isBlock : false, attributes : { attribute : { type : 'indirect', name : 'attribute', textReference : 'Tiddler Title!!field', start : 4, end : 39 } }, orderedAttributes: [ { type : 'indirect', name : 'attribute', textReference : 'Tiddler Title!!field', start : 4, end : 39 } ], children : [ { type : 'text', text : 'some text', start : 40, end : 49 } ], start : 0, end : 55, openTagStart: 0, openTagEnd: 40, closeTagStart: 49, closeTagEnd: 55 } ] } ]
); );
expect(parse("<div attribute={{TiddlerTitle!!field}}>\n\nsome text</div>")).toEqual( expect(parse("<div attribute={{TiddlerTitle!!field}}>\n\nsome text</div>")).toEqual(
[ { type : 'element', start : 0, attributes : { attribute : { start : 4, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 38 } }, orderedAttributes: [ { start : 4, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 38 } ], tag : 'div', end : 39, isBlock : true, children : [ { type : 'element', tag : 'p', start : 41, end : 50, children : [ { type : 'text', text : 'some text', start : 41, end : 50 } ] } ] } ] [ { type : 'element', start : 0, attributes : { attribute : { start : 4, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 38 } }, orderedAttributes: [ { start : 4, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 38 } ], tag : 'div', rule: 'html', end : 56, openTagStart: 0, openTagEnd: 39, closeTagStart: 50, closeTagEnd: 56, isBlock : true, children : [ { type : 'element', tag : 'p', start : 41, end : 50, children : [ { type : 'text', text : 'some text', start : 41, end : 50 } ] } ] } ]
); );
expect(parse("<div><div attribute={{TiddlerTitle!!field}}>\n\nsome text</div></div>")).toEqual( expect(parse("<div><div attribute={{TiddlerTitle!!field}}>\n\nsome text</div></div>")).toEqual(
[ { type : 'element', tag : 'p', start: 0, end: 67, children : [ { type : 'element', start : 0, attributes : { }, orderedAttributes: [ ], tag : 'div', end : 5, isBlock : false, children : [ { type : 'element', start : 5, attributes : { attribute : { start : 9, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 43 } }, orderedAttributes: [ { start : 9, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 43 } ], tag : 'div', end : 44, isBlock : true, children : [ { type : 'element', tag : 'p', start : 46, end : 55, children : [ { type : 'text', text : 'some text', start : 46, end : 55 } ] } ] } ] } ] } ] [ { type : 'element', tag : 'p', start: 0, end: 67, children : [ { type : 'element', start : 0, end: 67, openTagStart: 0, openTagEnd: 5, closeTagStart: 61, closeTagEnd: 67, attributes : { }, orderedAttributes: [ ], tag : 'div', rule: 'html', isBlock : false, children : [ { type : 'element', start : 5, attributes : { attribute : { start : 9, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 43 } }, orderedAttributes: [ { start : 9, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 43 } ], tag : 'div', end : 61, openTagStart: 5, openTagEnd: 44, closeTagStart: 55, closeTagEnd: 61, rule: 'html', isBlock : true, children : [ { type : 'element', tag : 'p', start : 46, end : 55, children : [ { type : 'text', text : 'some text', start : 46, end : 55 } ] } ] } ] } ] } ]
); );
expect(parse("<div><div attribute={{TiddlerTitle!!field}}>\n\n!some heading</div></div>")).toEqual( expect(parse("<div><div attribute={{TiddlerTitle!!field}}>\n\n!some heading</div></div>")).toEqual(
[ { type : 'element', tag : 'p', start: 0, end: 71, children : [ { type : 'element', start : 0, attributes : { }, orderedAttributes: [ ], tag : 'div', end : 5, isBlock : false, children : [ { type : 'element', start : 5, attributes : { attribute : { start : 9, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 43 } }, orderedAttributes: [ { start : 9, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 43 } ], tag : 'div', end : 44, isBlock : true, children : [ { type : 'element', tag : 'h1', attributes : { class : { type : 'string', value : '' } }, children : [ { type : 'text', text : 'some heading</div></div>', start : 47, end : 71 } ] } ] } ] } ] } ] [ { type : 'element', tag : 'p', start: 0, end: 71, children : [ { type : 'element', start : 0, end: 71, openTagStart: 0, openTagEnd: 5, closeTagStart: 71, closeTagEnd: 71, attributes : { }, orderedAttributes: [ ], tag : 'div', rule: 'html', isBlock : false, children : [ { type : 'element', start : 5, attributes : { attribute : { start : 9, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 43 } }, orderedAttributes: [ { start : 9, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 43 } ], tag : 'div', end : 71, openTagStart: 5, openTagEnd: 44, closeTagStart: 71, closeTagEnd: 71, rule: 'html', isBlock : true, children : [ { type : 'element', tag : 'h1', start: 46, end: 71, rule: 'heading', attributes : { class : { type : 'string', value : '', start: 47, end: 47 } }, children : [ { type : 'text', text : 'some heading</div></div>', start : 47, end : 71 } ] } ] } ] } ] } ]
); );
expect(parse("<div><div attribute={{TiddlerTitle!!field}}>\n!some heading</div></div>")).toEqual( expect(parse("<div><div attribute={{TiddlerTitle!!field}}>\n!some heading</div></div>")).toEqual(
[ { type : 'element', tag : 'p', start: 0, end: 70, children : [ { type : 'element', start : 0, attributes : { }, orderedAttributes: [ ], tag : 'div', end : 5, isBlock : false, children : [ { type : 'element', start : 5, attributes : { attribute : { start : 9, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 43 } }, orderedAttributes: [ { start : 9, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 43 } ], tag : 'div', end : 44, isBlock : false, children : [ { type : 'text', text : '\n!some heading', start : 44, end : 58 } ] } ] } ] } ] [ { type : 'element', tag : 'p', start: 0, end: 70, children : [ { type : 'element', start : 0, end: 70, openTagStart: 0, openTagEnd: 5, closeTagStart: 64, closeTagEnd: 70, attributes : { }, orderedAttributes: [ ], tag : 'div', rule: 'html', isBlock : false, children : [ { type : 'element', start : 5, attributes : { attribute : { start : 9, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 43 } }, orderedAttributes: [ { start : 9, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 43 } ], tag : 'div', end : 64, openTagStart: 5, openTagEnd: 44, closeTagStart: 58, closeTagEnd: 64, rule: 'html', isBlock : false, children : [ { type : 'text', text : '\n!some heading', start : 44, end : 58 } ] } ] } ] } ]
); );
// Regression test for issue (#3306) // Regression test for issue (#3306)
expect(parse("<div><span><span>\n\nSome text</span></span></div>")).toEqual( expect(parse("<div><span><span>\n\nSome text</span></span></div>")).toEqual(
[ { type : 'element', tag : 'p', start: 0, end: 48, children : [ { type : 'element', start : 0, attributes : { }, orderedAttributes: [ ], tag : 'div', end : 5, isBlock : false, children : [ { type : 'element', start : 5, attributes : { }, orderedAttributes: [ ], tag : 'span', end : 11, isBlock : false, children : [ { type : 'element', start : 11, attributes : { }, orderedAttributes: [ ], tag : 'span', end : 17, isBlock : true, children : [ { type : 'element', tag : 'p', start : 19, end : 28, children : [ { type : 'text', text : 'Some text', start : 19, end : 28 } ] } ] } ] } ] } ] } ] [ { type : 'element', tag : 'p', start: 0, end: 48, children : [ { type : 'element', start : 0, end: 48, openTagStart: 0, openTagEnd: 5, closeTagStart: 42, closeTagEnd: 48, attributes : { }, orderedAttributes: [ ], tag : 'div', rule: 'html', isBlock : false, children : [ { type : 'element', start : 5, attributes : { }, orderedAttributes: [ ], tag : 'span', end : 42, openTagStart: 5, openTagEnd: 11, closeTagStart: 35, closeTagEnd: 42, rule: 'html', isBlock : false, children : [ { type : 'element', start : 11, attributes : { }, orderedAttributes: [ ], tag : 'span', end : 35, openTagStart: 11, openTagEnd: 17, closeTagStart: 28, closeTagEnd: 35, rule: 'html', isBlock : true, children : [ { type : 'element', tag : 'p', start : 19, end : 28, children : [ { type : 'text', text : 'Some text', start : 19, end : 28 } ] } ] } ] } ] } ] } ]
); );
}); });
@ -115,7 +114,7 @@ describe("WikiText parser tests", function() {
it("should parse macro definitions", function() { it("should parse macro definitions", function() {
expect(parse("\\define myMacro()\nnothing\n\\end\n")).toEqual( expect(parse("\\define myMacro()\nnothing\n\\end\n")).toEqual(
[{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[],"isMacroDefinition":true,"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}]}] [{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[],"isMacroDefinition":true,"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}],"start":0,"end":30,"rule":"macrodef"}]
); );
}); });
@ -123,7 +122,7 @@ describe("WikiText parser tests", function() {
it("should parse procedure definitions with no parameters", function() { it("should parse procedure definitions with no parameters", function() {
expect(parse("\\procedure myMacro()\nnothing\n\\end\n")).toEqual( expect(parse("\\procedure myMacro()\nnothing\n\\end\n")).toEqual(
[{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}],"isProcedureDefinition":true}] [{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}],"isProcedureDefinition":true,"start":0,"end":33,"rule":"fnprocdef"}]
); );
}); });
@ -131,7 +130,7 @@ describe("WikiText parser tests", function() {
it("should parse single line procedure definitions with no parameters", function() { it("should parse single line procedure definitions with no parameters", function() {
expect(parse("\\procedure myMacro() nothing\n")).toEqual( expect(parse("\\procedure myMacro() nothing\n")).toEqual(
[{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}],"isProcedureDefinition":true}] [{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}],"isProcedureDefinition":true,"start":0,"end":28,"rule":"fnprocdef"}]
); );
}); });
@ -139,7 +138,7 @@ describe("WikiText parser tests", function() {
it("should parse procedure definitions with parameters", function() { it("should parse procedure definitions with parameters", function() {
expect(parse("\\procedure myMacro(one,two,three,four:elephant)\nnothing\n\\end\n")).toEqual( expect(parse("\\procedure myMacro(one,two,three,four:elephant)\nnothing\n\\end\n")).toEqual(
[{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[{"name":"one"},{"name":"two"},{"name":"three"},{"name":"four","default":"elephant"}],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}],"isProcedureDefinition":true}] [{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[{"name":"one"},{"name":"two"},{"name":"three"},{"name":"four","default":"elephant"}],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}],"isProcedureDefinition":true,"start":0,"end":60,"rule":"fnprocdef"}]
); );
}); });
@ -147,14 +146,14 @@ describe("WikiText parser tests", function() {
it("should parse procedure definitions", function() { it("should parse procedure definitions", function() {
expect(parse("\\procedure myMacro(one:'Jaguar')\n<$text text=<<one>>/>\n\\end\n\n")).toEqual( expect(parse("\\procedure myMacro(one:'Jaguar')\n<$text text=<<one>>/>\n\\end\n\n")).toEqual(
[{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"<$text text=<<one>>/>"}},"children":[],"params":[{"name":"one","default":"Jaguar"}],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"<$text text=<<one>>/>"}],"isProcedureDefinition":true}] [{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"<$text text=<<one>>/>"}},"children":[],"params":[{"name":"one","default":"Jaguar"}],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"<$text text=<<one>>/>"}],"isProcedureDefinition":true,"start":0,"end":59,"rule":"fnprocdef"}]
); );
}); it("should parse function definitions with no parameters", function() { }); it("should parse function definitions with no parameters", function() {
expect(parse("\\function myMacro()\nnothing\n\\end\n")).toEqual( expect(parse("\\function myMacro()\nnothing\n\\end\n")).toEqual(
[{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}],"isFunctionDefinition":true}] [{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}],"isFunctionDefinition":true,"start":0,"end":32,"rule":"fnprocdef"}]
); );
}); });
@ -162,7 +161,7 @@ describe("WikiText parser tests", function() {
it("should parse single line function definitions with no parameters", function() { it("should parse single line function definitions with no parameters", function() {
expect(parse("\\function myMacro() nothing\n")).toEqual( expect(parse("\\function myMacro() nothing\n")).toEqual(
[{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}],"isFunctionDefinition":true}] [{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}],"isFunctionDefinition":true,"start":0,"end":27,"rule":"fnprocdef"}]
); );
}); });
@ -170,7 +169,7 @@ describe("WikiText parser tests", function() {
it("should parse function definitions with parameters", function() { it("should parse function definitions with parameters", function() {
expect(parse("\\function myMacro(one,two,three,four:elephant)\nnothing\n\\end\n")).toEqual( expect(parse("\\function myMacro(one,two,three,four:elephant)\nnothing\n\\end\n")).toEqual(
[{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[{"name":"one"},{"name":"two"},{"name":"three"},{"name":"four","default":"elephant"}],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}],"isFunctionDefinition":true}] [{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[{"name":"one"},{"name":"two"},{"name":"three"},{"name":"four","default":"elephant"}],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}],"isFunctionDefinition":true,"start":0,"end":59,"rule":"fnprocdef"}]
); );
}); });
@ -178,7 +177,7 @@ describe("WikiText parser tests", function() {
it("should parse function definitions", function() { it("should parse function definitions", function() {
expect(parse("\\function myMacro(one:'Jaguar')\n<$text text=<<one>>/>\n\\end\n\n")).toEqual( expect(parse("\\function myMacro(one:'Jaguar')\n<$text text=<<one>>/>\n\\end\n\n")).toEqual(
[{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"<$text text=<<one>>/>"}},"children":[],"params":[{"name":"one","default":"Jaguar"}],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"<$text text=<<one>>/>"}],"isFunctionDefinition":true}] [{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"<$text text=<<one>>/>"}},"children":[],"params":[{"name":"one","default":"Jaguar"}],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"<$text text=<<one>>/>"}],"isFunctionDefinition":true,"start":0,"end":58,"rule":"fnprocdef"}]
); );
}); });
@ -186,7 +185,7 @@ describe("WikiText parser tests", function() {
it("should parse comment in pragma area. Comment will be invisible", function() { it("should parse comment in pragma area. Comment will be invisible", function() {
expect(parse("<!-- comment in pragma area -->\n\\define aMacro()\nnothing\n\\end\n")).toEqual( expect(parse("<!-- comment in pragma area -->\n\\define aMacro()\nnothing\n\\end\n")).toEqual(
[{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"aMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[],"isMacroDefinition":true,"orderedAttributes":[{"name":"name","type":"string","value":"aMacro"},{"name":"value","type":"string","value":"nothing"}]}] [{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"aMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[],"isMacroDefinition":true,"orderedAttributes":[{"name":"name","type":"string","value":"aMacro"},{"name":"value","type":"string","value":"nothing"}],"start":32,"end":61,"rule":"macrodef"}]
); );
}); });
@ -194,12 +193,12 @@ describe("WikiText parser tests", function() {
it("should block mode filtered transclusions", function() { it("should block mode filtered transclusions", function() {
expect(parse("{{{ filter }}}")).toEqual( expect(parse("{{{ filter }}}")).toEqual(
[ { type: 'list', attributes: { filter: { type: 'string', value: ' filter ' } }, isBlock: true } ] [ { type: 'list', attributes: { filter: { type: 'string', value: ' filter ', start: 3, end: 11 } }, isBlock: true, start: 0, end: 14, rule: "filteredtranscludeblock" } ]
); );
expect(parse("{{{ fil\nter }}}")).toEqual( expect(parse("{{{ fil\nter }}}")).toEqual(
[ { type: 'list', attributes: { filter: { type: 'string', value: ' fil\nter ' } }, isBlock: true } ] [ { type: 'list', attributes: { filter: { type: 'string', value: ' fil\nter ', start: 3, end: 12 } }, isBlock: true, start: 0, end: 15, rule: "filteredtranscludeblock" } ]
); );
}); });
@ -207,38 +206,38 @@ describe("WikiText parser tests", function() {
it("should parse inline macro calls", function() { it("should parse inline macro calls", function() {
expect(parse("<<john>><<paul>><<george>><<ringo>>")).toEqual( expect(parse("<<john>><<paul>><<george>><<ringo>>")).toEqual(
[{"type":"element","tag":"p","children":[{"type":"transclude","start":0,"end":8,"attributes":{"$variable":{"name":"$variable","type":"string","value":"john"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"}]},{"type":"transclude","start":8,"end":16,"attributes":{"$variable":{"name":"$variable","type":"string","value":"paul"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"paul"}]},{"type":"transclude","start":16,"end":26,"attributes":{"$variable":{"name":"$variable","type":"string","value":"george"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"george"}]},{"type":"transclude","start":26,"end":35,"attributes":{"$variable":{"name":"$variable","type":"string","value":"ringo"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"ringo"}]}],"start":0,"end":35}] [{"type":"element","tag":"p","children":[{"type":"transclude","start":0,"end":8,"rule":"macrocallinline","attributes":{"$variable":{"name":"$variable","type":"string","value":"john"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"}]},{"type":"transclude","start":8,"end":16,"rule":"macrocallinline","attributes":{"$variable":{"name":"$variable","type":"string","value":"paul"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"paul"}]},{"type":"transclude","start":16,"end":26,"rule":"macrocallinline","attributes":{"$variable":{"name":"$variable","type":"string","value":"george"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"george"}]},{"type":"transclude","start":26,"end":35,"rule":"macrocallinline","attributes":{"$variable":{"name":"$variable","type":"string","value":"ringo"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"ringo"}]}],"start":0,"end":35}]
); );
expect(parse("text <<john one:val1 two: 'val \"2\"' three: \"val '3'\" four: \"\"\"val 4\"5'\"\"\" five: [[val 5]] >>")).toEqual( expect(parse("text <<john one:val1 two: 'val \"2\"' three: \"val '3'\" four: \"\"\"val 4\"5'\"\"\" five: [[val 5]] >>")).toEqual(
[{"type":"element","tag":"p","children":[{"type":"text","text":"text ","start":0,"end":5},{"type":"transclude","start":5,"end":92,"attributes":{"$variable":{"name":"$variable","type":"string","value":"john"},"one":{"name":"one","type":"string","value":"val1","start":11,"end":20},"two":{"name":"two","type":"string","value":"val \"2\"","start":20,"end":35},"three":{"name":"three","type":"string","value":"val '3'","start":35,"end":52},"four":{"name":"four","type":"string","value":"val 4\"5'","start":52,"end":73},"five":{"name":"five","type":"string","value":"val 5","start":73,"end":89}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"},{"name":"one","type":"string","value":"val1","start":11,"end":20},{"name":"two","type":"string","value":"val \"2\"","start":20,"end":35},{"name":"three","type":"string","value":"val '3'","start":35,"end":52},{"name":"four","type":"string","value":"val 4\"5'","start":52,"end":73},{"name":"five","type":"string","value":"val 5","start":73,"end":89}]}],"start":0,"end":92}] [{"type":"element","tag":"p","children":[{"type":"text","text":"text ","start":0,"end":5},{"type":"transclude","start":5,"end":92,"rule":"macrocallinline","attributes":{"$variable":{"name":"$variable","type":"string","value":"john"},"one":{"name":"one","type":"string","value":"val1","start":11,"end":20},"two":{"name":"two","type":"string","value":"val \"2\"","start":20,"end":35},"three":{"name":"three","type":"string","value":"val '3'","start":35,"end":52},"four":{"name":"four","type":"string","value":"val 4\"5'","start":52,"end":73},"five":{"name":"five","type":"string","value":"val 5","start":73,"end":89}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"},{"name":"one","type":"string","value":"val1","start":11,"end":20},{"name":"two","type":"string","value":"val \"2\"","start":20,"end":35},{"name":"three","type":"string","value":"val '3'","start":35,"end":52},{"name":"four","type":"string","value":"val 4\"5'","start":52,"end":73},{"name":"five","type":"string","value":"val 5","start":73,"end":89}]}],"start":0,"end":92}]
); );
expect(parse("ignored << carrots <<john>>")).toEqual( expect(parse("ignored << carrots <<john>>")).toEqual(
[{"type":"element","tag":"p","children":[{"type":"text","text":"ignored << carrots ","start":0,"end":19},{"type":"transclude","start":19,"end":27,"attributes":{"$variable":{"name":"$variable","type":"string","value":"john"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"}]}],"start":0,"end":27}] [{"type":"element","tag":"p","children":[{"type":"text","text":"ignored << carrots ","start":0,"end":19},{"type":"transclude","start":19,"end":27,"rule":"macrocallinline","attributes":{"$variable":{"name":"$variable","type":"string","value":"john"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"}]}],"start":0,"end":27}]
); );
expect(parse("text <<<john>>")).toEqual( expect(parse("text <<<john>>")).toEqual(
[{"type":"element","tag":"p","children":[{"type":"text","text":"text ","start":0,"end":5},{"type":"transclude","start":5,"end":14,"attributes":{"$variable":{"name":"$variable","type":"string","value":"<john"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"<john"}]}],"start":0,"end":14}] [{"type":"element","tag":"p","children":[{"type":"text","text":"text ","start":0,"end":5},{"type":"transclude","start":5,"end":14,"rule":"macrocallinline","attributes":{"$variable":{"name":"$variable","type":"string","value":"<john"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"<john"}]}],"start":0,"end":14}]
); );
expect(parse("before\n<<john>>")).toEqual( expect(parse("before\n<<john>>")).toEqual(
[{"type":"element","tag":"p","children":[{"type":"text","text":"before\n","start":0,"end":7},{"type":"transclude","start":7,"end":15,"attributes":{"$variable":{"name":"$variable","type":"string","value":"john"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"}]}],"start":0,"end":15}] [{"type":"element","tag":"p","children":[{"type":"text","text":"before\n","start":0,"end":7},{"type":"transclude","start":7,"end":15,"rule":"macrocallinline","attributes":{"$variable":{"name":"$variable","type":"string","value":"john"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"}]}],"start":0,"end":15}]
); );
// A single space will cause it to be inline // A single space will cause it to be inline
expect(parse("<<john>> ")).toEqual( expect(parse("<<john>> ")).toEqual(
[{"type":"element","tag":"p","children":[{"type":"transclude","start":0,"end":8,"attributes":{"$variable":{"name":"$variable","type":"string","value":"john"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"}]},{"type":"text","text":" ","start":8,"end":9}],"start":0,"end":9}] [{"type":"element","tag":"p","children":[{"type":"transclude","start":0,"end":8,"rule":"macrocallinline","attributes":{"$variable":{"name":"$variable","type":"string","value":"john"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"}]},{"type":"text","text":" ","start":8,"end":9}],"start":0,"end":9}]
); );
expect(parse("text <<outie one:'my <<innie>>' >>")).toEqual( expect(parse("text <<outie one:'my <<innie>>' >>")).toEqual(
[{"type":"element","tag":"p","children":[{"type":"text","text":"text ","start":0,"end":5},{"type":"transclude","start":5,"end":34,"attributes":{"$variable":{"name":"$variable","type":"string","value":"outie"},"one":{"name":"one","type":"string","value":"my <<innie>>","start":12,"end":31}},"orderedAttributes":[{"name":"$variable","type":"string","value":"outie"},{"name":"one","type":"string","value":"my <<innie>>","start":12,"end":31}]}],"start":0,"end":34}] [{"type":"element","tag":"p","children":[{"type":"text","text":"text ","start":0,"end":5},{"type":"transclude","start":5,"end":34,"rule":"macrocallinline","attributes":{"$variable":{"name":"$variable","type":"string","value":"outie"},"one":{"name":"one","type":"string","value":"my <<innie>>","start":12,"end":31}},"orderedAttributes":[{"name":"$variable","type":"string","value":"outie"},{"name":"one","type":"string","value":"my <<innie>>","start":12,"end":31}]}],"start":0,"end":34}]
); );
@ -247,37 +246,37 @@ describe("WikiText parser tests", function() {
it("should parse block macro calls", function() { it("should parse block macro calls", function() {
expect(parse("<<john>>\n<<paul>>\r\n<<george>>\n<<ringo>>")).toEqual( expect(parse("<<john>>\n<<paul>>\r\n<<george>>\n<<ringo>>")).toEqual(
[ { type: 'transclude', start: 0, attributes: { $variable: { name: "$variable", type: "string", value: "john" }}, orderedAttributes: [ { name: "$variable", type: "string", value: "john" }], end: 8, isBlock: true }, { type: 'transclude', start: 9, attributes: { $variable: { name: "$variable", type: "string", value: "paul" }}, orderedAttributes: [ { name: "$variable", type: "string", value: "paul" }], end: 17, isBlock: true }, { type: 'transclude', start: 19, attributes: { $variable: { name: "$variable", type: "string", value: "george" }}, orderedAttributes: [ { name: "$variable", type: "string", value: "george" }], end: 29, isBlock: true }, { type: 'transclude', start: 30, attributes: { $variable: { name: "$variable", type: "string", value: "ringo" }}, orderedAttributes: [ { name: "$variable", type: "string", value: "ringo" }], end: 39, isBlock: true } ] [ { type: 'transclude', start: 0, rule: 'macrocallblock', attributes: { $variable: { name: "$variable", type: "string", value: "john" }}, orderedAttributes: [ { name: "$variable", type: "string", value: "john" }], end: 8, isBlock: true }, { type: 'transclude', start: 9, rule: 'macrocallblock', attributes: { $variable: { name: "$variable", type: "string", value: "paul" }}, orderedAttributes: [ { name: "$variable", type: "string", value: "paul" }], end: 17, isBlock: true }, { type: 'transclude', start: 19, rule: 'macrocallblock', attributes: { $variable: { name: "$variable", type: "string", value: "george" }}, orderedAttributes: [ { name: "$variable", type: "string", value: "george" }], end: 29, isBlock: true }, { type: 'transclude', start: 30, rule: 'macrocallblock', attributes: { $variable: { name: "$variable", type: "string", value: "ringo" }}, orderedAttributes: [ { name: "$variable", type: "string", value: "ringo" }], end: 39, isBlock: true } ]
); );
expect(parse("<<john one:val1 two: 'val \"2\"' three: \"val '3'\" four: \"\"\"val 4\"5'\"\"\" five: [[val 5]] >>")).toEqual( expect(parse("<<john one:val1 two: 'val \"2\"' three: \"val '3'\" four: \"\"\"val 4\"5'\"\"\" five: [[val 5]] >>")).toEqual(
[{"type":"transclude","start":0,"end":87,"attributes":{"$variable":{"name":"$variable","type":"string","value":"john"},"one":{"name":"one","type":"string","value":"val1","start":6,"end":15},"two":{"name":"two","type":"string","value":"val \"2\"","start":15,"end":30},"three":{"name":"three","type":"string","value":"val '3'","start":30,"end":47},"four":{"name":"four","type":"string","value":"val 4\"5'","start":47,"end":68},"five":{"name":"five","type":"string","value":"val 5","start":68,"end":84}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"},{"name":"one","type":"string","value":"val1","start":6,"end":15},{"name":"two","type":"string","value":"val \"2\"","start":15,"end":30},{"name":"three","type":"string","value":"val '3'","start":30,"end":47},{"name":"four","type":"string","value":"val 4\"5'","start":47,"end":68},{"name":"five","type":"string","value":"val 5","start":68,"end":84}],"isBlock":true}] [{"type":"transclude","start":0,"end":87,"rule":"macrocallblock","attributes":{"$variable":{"name":"$variable","type":"string","value":"john"},"one":{"name":"one","type":"string","value":"val1","start":6,"end":15},"two":{"name":"two","type":"string","value":"val \"2\"","start":15,"end":30},"three":{"name":"three","type":"string","value":"val '3'","start":30,"end":47},"four":{"name":"four","type":"string","value":"val 4\"5'","start":47,"end":68},"five":{"name":"five","type":"string","value":"val 5","start":68,"end":84}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"},{"name":"one","type":"string","value":"val1","start":6,"end":15},{"name":"two","type":"string","value":"val \"2\"","start":15,"end":30},{"name":"three","type":"string","value":"val '3'","start":30,"end":47},{"name":"four","type":"string","value":"val 4\"5'","start":47,"end":68},{"name":"five","type":"string","value":"val 5","start":68,"end":84}],"isBlock":true}]
); );
expect(parse("<< carrots\n\n<<john>>")).toEqual( expect(parse("<< carrots\n\n<<john>>")).toEqual(
[ { type: 'element', tag: 'p', start : 0, end : 10, children: [ { type: 'text', text: '<< carrots', start : 0, end : 10 } ] }, { type: 'transclude', start: 12, attributes: { $variable: {name: "$variable", type:"string", value: "john"} }, orderedAttributes: [ {name: "$variable", type:"string", value: "john"} ], end: 20, isBlock: true } ] [ { type: 'element', tag: 'p', start : 0, end : 10, children: [ { type: 'text', text: '<< carrots', start : 0, end : 10 } ] }, { type: 'transclude', start: 12, rule: 'macrocallblock', attributes: { $variable: {name: "$variable", type:"string", value: "john"} }, orderedAttributes: [ {name: "$variable", type:"string", value: "john"} ], end: 20, isBlock: true } ]
); );
expect(parse("before\n\n<<john>>")).toEqual( expect(parse("before\n\n<<john>>")).toEqual(
[ { type: 'element', tag: 'p', start : 0, end : 6, children: [ { type: 'text', text: 'before', start : 0, end : 6 } ] }, { type: 'transclude', start: 8, attributes: { $variable: {name: "$variable", type:"string", value: "john"} }, orderedAttributes: [ {name: "$variable", type:"string", value: "john"} ], end: 16, isBlock: true } ] [ { type: 'element', tag: 'p', start : 0, end : 6, children: [ { type: 'text', text: 'before', start : 0, end : 6 } ] }, { type: 'transclude', start: 8, rule: 'macrocallblock', attributes: { $variable: {name: "$variable", type:"string", value: "john"} }, orderedAttributes: [ {name: "$variable", type:"string", value: "john"} ], end: 16, isBlock: true } ]
); );
expect(parse("<<john>>\nafter")).toEqual( expect(parse("<<john>>\nafter")).toEqual(
[ { type: 'transclude', start: 0, attributes: { $variable: {name: "$variable", type:"string", value: "john"} }, orderedAttributes: [ {name: "$variable", type:"string", value: "john"} ], end: 8, isBlock: true }, { type: 'element', tag: 'p', start: 9, end: 14, children: [ { type: 'text', text: 'after', start: 9, end: 14 } ] } ] [ { type: 'transclude', start: 0, rule: 'macrocallblock', attributes: { $variable: {name: "$variable", type:"string", value: "john"} }, orderedAttributes: [ {name: "$variable", type:"string", value: "john"} ], end: 8, isBlock: true }, { type: 'element', tag: 'p', start: 9, end: 14, children: [ { type: 'text', text: 'after', start: 9, end: 14 } ] } ]
); );
expect(parse("<<multiline arg:\"\"\"\n\nwikitext\n\"\"\" >>")).toEqual( expect(parse("<<multiline arg:\"\"\"\n\nwikitext\n\"\"\" >>")).toEqual(
[{"type":"transclude","start":0,"end":36,"attributes":{"$variable":{"name":"$variable","type":"string","value":"multiline"},"arg":{"name":"arg","type":"string","value":"\n\nwikitext\n","start":11,"end":33}},"orderedAttributes":[{"name":"$variable","type":"string","value":"multiline"},{"name":"arg","type":"string","value":"\n\nwikitext\n","start":11,"end":33}],"isBlock":true}] [{"type":"transclude","start":0,"end":36,"rule":"macrocallblock","attributes":{"$variable":{"name":"$variable","type":"string","value":"multiline"},"arg":{"name":"arg","type":"string","value":"\n\nwikitext\n","start":11,"end":33}},"orderedAttributes":[{"name":"$variable","type":"string","value":"multiline"},{"name":"arg","type":"string","value":"\n\nwikitext\n","start":11,"end":33}],"isBlock":true}]
); );
expect(parse("<<outie one:'my <<innie>>' >>")).toEqual( expect(parse("<<outie one:'my <<innie>>' >>")).toEqual(
[ { type: 'transclude', start: 0, attributes: { $variable: {name: "$variable", type:"string", value: "outie"}, one: {name: "one", type:"string", value: "my <<innie>>", start: 7, end: 26} }, orderedAttributes: [ {name: "$variable", type:"string", value: "outie"}, {name: "one", type:"string", value: "my <<innie>>", start: 7, end: 26} ], end: 29, isBlock: true } ] [ { type: 'transclude', start: 0, rule: 'macrocallblock', attributes: { $variable: {name: "$variable", type:"string", value: "outie"}, one: {name: "one", type:"string", value: "my <<innie>>", start: 7, end: 26} }, orderedAttributes: [ {name: "$variable", type:"string", value: "outie"}, {name: "one", type:"string", value: "my <<innie>>", start: 7, end: 26} ], end: 29, isBlock: true } ]
); );
}); });
@ -285,23 +284,23 @@ describe("WikiText parser tests", function() {
it("should parse tricky macrocall parameters", function() { it("should parse tricky macrocall parameters", function() {
expect(parse("<<john pa>am>>")).toEqual( expect(parse("<<john pa>am>>")).toEqual(
[{"type":"transclude","start":0,"end":14,"attributes":{"0":{"name":"0","type":"string","value":"pa>am","start":6,"end":12},"$variable":{"name":"$variable","type":"string","value":"john"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"},{"name":"0","type":"string","value":"pa>am","start":6,"end":12}],"isBlock":true}] [{"type":"transclude","start":0,"end":14,"attributes":{"0":{"name":"0","type":"string","value":"pa>am","start":6,"end":12},"$variable":{"name":"$variable","type":"string","value":"john"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"},{"name":"0","type":"string","value":"pa>am","start":6,"end":12}],"isBlock":true,"rule":"macrocallblock"}]
); );
expect(parse("<<john param> >>")).toEqual( expect(parse("<<john param> >>")).toEqual(
[{"type":"transclude","start":0,"end":16,"attributes":{"0":{"name":"0","type":"string","value":"param>","start":6,"end":13},"$variable":{"name":"$variable","type":"string","value":"john"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"},{"name":"0","type":"string","value":"param>","start":6,"end":13}],"isBlock":true}] [{"type":"transclude","start":0,"end":16,"attributes":{"0":{"name":"0","type":"string","value":"param>","start":6,"end":13},"$variable":{"name":"$variable","type":"string","value":"john"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"},{"name":"0","type":"string","value":"param>","start":6,"end":13}],"isBlock":true,"rule":"macrocallblock"}]
); );
expect(parse("<<john param>>>")).toEqual( expect(parse("<<john param>>>")).toEqual(
[{"type":"element","tag":"p","children":[{"type":"transclude","start":0,"end":14,"attributes":{"0":{"name":"0","type":"string","value":"param","start":6,"end":12},"$variable":{"name":"$variable","type":"string","value":"john"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"},{"name":"0","type":"string","value":"param","start":6,"end":12}]},{"type":"text","text":">","start":14,"end":15}],"start":0,"end":15}] [{"type":"element","tag":"p","children":[{"type":"transclude","start":0,"end":14,"rule":"macrocallinline","attributes":{"0":{"name":"0","type":"string","value":"param","start":6,"end":12},"$variable":{"name":"$variable","type":"string","value":"john"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"},{"name":"0","type":"string","value":"param","start":6,"end":12}]},{"type":"text","text":">","start":14,"end":15}],"start":0,"end":15}]
); );
// equals signs should be allowed // equals signs should be allowed
expect(parse("<<john var>=4 >>")).toEqual( expect(parse("<<john var>=4 >>")).toEqual(
[{"type":"transclude","start":0,"end":16,"attributes":{"0":{"name":"0","type":"string","value":"var>=4","start":6,"end":13},"$variable":{"name":"$variable","type":"string","value":"john"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"},{"name":"0","type":"string","value":"var>=4","start":6,"end":13}],"isBlock":true}] [{"type":"transclude","start":0,"end":16,"attributes":{"0":{"name":"0","type":"string","value":"var>=4","start":6,"end":13},"$variable":{"name":"$variable","type":"string","value":"john"}},"orderedAttributes":[{"name":"$variable","type":"string","value":"john"},{"name":"0","type":"string","value":"var>=4","start":6,"end":13}],"isBlock":true,"rule":"macrocallblock"}]
); );
@ -310,7 +309,7 @@ describe("WikiText parser tests", function() {
it("should parse horizontal rules", function() { it("should parse horizontal rules", function() {
expect(parse("---Not a rule\n\n----\n\nBetween\n\n---")).toEqual( expect(parse("---Not a rule\n\n----\n\nBetween\n\n---")).toEqual(
[ { type : 'element', tag : 'p', start : 0, end : 13, children : [ { type : 'entity', entity : '&mdash;' }, { type : 'text', text : 'Not a rule', start : 3, end : 13 } ] }, { type : 'element', tag : 'hr' }, { type : 'element', tag : 'p', start : 21, end : 28, children : [ { type : 'text', text : 'Between', start : 21, end : 28 } ] }, { type : 'element', tag : 'hr' } ] [ { type : 'element', tag : 'p', start : 0, end : 13, children : [ { type : 'entity', entity : '&mdash;', start: 0, end: 3, rule: 'dash' }, { type : 'text', text : 'Not a rule', start : 3, end : 13 } ] }, { type : 'element', tag : 'hr', start: 15, end: 20, rule: 'horizrule' }, { type : 'element', tag : 'p', start : 21, end : 28, children : [ { type : 'text', text : 'Between', start : 21, end : 28 } ] }, { type : 'element', tag : 'hr', start: 30, end: 33, rule: 'horizrule' } ]
); );
@ -319,7 +318,7 @@ describe("WikiText parser tests", function() {
it("should parse hard linebreak areas", function() { it("should parse hard linebreak areas", function() {
expect(parse("\"\"\"Something\nin the\nway she moves\n\"\"\"\n\n")).toEqual( expect(parse("\"\"\"Something\nin the\nway she moves\n\"\"\"\n\n")).toEqual(
[ { type : 'element', tag : 'p', children : [ { type : 'text', text : 'Something', start : 3, end : 12 }, { type : 'element', tag : 'br' }, { type : 'text', text : 'in the', start : 13, end : 19 }, { type : 'element', tag : 'br' }, { type : 'text', text : 'way she moves', start : 20, end : 33 }, { type : 'element', tag : 'br' } ], start : 0, end : 37 } ] [ { type : 'element', tag : 'p', children : [ { type : 'text', text : 'Something', start : 3, end : 12, rule: 'hardlinebreaks' }, { type : 'element', tag : 'br', rule: 'hardlinebreaks', start: 12, end: 13 }, { type : 'text', text : 'in the', start : 13, end : 19, rule: 'hardlinebreaks' }, { type : 'element', tag : 'br', rule: 'hardlinebreaks', start: 19, end: 20 }, { type : 'text', text : 'way she moves', start : 20, end : 33, rule: 'hardlinebreaks' }, { type : 'element', tag : 'br', rule: 'hardlinebreaks', start: 33, end: 34 } ], start : 0, end : 37 } ]
); );

View File

@ -8,7 +8,7 @@ tags: About
5.1.10 5.1.11 5.1.12 5.1.13 5.1.14 5.1.15 5.1.16 5.1.17 5.1.18 5.1.19 5.1.10 5.1.11 5.1.12 5.1.13 5.1.14 5.1.15 5.1.16 5.1.17 5.1.18 5.1.19
5.1.20 5.1.21 5.1.22 5.1.23 5.1.20 5.1.21 5.1.22 5.1.23
5.2.0 5.2.1 5.2.2 5.2.3 5.2.4 5.2.5 5.2.6 5.2.7 5.2.0 5.2.1 5.2.2 5.2.3 5.2.4 5.2.5 5.2.6 5.2.7
5.3.0 5.3.1 5.3.0 5.3.1 5.3.2 5.3.3
\end \end
Older versions of TiddlyWiki are available in the [[archive|https://github.com/Jermolene/jermolene.github.io/tree/master/archive]]: Older versions of TiddlyWiki are available in the [[archive|https://github.com/Jermolene/jermolene.github.io/tree/master/archive]]:

View File

@ -1,10 +1,10 @@
created: 20150123220237000 created: 20150123220237000
modified: 20150226163104000 modified: 20240610085736941
tags: Concepts tags: Concepts
title: Hard and Soft Links title: Hard and Soft Links
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
A <<.def "hard link">> is one that can be detected by a superficial examination of WikiText. A <<.def "hard link">> is a [[link|Linking in WikiText]] that can be detected by a superficial examination of WikiText.
A link is <<.def "soft">> if it is: A link is <<.def "soft">> if it is:
@ -13,3 +13,5 @@ A link is <<.def "soft">> if it is:
* generated by a link widget whose <<.attr to>> attribute is a transclusion, macro or variable * generated by a link widget whose <<.attr to>> attribute is a transclusion, macro or variable
<$macrocall $name=".warning" _="""Soft links are not detected by link-related filter operators such as <<.olink backlinks>>, <<.olink links>>, <<.olink all>> and <<.olink is>>."""/> <$macrocall $name=".warning" _="""Soft links are not detected by link-related filter operators such as <<.olink backlinks>>, <<.olink links>>, <<.olink all>> and <<.olink is>>."""/>
This concept is analogous to [[Hard and Soft Transclusions]].

View File

@ -0,0 +1,16 @@
created: 20240610085133221
modified: 20240610085613037
tags: Concepts
title: Hard and Soft Transclusions
A <<.def "hard transclusion">> is a [[transclusion|Transclusion]] that can be detected by a superficial examination of WikiText.
A transclusion is <<.def "soft">> if it is:
* contained in text [[trancluded|Transclusion]] from elsewhere
* supplied via a [[macro|Macros]], [[procedure|Procedures]] or [[variable|Variables]]
* generated by a [[transclude widget|TranscludeWidget]] whose <<.attr $tiddler>> attribute is a transclusion, macro or variable
<$macrocall $name=".warning" _="""Soft transclusions are not detected by transclusion-related filter operators <<.olink transcludes>> and <<.olink backtranscludes>>."""/>
This concept is analogous to [[Hard and Soft Links]].

View File

@ -1,9 +1,15 @@
created: 20141129194651420 created: 20141129194651420
modified: 20141130195444237 modified: 20240621074019077
tags: Concepts tags: Concepts Definitions
title: Transclusion title: Transclusion
[[Transclusion|https://en.wikipedia.org/wiki/Transclusion]] is the process of referencing one tiddler "A" from another tiddler "B" such that the content of "A" appears to be a part of "B". ! Definition
<<< Wikipedia: [[Transclusion|https://en.wikipedia.org/wiki/Transclusion]]
In computer science, transclusion is the inclusion of part or all of an electronic document into one or more other documents by reference via hypertext.
<<<
In ~TiddlyWiki: ''Transclusion'' is the process of referencing one tiddler "A" from another tiddler "B" such that the content of "A" appears to be a part of "B".
Copying and pasting content creates multiple copies of the same content in several different places. With transclusion, there can be a single copy and a special instruction in "B" which indicates the point at which content should be inserted from tiddler "A". Copying and pasting content creates multiple copies of the same content in several different places. With transclusion, there can be a single copy and a special instruction in "B" which indicates the point at which content should be inserted from tiddler "A".
@ -20,3 +26,4 @@ To learn more:
* TextReference * TextReference
* TemplateTiddlers * TemplateTiddlers
* TranscludeWidget * TranscludeWidget
* [[Hard and Soft Transclusions]]

View File

@ -1,13 +1,14 @@
caption: backtranscludes
created: 20211002204500000 created: 20211002204500000
modified: 20240610085949413
op-input: a [[selection of titles|Title Selection]]
op-output: any non-[[system|SystemTiddlers]] titles that [[hard-transclude|Hard and Soft Transclusions]] the input titles
op-parameter: none
op-purpose: find the titles that transclude each input title
tags: [[Filter Operators]] tags: [[Filter Operators]]
title: backtranscludes Operator title: backtranscludes Operator
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
caption: backtranscludes
op-purpose: find the titles that transcludes to each input title
op-input: a [[selection of titles|Title Selection]]
op-parameter: none
op-output: any non-[[system|SystemTiddlers]] titles that contain [[transclusion|Transclusion]] to the input titles
<<.from-version 5.3.4>> Similar to [[backlinks|backlinks Operator]]. Each input title is processed in turn. The corresponding tiddler's list of backtranscludes is generated, sorted alphabetically by title, and then [[dominantly appended|Dominant Append]] to the operator's overall output. <<.from-version 5.3.4>> Each input title is processed in turn. The corresponding tiddler's list of backtransclusions is generated, sorted alphabetically by title, and then [[dominantly appended|Dominant Append]] to the operator's overall output. Analogous to [[backlinks|backlinks Operator]].
<<.operator-examples "backtranscludes">> <<.operator-examples "backtranscludes">>

View File

@ -1,12 +1,12 @@
caption: minlength caption: minlength
created: 20161011074235805 created: 20161011074235805
modified: 20161011074235805 from-version: 5.1.14
modified: 20240621073052597
op-input: a list of items op-input: a list of items
op-output: those items at least as long as the specified minimum length op-output: those items at least as long as the specified minimum length
op-parameter: the minimum length for items op-parameter: the minimum length for items
op-parameter-name: minlength op-parameter-name: minlength
op-purpose: filter items shorter than the specified minimum length op-purpose: filter items whose length is greater than the specified minimum length
from-version: 5.1.14
tags: [[Filter Operators]] tags: [[Filter Operators]]
title: minlength Operator title: minlength Operator
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki

View File

@ -1,6 +1,6 @@
caption: splitregexp caption: splitregexp
created: 20190613154722705 created: 20190613154722705
modified: 20190613154924724 modified: 20240606113433618
op-input: a [[selection of titles|Title Selection]] op-input: a [[selection of titles|Title Selection]]
op-output: the input titles split into separate items according to the specified regular expression <<.place R>> op-output: the input titles split into separate items according to the specified regular expression <<.place R>>
op-parameter: The regular expression at which to split each title op-parameter: The regular expression at which to split each title
@ -13,7 +13,7 @@ type: text/vnd.tiddlywiki
<<.from-version "5.1.20">> <<.from-version "5.1.20">>
Note that in some circumstances the <<.op splitregexp>> operator will include blank items in the list of results. For example, <<.note """... that in some circumstances the <<.op splitregexp>> operator will include blank items in the list of results. For example, """>>
``` ```
[[the band thethe are the best the]splitregexp[the]] [[the band thethe are the best the]splitregexp[the]]
@ -42,3 +42,21 @@ Syntax errors in the regular expression will cause the filter to return an error
<<.operator-example 2 "[[the cat sat on the mat]splitregexp[\]]">> <<.operator-example 2 "[[the cat sat on the mat]splitregexp[\]]">>
<<.operator-examples "splitregexp">> <<.operator-examples "splitregexp">>
----
The <<.op splitregexp>> operator is intended to be used as described above. If the `regexp` contains //capture groups// those groups will be included into the output.
<<.bad-example """```
\procedure re() (color)|(colour)ed
\procedure str() Some coloured text
{{{ [<str>splitregexp<re>join[, ]] }}}
```""">>
Somewhat more useful may be this code.
```
\procedure re() (colou?red)
\procedure str() Some coloured text
{{{ [<str>splitregexp<re>join[, ]] }}}
```

View File

@ -1,13 +1,14 @@
caption: transcludes
created: 20211002204500000 created: 20211002204500000
modified: 20240610085927867
op-input: a [[selection of titles|Title Selection]]
op-output: the titles which the input tiddlers [[hard-transclude|Hard and Soft Transclusions]]
op-parameter: none
op-purpose: find the titles transcluded by each input title
tags: [[Filter Operators]] [[Common Operators]] tags: [[Filter Operators]] [[Common Operators]]
title: transcludes Operator title: transcludes Operator
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
caption: transcludes
op-purpose: find the titles linked to by each input title
op-input: a [[selection of titles|Title Selection]]
op-parameter: none
op-output: the titles to which the input tiddlers [[transcludes|Transclusion]]
Each input title is processed in turn. The corresponding tiddler's list of transcludes is generated, in the order in which they appear in the tiddler's text, and [[dominantly appended|Dominant Append]] to the operator's overall output. <<.from-version 5.3.4>> Each input title is processed in turn. The corresponding tiddler's list of transclusions is generated, in the order in which they appear in the tiddler's text, and [[dominantly appended|Dominant Append]] to the operator's overall output.
<<.operator-examples "transcludes">> <<.operator-examples "transcludes">>

View File

@ -1,4 +1,6 @@
title: Open Collective Logo created: 20240621075644739
modified: 20240621075647009
tags: picture tags: picture
title: Open Collective Logo
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2" viewBox="0 0 28 28"><path d="M25.509 6.026A13.934 13.934 0 0 1 28 14c0 2.963-.92 5.71-2.491 7.974l-3.626-3.627A8.96 8.96 0 0 0 23 14a8.964 8.964 0 0 0-1.117-4.347l3.626-3.627Z"/><path d="m21.974 2.49-3.627 3.628a9 9 0 1 0 0 15.765l3.627 3.626A13.934 13.934 0 0 1 14 27.999C6.268 28 0 21.733 0 14 0 6.269 6.268 0 14 0c2.963 0 5.711.922 7.974 2.492Z"/></svg> <svg style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2" viewBox="0 0 28 28"><path d="M25.509 6.026A13.934 13.934 0 0 1 28 14c0 2.963-.92 5.71-2.491 7.974l-3.626-3.627A8.96 8.96 0 0 0 23 14a8.964 8.964 0 0 0-1.117-4.347l3.626-3.627Z"/><path d="m21.974 2.49-3.627 3.628a9 9 0 1 0 0 15.765l3.627 3.626A13.934 13.934 0 0 1 14 27.999C6.268 28 0 21.733 0 14 0 6.269 6.268 0 14 0c2.963 0 5.711.922 7.974 2.492Z"/></svg>

View File

@ -1,37 +1,16 @@
caption: lingo
created: 20150221154907000 created: 20150221154907000
modified: 20231028123405895 modified: 20150221155706000
tags: Macros [[Core Macros]]
title: lingo Macro title: lingo Macro
type: text/vnd.tiddlywiki tags: Macros [[Core Macros]]
caption: lingo
The <<.def lingo>> [[macro|Macros]] relates to the translation of ~TiddlyWiki's user interface into other languages. It returns a piece of text in the user's currently selected language. The <<.def lingo>> [[macro|Macros]] relates to the translation of ~TiddlyWiki's user interface into other languages. It returns a piece of text in the user's currently selected language.
Translatable text is supplied by Translatable text is supplied by language plugins containing tiddlers with specific titles that start with `$:/language/`.
# Language plugins !! Parameters
# Any l10n (localization) strings outside of the language plugins
!! Language plugins
You can directly pass title to `lingo` macro, when there is a language plugin containing a tiddler with such title that start with `$:/language/`.
;title ;title
: The title of the shadow tiddler that contains the text. The prefix `$:/language/` is added automatically : The title of the shadow tiddler that contains the text. The prefix `$:/language/` is added automatically
<<.macro-examples "lingo (for language plugin)">> <<.macro-examples "lingo">>
!! Any l10n strings
To translate any text that directly placed in user's wiki, instead of in a language plugin, you can set the `lingo-base` variable to teach <<.def lingo>> macro the place to look for.
!!! Parameters
;key
: The last part of title of the tiddler that contains the text. The `<<lingo-base>>` prefix and current language name prefix is added automatically
;lingo-base-fallback
: Optional lingo-base when it is not possible to define `lingo-base` variable (for example, when using this macro in the caption field), you can set the lingo base by passing this parameter
<<.macro-examples "lingo (for custom base)">>
{{lingo Macro (file structure)}}

View File

@ -1,21 +0,0 @@
created: 20231028120432257
modified: 20240206113509050
tags: [[lingo Macro]] [[Macro Examples]]
title: lingo (for custom base) Macro (Examples)
type: text/vnd.tiddlywiki
\define lingo-base() lingo Macro (custom base examples)/
Given the `\define lingo-base() lingo Macro (custom base examples)/`, this example shows the localizaion key `ExampleKey` being translate to the text in [[lingo Macro (custom base examples)/en-GB/ExampleKey]]:
<$macrocall $name=".example" n="1" eg="""<<lingo ExampleKey>>"""/>
This example shows the `lingo-base` can be set as second parameter:
<$macrocall $name=".example" n="2" eg="""<<lingo ExampleKey "lingo Macro (custom base examples)/">>"""/>
When use lingo macro in a [[Inline Mode WikiText]] like [[list|Lists in WikiText]] or [[title|Headings in WikiText]], the parse mode will be inline, so translated text will be inlined too.
<$macrocall $name=".example" n="3" eg="""# <<lingo ExampleKey>>"""/>
<$macrocall $name=".example" n="4" eg="""!! <<lingo ExampleKey>>"""/>

View File

@ -1,8 +0,0 @@
created: 20231028120526948
modified: 20240206113155142
title: lingo Macro (custom base examples)/en-GB/ExampleKey
type: text/vnd.tiddlywiki
This is the translated text of key "~ExampleKey" under lingo-base `lingo Macro (custom base examples)/` (don't forget the tailing slash `/`)
And is multi-line, if it is translated in the block mode by default. (Become single line if set to inline mode.)

View File

@ -1,73 +0,0 @@
created: 20231028120432257
modified: 20240206122408606
tags: [[lingo Macro]] [[Macro Examples]]
title: lingo Macro (file structure)
!! Example file structure for [[TiddlyWiki on Node.js]]
!!! Suggested file structure
When developing a plugin, you may want to organize your language files like this on the file system as [[MultiTiddlerFiles]]:
```tree
├── language
│ ├── en-GB
│ │ ├── Translations.multids
│ │ └── SomeLongText.tid
│ └── zh-Hans
│ ├── Translations.multids
│ └── SomeLongText.tid
├── other files
└── plugin.info
```
See [[$:/plugins/tiddlywiki/menubar/tree]] for an example.
!!! Define Multiple Translations in One Tiddler
And the content of `language/en-GB/Translations.multids` may looks like this:
```multids
title: $:/plugins/yourName/pluginName/language/en-GB/
OpenInteractiveCard: Open Interactive Card
OpenStaticCard: Open Static Card
```
Later you can use it like:
```tid
title: someTiddler
caption: <<lingo OpenStaticCard "$:/plugins/yourName/pluginName/language/">>
\define lingo-base() $:/plugins/yourName/pluginName/language/
\whitespace trim
<<lingo OpenInteractiveCard>>
```
!!! Define Long Text in a regular Tiddler
You can also use a regular tiddler for long text, like `SomeLongText.tid` in the example above, to store a multi-paragraph long text:
```tid
title: $:/plugins/yourName/pluginName/language/en-GB/SomeLongText
!!! SubTitle
This is a long text.
```
Later you can use it like:
```tid
title: someTiddler
\define lingo-base() $:/plugins/yourName/pluginName/language/
!! <<lingo "OpenInteractiveCard">>
<<lingo SomeLongText>>
```
Note that lingo macro will use the [[parse mode|WikiText Parser Modes]] in the current position where this procedure is invoked.

View File

@ -1,7 +1,7 @@
created: 20150221151358000 created: 20150221151358000
modified: 20150221160113000 modified: 20150221160113000
tags: [[lingo Macro]] [[Macro Examples]] tags: [[lingo Macro]] [[Macro Examples]]
title: lingo (for language plugin) Macro (Examples) title: lingo Macro (Examples)
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
This example shows the text used as the basis for the title of a newly created tiddler: This example shows the text used as the basis for the title of a newly created tiddler:

View File

@ -0,0 +1,117 @@
created: 20240609152203076
modified: 20240614210714914
tags:
title: WidgetMessage: tm-http-request Examples
type: text/vnd.tiddlywiki
<$let store-fetched-output="""\procedure store-fetched-output()
<$action-setfield $tiddler=Output status=<<status>> error=<<error>> data=<<data>> headers=<<headers>>/>
\end
""">
<$testcase>
<$data title=Description text="Simple tm-http-request GET"/>
<$data title=Narrative text="""Use the oncompletion attribute to store the results of a method="GET" request"""/>
<$data title=Output text=`$(store-fetched-output)$
\procedure http-get()
<$action-sendmessage
$message="tm-http-request"
url="https://httpbin.org/get"
method="GET"
oncompletion=<<store-fetched-output>>
/>
\end
<$button actions=<<http-get>>>send HTTP GET</$button>`/>
</$testcase>
<$testcase>
<$data title=Description text="Simple tm-http-request POST"/>
<$data title=Narrative text="""Use the oncompletion attribute to store the results of a method="POST" request. Use the body attribute to send data"""/>
<$data title=Output text=`$(store-fetched-output)$
\procedure http-post()
<$action-sendmessage
$message="tm-http-request"
url="https://httpbin.org/post"
method="POST"
body='{"foo": "bar"}'
oncompletion=<<store-fetched-output>>
/>
\end
<$button actions=<<http-post>>>send HTTP POST</$button>`/>
</$testcase>
<$testcase>
<$data title=Description text="tm-http-request with delayed response"/>
<$data title=Narrative text="""Use the bind-status and bind-progress attributes to watch the intermediate state of a slow response"""/>
<$data title=Output text=`$(store-fetched-output)$
\procedure http-get()
<$action-sendmessage
$message="tm-http-request"
url="https://httpbin.org/delay/2"
bind-status=status
bind-progress=progress
method="GET"
oncompletion=<<store-fetched-output>>
/>
\end
<$button actions=<<http-get>>>send HTTP GET</$button>
|!status |{{status}}|
|!progress %|{{progress}}|`/>
</$testcase>
<$testcase>
<$data title=Description text="tm-http-request with dripped response"/>
<$data title=Narrative text="""Use the bind-status and bind-progress attributes to watch progress of data which arrives a little at a time"""/>
<$data title=Output text=`$(store-fetched-output)$
\procedure http-get()
<$action-sendmessage
$message="tm-http-request"
url="https://httpbin.org/drip?duration=2&numbytes=10&code=200&delay=2"
bind-status=status
bind-progress=progress
method="GET"
oncompletion=<<store-fetched-output>>
/>
\end
<$button actions=<<http-get>>>send HTTP GET</$button>
|!status |{{status}}|
|!progress %|{{progress}}|`/>
</$testcase>
<$testcase>
<$data title=Description text="tm-http-request 504 Bad Gateway error response"/>
<$data title=Narrative text="""Send a request to a url which simulates a 504 HTTP response in order to illustrate what an error response looks like"""/>
<$data title=Output text=`$(store-fetched-output)$
\procedure http-get()
<$action-sendmessage
$message="tm-http-request"
url="https://httpbin.org/status/504"
method="GET"
oncompletion=<<store-fetched-output>>
/>
\end
<$button actions=<<http-get>>>send HTTP GET</$button>`/>
</$testcase>
<$testcase>
<$data title=Description text="tm-http-request 405 Method Not Allowed error response"/>
<$data title=Narrative text="""Another error response example. This one sends a GET to a URL which only allows POST"""/>
<$data title=Output text=`$(store-fetched-output)$
\procedure http-get()
<$action-sendmessage
$message="tm-http-request"
url="https://httpbin.org/post"
method="GET"
oncompletion=<<store-fetched-output>>
/>
\end
<$button actions=<<http-get>>>send HTTP GET</$button>`/>
</$testcase>
</$let>

View File

@ -1,6 +1,6 @@
caption: tm-http-request caption: tm-http-request
created: 20230429161453032 created: 20230429161453032
modified: 20230723215344887 modified: 20240614204704401
tags: Messages tags: Messages
title: WidgetMessage: tm-http-request title: WidgetMessage: tm-http-request
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
@ -54,6 +54,7 @@ Note that the state tiddler $:/state/http-requests contains a number representin
!! Examples !! Examples
* Several simple examples using https://httpbin.org: [[WidgetMessage: tm-http-request Examples]]
* [[Zotero's|https://www.zotero.org/]] API for retrieving reference items: [[WidgetMessage: tm-http-request Example - Zotero]] * [[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 Dog]] * [[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 Dog]]
* Example of using HTTP Basic Authentication: [[WidgetMessage: tm-http-request Example - Basic Authentication]] * Example of using HTTP Basic Authentication: [[WidgetMessage: tm-http-request Example - Basic Authentication]]

View File

@ -18,12 +18,13 @@ The name wrapped in double angled [[brackets|Brackets]] is a shorthand way of [[
``` ```
<<my-procedure>> <<my-procedure>>
<<my-procedure "The parameter">>
<<my-procedure parameter:"The parameter">> <<my-procedure parameter:"The parameter">>
``` ```
The parameters that are specified in the procedure call are made available as variables. The parameters that are specified in the procedure call are made available as variables.
<<.tip """If a procedure has more than 1 parameter, it is highly encouraged to use "named parameters", as shown in the second example above. Even if it is more to type, it will pay off in the long run.""">> <<.tip """If a procedure has more than one parameter, it is highly encouraged to use "named parameters", as shown in the third example above and in contrast to the second example. Even if it is more to type, it will pay off in the long run.""">>
!! How Procedures Work !! How Procedures Work

View File

@ -1,11 +1,11 @@
caption: 5.3.2 caption: 5.3.2
created: 20231213080637781 created: 20231213080637781
description: Conditional Shortcut Syntax, ListWidget Improvements
modified: 20231213080637781 modified: 20231213080637781
released: 20231213080637781 released: 20231213080637781
tags: ReleaseNotes tags: ReleaseNotes
title: Release 5.3.2 title: Release 5.3.2
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
description: Under development
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.3.1...v5.3.2]]// //[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.3.1...v5.3.2]]//

View File

@ -1,11 +1,11 @@
caption: 5.3.3 caption: 5.3.3
created: 20231223102201587 created: 20231223102201587
description: Bugfix release for v5.3.2
modified: 20231223102201587 modified: 20231223102201587
released: 20231223102201587 released: 20231223102201587
tags: ReleaseNotes tags: ReleaseNotes
title: Release 5.3.3 title: Release 5.3.3
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
description: Under development
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.3.2...v5.3.3]]// //[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.3.2...v5.3.3]]//

View File

@ -9,7 +9,6 @@ modified: 20220223160414274
tags: Chrome Firefox [[Internet Explorer]] Linux Mac Opera Safari Saving Windows Edge tags: Chrome Firefox [[Internet Explorer]] Linux Mac Opera Safari Saving Windows Edge
title: Saving with Polly title: Saving with Polly
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
ribbon-text: NEW
[[Polly|https://github.com/Marxsal/polly]] is a batch file system using Windows //~PowerShell// to restore ~TiddlyWiki files from a specified download directory to their original home directory. [[Polly|https://github.com/Marxsal/polly]] is a batch file system using Windows //~PowerShell// to restore ~TiddlyWiki files from a specified download directory to their original home directory.

View File

@ -8,7 +8,6 @@ modified: 20221126192853897
tags: Chrome Firefox [[Internet Explorer]] Linux Mac Opera Safari Saving Windows iOS Edge tags: Chrome Firefox [[Internet Explorer]] Linux Mac Opera Safari Saving Windows iOS Edge
title: TiddlyBucket - Save to AWS or Google Storage title: TiddlyBucket - Save to AWS or Google Storage
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
ribbon-text: NEW
~TiddlyBucket - Save to AWS or Google Storage using Go ~TiddlyBucket - Save to AWS or Google Storage using Go

View File

@ -1,6 +1,6 @@
caption: action-deletefield caption: action-deletefield
created: 20141025120850184 created: 20141025120850184
modified: 20150220162042000 modified: 20240608151322035
tags: Widgets ActionWidgets tags: Widgets ActionWidgets
title: ActionDeleteFieldWidget title: ActionDeleteFieldWidget
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
@ -21,26 +21,56 @@ The ''action-deletefield'' widget is invisible. Any content within it is ignored
! Examples ! Examples
Here is an example of a button that deletes the caption and tags fields of the current tiddler: <$testcase>
<$data title=Description text="Delete currentTiddler fields using plain attributes"/>
<$data title=Narrative text="""Use the $action-deletefield widget to delete the "caption" and "tags" fields of the current tiddler"""/>
<$data title=Output caption="A caption" tags="tag1 tag2 tag3" text="""Click
<$button actions="<$action-deletefield caption tags/>">
Delete
</$button>
and watch the "caption" and "tags" field disappear."""/>
</$testcase>
<$macrocall $name='wikitext-example-without-html' <$testcase>
src='<$button> <$data title=Description text="Delete fields from a specific tiddler"/>
<$action-deletefield caption tags/> <$data title=Narrative text="""Use the $action-deletefield widget to delete the "list" and "tags" fields of the tiddler ~HelloThere"""/>
Delete "caption" and "tags" <$data $tiddler="HelloThere"/>
</$button>'/> <$data title=Output text="""Click HelloThere, then click
<$button actions='<$action-deletefield $tiddler="HelloThere" list tags/>'>
Delete
</$button>
and watch the "list" and "tags" fields disappear"""/>
</$testcase>
Here is an example of a button that deletes the modified date and tags fields of the tiddler HelloThere: <$testcase>
<$data title=Description text="Delete field from a specific tiddler"/>
<$data title=Narrative text="""Use the $field attribute of the $action-deletefield widget to delete the "text" field of the tiddler ~HelloThere"""/>
<$data $tiddler="HelloThere"/>
<$data title=Output text="""Click HelloThere, then click
<$button actions='<$action-deletefield $tiddler="HelloThere" $field="text"/>'>
Delete
</$button>
and watch the contents of the "text" field disappear"""/>
</$testcase>
<$macrocall $name='wikitext-example-without-html' <$testcase>
src='<$button> <$data title=Description text="Delete a variable field name"/>
<$action-deletefield $tiddler="HelloThere" modified tags/> <$data title=Narrative text="""Use the $field attribute of the $action-deletefield widget to delete a variable field name"""/>
Delete "modified" and "tags" from ~HelloThere <$data title=Output description="This field will be deleted" text="""<$let fieldName=description>
</$button>'/> Click
<$button actions="<$action-deletefield $field=<<fieldName>>/>">
Delete
</$button>
and watch the "<<fieldName>>" field disappear."""/>
</$let>
</$testcase>
Here is an example of a button that uses the optional $field attribute to delete the text field of the tiddler HelloThere: <$testcase>
<$data title=Description text="Delete field without updating timestamps"/>
<$macrocall $name='wikitext-example-without-html' <$data title=Narrative text="""Use the $timestamp attribute of the $action-deletefield widget to prevent creation/change of "modified" and "created" fields"""/>
src='<$button> <$data title=Output description="This field will be deleted" text="""Click
<$action-deletefield $tiddler="HelloThere" $field="text"/> <$button actions='<$action-deletefield $field="description" $timestamp="no"/>'>
Delete text from ~HelloThere Delete
</$button>'/> </$button>
and watch the "description" field disappear without the "modified" and "created" fields getting added"""/>
</$testcase>

View File

@ -1,6 +1,6 @@
caption: action-deletetiddler caption: action-deletetiddler
created: 20141025120850184 created: 20141025120850184
modified: 20141106173455527 modified: 20240608152211834
tags: Widgets ActionWidgets tags: Widgets ActionWidgets
title: ActionDeleteTiddlerWidget title: ActionDeleteTiddlerWidget
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
@ -25,18 +25,20 @@ The ''action-deletetiddler'' widget is invisible. Any content within it is ignor
! Examples ! Examples
Here is an example of a button that deletes the tiddler HelloThere: <$testcase>
<$data title=Description text="Delete a specific tiddler"/>
<$macrocall $name='wikitext-example-without-html' <$data title=Narrative text="""Use the $tiddler attribute of the $action-deletefield widget to delete the "~HelloThere" tiddler"""/>
src='<$button> <$data $tiddler="HelloThere"/>
<$action-deletetiddler $tiddler="HelloThere"/> <$data title=Output text="""<$button actions="<$action-deletetiddler $tiddler=HelloThere/>">
Delete "~HelloThere" Delete "~HelloThere"
</$button>'/> </$button>"""/>
</$testcase>
Here is an example of a button that deletes all tiddlers tagged [[TableOfContents]]: <$testcase>
<$data title=Description text="Delete tiddlers matching a filter"/>
<$macrocall $name='wikitext-example-without-html' <$data title=Narrative text="""Use the $filter attribute of the $action-deletefield widget to delete all tiddlers tagged "~TableOfContents" """/>
src='<$button> <$data $filter="[tag[TableOfContents]]"/>
<$action-deletetiddler $filter="[tag[TableOfContents]]"/> <$data title=Output text="""<$button actions='<$action-deletetiddler $filter="[tag[TableOfContents]]"/>'>
Delete tiddlers tagged "~TableOfContents" Delete tiddlers tagged "~TableOfContents"
</$button>'/> </$button>"""/>
</$testcase>

View File

@ -1,21 +1,48 @@
caption: transclude caption: transclude
created: 20130824142500000 created: 20130824142500000
modified: 20230511022612458 modified: 20240621073236430
tags: Widgets tags: Widgets
title: TranscludeWidget title: TranscludeWidget
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
! Introduction ! Introduction
The <<.wlink TranscludeWidget>> widget dynamically includes the content from another tiddler or variable, rendering it as if the transclude widget were replaced by the target content. Transclusion is the underlying mechanism for many higher level wikitext features, such as ''procedures'', ''functions'', ''custom widgets'' and ''macros''.
The <<.wlink TranscludeWidget>> widget can be used to render content of any type: wikitext, images, videos, etc. The <<.wid transclude>> widget dynamically includes the content from another ''tiddler'' or ''variable'', rendering it as if the transclude widget were replaced by the target content.
Transclusion is the underlying mechanism for many higher level wikitext features, such as procedures, custom widgets and macros. The <<.wid transclude>> widget can be used to render content of any type: wikitext, images, videos, etc.
! Attributes
| !Attribute |<| !Description |
| !(modern) | !(legacy) |~|
|$variable |- |Name of the variable to transclude. Eg: Name of <<.dlink procedures Procedures>>, <<.dlink functions Functions>>, <<.dlink "custom widgets" Widgets>> and <<.dlink macros Macros>> |
|$tiddler |tiddler |The title of the tiddler to transclude (defaults to the current tiddler) |
|$field |field |The field name of the current tiddler (defaults to "text"; if present takes precedence over the index attribute) |
|$index |index |The index of a property in a [[DataTiddler|DataTiddlers]] |
|$subtiddler |subtiddler |Optional SubTiddler title when the target tiddler is a [[plugin|Plugins]] (see below) |
|$mode |mode |Override the default parsing mode for the transcluded text to "block" or "inline" |
|$type | |Optional ContentType used when transcluding variables, indexes or fields other than the ''text'' field|
|$output |- |ContentType for the output rendering (defaults to `text/html`, can also be `text/plain` or `text/raw`) |
|$recursionMarker |recursionMarker |Set to ''no'' to prevent creation of [[Legacy Transclusion Recursion Marker]] (defaults to ''yes'') |
|$fillignore |- |Set to ''yes'' to make this transclusion invisible to the <<.attr $depth>> attribute of the <<.wlink SlotWidget>> widget (defaults to ''no'') |
|//{attributes not starting with $}// | |Any other attributes that do not start with a dollar are used as parameters to the transclusion |
|//{other attributes starting with $}// | |Other attributes starting with a single dollar sign are ''reserved'' for future use |
|//{attributes starting with $$}// | |Attributes starting with two dollar signs are used as parameters to the transclusion, but with the name changed to use a single dollar sign |
! Legacy vs. Modern Mode
The <<.wid transclude>> widget can be used in two modes:
* <<.from-version "5.3.0">> ''Modern mode'' offers the full capabilities of the <<.wid transclude>> widget, and incorporates the functionality of the <<.wlink MacroCallWidget>> widget. It is indicated by the presence of at least one attribute starting with a dollar sign `$`
* ''Legacy mode'' offers a more limited set of capabilities. It is indicated by the absence of any attributes starting with a dollar sign `$`
Modern mode is recommended for use in new applications.
! Example ! Example
Here is a complete example showing the important features of the <<.wlink TranscludeWidget>> widget: Here is a complete example showing the important features of the <<.wid transclude>> widget:
``` ```
\procedure myproc(name,age) \procedure myproc(name,age)
@ -29,36 +56,9 @@ My name is <<name>> and my age is <<age>>.
* The content of the procedure refers to the parameters as variables * The content of the procedure refers to the parameters as variables
* The <<.wlink TranscludeWidget>> widget specifies the variable to transclude, and values for the parameters. * The <<.wlink TranscludeWidget>> widget specifies the variable to transclude, and values for the parameters.
! Legacy vs. Modern Mode
The <<.wlink TranscludeWidget>> widget can be used in two modes:
* <<.from-version "5.3.0">> ''Modern mode'' offers the full capabilities of the <<.wlink TranscludeWidget>> widget, and incorporates the functionality of the <<.wlink MacroCallWidget>> widget. It is indicated by the presence of at least one attribute starting with a dollar sign `$`
* ''Legacy mode'' offers a more limited set of capabilities. It is indicated by the absence of any attributes starting with a dollar sign `$`
Modern mode is recommended for use in new applications.
! Attributes
| !Attribute |<| !Description |
| !(modern) | !(legacy) |~|
|$variable |- |Name of the variable to transclude |
|$tiddler |tiddler |The title of the tiddler to transclude (defaults to the current tiddler) |
|$field |field |The field name of the current tiddler (defaults to "text"; if present takes precedence over the index attribute) |
|$index |index |The index of a property in a [[DataTiddler|DataTiddlers]] |
|$subtiddler |subtiddler |Optional SubTiddler title when the target tiddler is a [[plugin|Plugins]] (see below) |
|$mode |mode |Override the default parsing mode for the transcluded text to "block" or "inline" |
|$type | |Optional ContentType used when transcluding variables, indexes or fields other than the ''text'' field|
|$output |- |ContentType for the output rendering (defaults to `text/html`, can also be `text/plain` or `text/raw`) |
|$recursionMarker |recursionMarker |Set to ''no'' to prevent creation of [[Legacy Transclusion Recursion Marker]] (defaults to ''yes'') |
|$fillignore |- |Set to ''yes'' to make this transclusion invisible to the <<.attr $depth>> attribute of the <<.wlink SlotWidget>> widget (defaults to ''no'') |
|//{attributes not starting with $}// | |Any other attributes that do not start with a dollar are used as parameters to the transclusion |
|//{other attributes starting with $}// | |Other attributes starting with a single dollar sign are reserved for future use |
|//{attributes starting with $$}// | |Attributes starting with two dollar signs are used as parameters to the transclusion, but with the name changed to use a single dollar sign |
! Basic Operation ! Basic Operation
The basic operation of the <<.wlink TranscludeWidget>> widget is as follows: The basic operation of the <<.wid transclude>> widget is as follows:
|`<$transclude/>` |Transcludes the text field of the current tiddler | |`<$transclude/>` |Transcludes the text field of the current tiddler |
|`<$transclude $variable="alpha"/>` |Transcludes the variable "alpha" (note that procedures, custom widgets and macros are all special types of variable) | |`<$transclude $variable="alpha"/>` |Transcludes the variable "alpha" (note that procedures, custom widgets and macros are all special types of variable) |
@ -69,7 +69,7 @@ The basic operation of the <<.wlink TranscludeWidget>> widget is as follows:
! Transclusion Parameters ! Transclusion Parameters
Named string parameters can be passed to the <<.wlink TranscludeWidget>> widget. They are made available as variables within the transcluded text. Parameters are only supported in modern mode. Named string parameters can be passed to the <<.wid transclude>> widget. They are made available as variables within the transcluded text. Parameters are only supported in modern mode.
When invoking a transclusion, parameters are specified as additional attributes that do not start with a dollar sign `$`: When invoking a transclusion, parameters are specified as additional attributes that do not start with a dollar sign `$`:
@ -108,7 +108,7 @@ Parameters are available here as the variables <<firstParameter>> and <<secondPa
! Transclusion Slots ! Transclusion Slots
Transcluded content can define special named locations called slots. At the point of transclusion, blocks of wikitext can be passed to the <<.wlink TranscludeWidget>> widget to fill those slots. Transcluded content can define special named locations called slots. At the point of transclusion, blocks of wikitext can be passed to the <<.wid transclude>> widget to fill those slots.
Slots work very similarly to parameters except that they can contain structured wikitext, and not just plain text. The primary advantage of slots over parameters is that the contents do not need to be wrapped in quotation symbols, making it much simpler to pass complex structures. Slots work very similarly to parameters except that they can contain structured wikitext, and not just plain text. The primary advantage of slots over parameters is that the contents do not need to be wrapped in quotation symbols, making it much simpler to pass complex structures.

View File

@ -28,6 +28,7 @@ Encryption/ClearPassword/Caption: Verschlüsselung deaktivieren
Encryption/ClearPassword/Hint: Lösche das Passwort und speichere ohne Verschlüsselung Encryption/ClearPassword/Hint: Lösche das Passwort und speichere ohne Verschlüsselung
Encryption/SetPassword/Caption: Verschlüsselung Encryption/SetPassword/Caption: Verschlüsselung
Encryption/SetPassword/Hint: Definiert ein Passwort, um dieses Wiki zu verschlüsseln Encryption/SetPassword/Hint: Definiert ein Passwort, um dieses Wiki zu verschlüsseln
EmergencyDownload/Caption: Speichern aller Tiddler als JSON File
ExportPage/Caption: Alle exportieren ExportPage/Caption: Alle exportieren
ExportPage/Hint: Alle Tiddler exportieren ExportPage/Hint: Alle Tiddler exportieren
ExportTiddler/Caption: Exportieren ExportTiddler/Caption: Exportieren

View File

@ -206,6 +206,12 @@ Stylesheets/Caption: Stylesheets
Stylesheets/Expand/Caption: Alle erweitern Stylesheets/Expand/Caption: Alle erweitern
Stylesheets/Hint: Hier wird der "erweiterte" CSS Code dargestellt. Die Reihenfolge, kann in der "Tag-Liste" <<tag "$:/tags/Stylesheet">> mit "Drag & Drop" angepasst werden! Stylesheets/Hint: Hier wird der "erweiterte" CSS Code dargestellt. Die Reihenfolge, kann in der "Tag-Liste" <<tag "$:/tags/Stylesheet">> mit "Drag & Drop" angepasst werden!
Stylesheets/Restore/Caption: Alle zurücksetzen Stylesheets/Restore/Caption: Alle zurücksetzen
TestCases/Caption: Test Beispiele
TestCases/Hint: Test Beispiele sind eigenständige Beispiele zum testen und lernen einzelner Funktionen
TestCases/All/Caption: Alle Beispiele
TestCases/All/Hint: Alle Test Beispiele
TestCases/Failed/Caption: Test Nicht Bestehenden
TestCases/Failed/Hint: Nicht bestandene Tests - Übersicht
Theme/Caption: Theme Theme/Caption: Theme
Theme/Prompt: Ausgewähltes Theme: Theme/Prompt: Ausgewähltes Theme:
TiddlerFields/Caption: Tiddler Felder TiddlerFields/Caption: Tiddler Felder

View File

@ -9,7 +9,7 @@ config: Daten, die in `$tw.config` eingefügt werden.
filteroperator: Individuelle Funktionen für den Filter-Operator. filteroperator: Individuelle Funktionen für den Filter-Operator.
global: Globale Daten, die in `$tw` eingefügt werden. global: Globale Daten, die in `$tw` eingefügt werden.
info: Veröffentlicht System-Informationen mit dem Pseudo-plugin: [[$:/temp/info-plugin]] info: Veröffentlicht System-Informationen mit dem Pseudo-plugin: [[$:/temp/info-plugin]]
isfilteroperator: Operanden für den Filter-Operator: ''is'' isfilteroperator: Parameter für den Filter-Operator: ''is''
library: Allgemeiner Modultyp, für JavaScript Module. library: Allgemeiner Modultyp, für JavaScript Module.
macro: Globale Makro-Definitionen in JavaScript. macro: Globale Makro-Definitionen in JavaScript.
parser: Parser für verschiedene Tiddler Typen. parser: Parser für verschiedene Tiddler Typen.

View File

@ -67,6 +67,9 @@ sidebar-tiddler-link-foreground-hover: Seitenleiste Tiddler Link Vordergrund (ho
sidebar-tiddler-link-foreground: Seitenleiste Tiddler Link Vordergrund sidebar-tiddler-link-foreground: Seitenleiste Tiddler Link Vordergrund
site-title-foreground: Wiki Titel Vordergrund site-title-foreground: Wiki Titel Vordergrund
static-alert-foreground: Statische Warnung Vordergrund static-alert-foreground: Statische Warnung Vordergrund
testcase-accent-level-1: Test Beispiel Akzent Farbe nicht "verschachtelt" - Ebene 1
testcase-accent-level-2: Test Beispiel Akzent Farbe with Ebene 2
testcase-accent-level-3: Test Beispiel Akzent Farbe with Ebene 3
tab-background-selected: Reiter Hintergrund für selektierte Reiter tab-background-selected: Reiter Hintergrund für selektierte Reiter
tab-background: Reiter Hintergrund tab-background: Reiter Hintergrund
tab-border-selected: Reiter Rahmen für selektierte Reiter tab-border-selected: Reiter Rahmen für selektierte Reiter

View File

@ -4,6 +4,7 @@ _canonical_uri: Die komplette URI eines externen Foto Tiddlers. URI = Uniform Re
author: Name des Plugin-Authors author: Name des Plugin-Authors
bag: Der Name eines ~TiddlyWeb "bags" von dem der Tiddler kam. bag: Der Name eines ~TiddlyWeb "bags" von dem der Tiddler kam.
caption: Der Text, der auf "Tab-Buttons" angezeigt wird. caption: Der Text, der auf "Tab-Buttons" angezeigt wird.
class: Die CSS Klasse, die angewendet wird, wenn ein Tiddler ausgegeben wird. Siehe: [[Custom styles by user-class]]. Wird auch verwended für: [[Modals]]
code-body: Das "View Template" wird den Tiddler Text als "Code" anzeigen, wenn dieses Feld auf: ''"yes"'' gesetzt wird. code-body: Das "View Template" wird den Tiddler Text als "Code" anzeigen, wenn dieses Feld auf: ''"yes"'' gesetzt wird.
color: Der CSS Farbwert, der mit einem Tiddler assoziiert wird. color: Der CSS Farbwert, der mit einem Tiddler assoziiert wird.
component: Der Name einer Komponente, die für eine [[Alarm Anzeige|AlertMechanism]] verantwortlich ist. component: Der Name einer Komponente, die für eine [[Alarm Anzeige|AlertMechanism]] verantwortlich ist.
@ -31,6 +32,7 @@ plugin-priority: Ein numerischer Wert, der die Priorität eines "plugins" festle
plugin-type: Der Typ eines "plugins". plugin-type: Der Typ eines "plugins".
revision: Die Revisionsnummer eines Tiddlers. Wird von einem Server vergeben. revision: Die Revisionsnummer eines Tiddlers. Wird von einem Server vergeben.
released: Datum der ~TiddlyWiki Ausgabe. released: Datum der ~TiddlyWiki Ausgabe.
stability: Entwicklungs Status: "deprecated"=abgekündigt, "experimental"=experimentell, "stable"=stabil, "legacy"=Altlast.
source: Eine Quelltext URL, verbunden mit diesem Tiddler. source: Eine Quelltext URL, verbunden mit diesem Tiddler.
subtitle: Der Untertitel für einen "~Wizard-Dialog". subtitle: Der Untertitel für einen "~Wizard-Dialog".
tags: Eine Liste von "Tags" für diesen Tiddler. tags: Eine Liste von "Tags" für diesen Tiddler.

View File

@ -1,7 +1,7 @@
title: $:/language/Help/build title: $:/language/Help/build
description: Ausführen, von vorkonfigurierten Befehlen. description: Ausführen, von vorkonfigurierten Befehlen.
Dieser Befehl erstellt die vorkonfigurierten Ziele, der aktuellen Wiki Edition. Sind keine Ziele spezifiziert, dann werden all konfigurierten Ziele erstellt. Dieser Befehl erstellt eine Zielversion, der aktuellen Wiki Edition. Sind keine Ziele spezifiziert, dann werden all konfigurierten Ziele erstellt.
``` ```
--build <target> [<target> ...] --build <target> [<target> ...]

View File

@ -1,7 +1,7 @@
title: $:/language/Help/clearpassword title: $:/language/Help/clearpassword
description: Lösche das Passwort, das für die vorhergehenen Verschlüsselungen verwendet wurde. description: Lösche das Passwort, das für die vorhergehenden Verschlüsselungen verwendet wurde.
Lösche das Passwort, das für die vorhergehenen Verschlüsselungen verwendet wurde. Lösche das Passwort, das für die vorhergehenden Verschlüsselungen verwendet wurde.
``` ```
--clearpassword --clearpassword

View File

@ -1,7 +1,7 @@
title: $:/language/Help/commands title: $:/language/Help/commands
description: Ausführen von Befehlen aus einem Tiddler description: Ausführen von Befehlen aus einem Filter
Sequentielle Abarbeitung von Befehlen aus einem Tiddler. Sequentielle Abarbeitung von Befehlen aus einem Filter.
``` ```
--commands <filter> --commands <filter>

View File

@ -7,4 +7,4 @@ Listet alle verfügbaren TiddlyWiki Editionen auf.
--editions --editions
``` ```
Sie können ein neues Wiki mit dem `--init` Kommando erstellen. Dabei wird eine der angezeigten Editionen "geklont". Sie können ein neues Wiki mit dem `--init` Befehl erstellen. Dabei wird eine der angezeigten Editionen "geklont".

View File

@ -1,7 +1,7 @@
title: $:/language/Help/fetch title: $:/language/Help/fetch
description: Fetch tiddlers from wiki by URL description: Laden mehrerer Tiddler über eine URL
Abrufen eines oder mehrerer Dateien über HTTP/HTTPS. Importieren der tiddler, die dem Filter entsprechen. Umwandeln der ankommenden Titel, wenn nötig. Abrufen eines oder mehrerer Tiddler über HTTP/HTTPS. Importieren der tiddler, die dem Filter entsprechen. Umwandeln der ankommenden Titel, wenn nötig.
``` ```
--fetch file <url> <import-filter> <transform-filter> --fetch file <url> <import-filter> <transform-filter>
@ -10,11 +10,11 @@ Abrufen eines oder mehrerer Dateien über HTTP/HTTPS. Importieren der tiddler, d
--fetch raw-files <url-filter> <transform-filter> --fetch raw-files <url-filter> <transform-filter>
``` ```
Wird der `file` Parameter verwendet, wird nur eine einzelne Datei geholt. Der erste Parameter ist die URL von der die Datei ''importiert'' werden soll. Wird der `file` oder `raw-file` Parameter verwendet, wird nur eine einzelne Datei geladen. Der erste Parameter ist die URL von der die Datei ''importiert'' werden soll.
Wird der `files` Parameter verwendet, werden mehrere Dateien geholt. In diesem Fall ist der erste Parameter ein Filter, der eine Liste von URLs ergibt, von denen die Dateien gelesen werden sollen. Zum Beispiel: Mehrere Tiddler sind getagged mit: `remote-server` und enthalten ein Feld: `url`. ... Der Filter `[tag[remote-server]get[url]]` wird alle verfügbaren URLs ansprechen. Wird der `files` Parameter verwendet, werden mehrere Dateien geholt. In diesem Fall ist der erste Parameter ein Filter, der eine Liste von URLs ergibt, von denen die Dateien gelesen werden sollen. Zum Beispiel: Mehrere Tiddler sind getaggt mit: `remote-server` und enthalten ein Feld: `url`. ... Der Filter `[tag[remote-server]get[url]]` wird alle verfügbaren URLs ansprechen.
Werden die `raw-file` oder `raw-files` Varianten verwendet, wird der Klartext der Datei importiert. Es wird nicht versucht die Import-logik anzuwenden. Werden die `raw-file` oder `raw-files` Varianten verwendet, wird der Klartext der Datei importiert. Es wird nicht versucht die Import-Logik anzuwenden.
Der `<import-filter>` Parameter spezifiziert jene Tiddler, die importiert werden sollen. Ohne diesen Parameter wird standardmäßig `[all[tiddlers]]` als Filter verwendet. Der `<import-filter>` Parameter spezifiziert jene Tiddler, die importiert werden sollen. Ohne diesen Parameter wird standardmäßig `[all[tiddlers]]` als Filter verwendet.
@ -22,7 +22,7 @@ Der `<transform-filter>` Parameter, spezifiziert einen Filter, mit dem der Tiddl
Wird `--verbose` vor dem `--fetch` Befehl benutzt, dann werden erweiterte Diagnose Infos ausgegeben. Wird `--verbose` vor dem `--fetch` Befehl benutzt, dann werden erweiterte Diagnose Infos ausgegeben.
Hinweis: ~TiddlyWiki wird ''keine'' veralteten plugins importieren. Hinweis: TiddlyWiki wird ''keine'' veraltete Plugins importieren.
Das folgende Beispiel wird alle "nicht-system" Tiddler von https://tiddlywiki.com holen und in ein `JSON` file speichern. Das folgende Beispiel wird alle "nicht-system" Tiddler von https://tiddlywiki.com holen und in ein `JSON` file speichern.

View File

@ -1,13 +1,13 @@
title: $:/language/Help/import title: $:/language/Help/import
description: Importiert mehrere Tiddler aus einer Datei description: Importiert mehrere Tiddler aus einer Datei.
Dieser Befehl importiert / extrahiert Tiddler aus folgenden Dateien: Dieser Befehl importiert / extrahiert Tiddler aus folgenden Dateien:
* ~TiddlyWiki `*.html` * TiddlyWiki `*.html`
* `*.tiddler` * `*.tiddler`
* `*.tid` * `*.tid`
* `*.json` * `*.json`
* oder andere lokale `text` Dateien * oder andere lokale `.text` Dateien
Der `<deserializer>` Parameter muss angegeben werden. Anders als beim `--load` Befehl, der diese Information aus der Dateiendung ableiten kann. Der `<deserializer>` Parameter muss angegeben werden. Anders als beim `--load` Befehl, der diese Information aus der Dateiendung ableiten kann.
@ -27,6 +27,6 @@ TiddlyWiki enthält folgende `deserializer` Standard-Typen:
Der Tiddler-Titel entspricht nach dem Import, dem Dateinamen. Der Tiddler-Titel entspricht nach dem Import, dem Dateinamen.
Die Zeichenkodierung ist auf `utf8` eingestellt. Sie kann aber auf `base64` für binäre Daten geändert werden. Die Zeichenkodierung ist auf "utf8" eingestellt. Sie kann aber auf "base64" für binäre Daten geändert werden.
Hinweis: ~TiddlyWiki importiert nur neuere Plugins, als jene, die bereits geladen sind. Hinweis: TiddlyWiki importiert nur neuere Plugins, als jene, die bereits geladen sind.

View File

@ -18,7 +18,7 @@ Anmerkung:
* Das Wiki Verzeichnis wird angelegt, wenn es nicht existiert. * Das Wiki Verzeichnis wird angelegt, wenn es nicht existiert.
* Der <edition> Parameter ist standardmäßig: ''empty''. * Der <edition> Parameter ist standardmäßig: ''empty''.
* Der --init Befehl bricht ab, wenn das angegebene Verzeichnis nicht leer ist. * Der --init Befehl bricht ab, wenn das angegebene Verzeichnis nicht leer ist.
* Der --init Befehl löscht alle `includeWikis` Definitionen aus der neuen `tiddlywiki.info` Datei * Der --init Befehl löscht alle `includeWikis` Definitionen aus der neuen `tiddlywiki.info` Datei.
* Wenn mehrere Editionen importiert werden, wird die zuletzt importierte `tidlywiki.info` Datei aktiv sein. Alle anderen weden überschrieben. * Wenn mehrere Editionen importiert werden, wird die zuletzt importierte `tidlywiki.info` Datei aktiv sein. Alle anderen weden überschrieben.
* `--editions` listet alle verfügbaren Editionen auf. * `--editions` listet alle verfügbaren Editionen auf.

View File

@ -1,20 +1,20 @@
title: $:/language/Help/listen title: $:/language/Help/listen
description: Definiert das HTTP-Server Interface für Tiddlywiki description: Definiert das HTTP-Server Interface für Tiddlywiki
Stellt das Wiki über einen HTTP-Server zur Verfügung. Stellt das Wiki mit einem HTTP-Server zur Verfügung.
Die "listen" Parameter werden wie folgt verwendet: Der "listen" Parameter wird wie folgt verwendet:
``` ```
--listen [<name>=<wert>]... --listen [<name>=<wert>]...
``` ```
Alle Parameter sind optional, die Reihenfolge ist beliebig und es werden "sichere" standard parametern verwendet. Alle Parameter sind optional, die Reihenfolge ist beliebig und es werden "sichere" standard Parameter verwendet.
Mögliche Parameter: Mögliche Parameter:
* ''host'' - Host-Name, von dem übertragen wird. (Standard: "127.0.0.1" aka "localhost") * ''host'' - Host-Name, von dem übertragen wird. (Standard: "127.0.0.1" alias "localhost")
* ''path-prefix'' - Prefix, der auf alle Pfade angewendet wird * ''path-prefix'' - Pfad-prefix, der auf alle Pfade angewendet wird
* ''port'' - Port Nummer, die überwacht werden soll; Nicht-numerische Werte werden als System Umgebungs-Variable interpretiert. (Standard: 8080) * ''port'' - Port Nummer, die überwacht werden soll; Nicht-numerische Werte werden als System Umgebungs-Variable interpretiert. (Standard: 8080)
* ''credentials'' - Pfad zur Authentifizierungsdatei im CSV-format. Angabe ist relativ zum Wiki-Verzeichnis * ''credentials'' - Pfad zur Authentifizierungsdatei im CSV-format. Angabe ist relativ zum Wiki-Verzeichnis
* ''anon-username'' - Name, der für anonymer Benutzer verwendet wird, um bearbeitete Tiddler zu markieren * ''anon-username'' - Name, der für anonymer Benutzer verwendet wird, um bearbeitete Tiddler zu markieren
@ -23,12 +23,12 @@ Mögliche Parameter:
* ''authenticated-user-header'' - Optionaler HTTP Header-Name für vertrauenswürdige, authentifizierte Benutzer * ''authenticated-user-header'' - Optionaler HTTP Header-Name für vertrauenswürdige, authentifizierte Benutzer
* ''readers'' - Komma-separierte Liste für Benutzer, mit Schreiberlaubnis * ''readers'' - Komma-separierte Liste für Benutzer, mit Schreiberlaubnis
* ''writers'' - Komma-separierte Liste für Benutzer, mit Leseerlaubnis * ''writers'' - Komma-separierte Liste für Benutzer, mit Leseerlaubnis
* ''csrf-disable'' - "yes" bedeutet, dass CSRF checks deaktiviert sind. (Standard: "no") * ''csrf-disable'' - "yes" bedeutet, dass CSRF Überprüfungen deaktiviert sind. (Standard: "no")
* ''root-tiddler'' - Tiddler, der für den "Root-Pfad" verwendet wird. (Standard: "$:/core/save/all") * ''root-tiddler'' - Tiddler, der für den "Root-Pfad" verwendet wird. (Standard: "$:/core/save/all")
* ''root-render-type'' - Darstellungs-Type, die für den Root-Tiddler verwendet wird. (Standard: "text/plain") * ''root-render-type'' - Darstellungs-Type, die für den Root-Tiddler verwendet wird. (Standard: "text/plain")
* ''root-serve-type'' - Inhalts-Type, die für den Root-Tiddler verwendet wird. (Standard: "text/html") * ''root-serve-type'' - Inhalts-Type, die für den Root-Tiddler verwendet wird. (Standard: "text/html")
* ''tls-cert'' - Pfad zur "TLS certificate" Datei (relativ zum Wiki Verzeichnis) * ''tls-cert'' - Pfad zur "TLS Zertifikat" Datei (relativ zum Wiki Verzeichnis)
* ''tls-key'' - Pfad zur "TLS key" Datei (relativ zum Wiki Verzeichnis) * ''tls-key'' - Pfad zur "TLS Schlüssel" Datei (relativ zum Wiki Verzeichnis)
* ''debug-level'' - "debug" bewikt eine detailierte Anzeige der HTTP Anfrage-Parameter. (Standard: "none") * ''debug-level'' - "debug" bewikt eine detailierte Anzeige der HTTP Anfrage-Parameter. (Standard: "none")
* ''gzip'' - Wenn auf "yes" gesetzt, dann wird gzip Kompression aktiviert. (Standard: "no") * ''gzip'' - Wenn auf "yes" gesetzt, dann wird gzip Kompression aktiviert. (Standard: "no")
* ''use-browser-cache'' - Ist dieser Parameter auf "yes" gesetzt kann der Browser Inhalte zwischenspeichern um Übertragungsbandbreite zu sparen. (Standard: "no") * ''use-browser-cache'' - Ist dieser Parameter auf "yes" gesetzt kann der Browser Inhalte zwischenspeichern um Übertragungsbandbreite zu sparen. (Standard: "no")

View File

@ -3,7 +3,7 @@ description: Lade Tiddler von einer Datei.
Lade Tiddler aus einer TiddlyWiki `.html`, `.tiddler`, `.tid`, `.json` oder anderen lokalen Datei. Lade Tiddler aus einer TiddlyWiki `.html`, `.tiddler`, `.tid`, `.json` oder anderen lokalen Datei.
Die Umsetzung der geladenen Datei wird anhand der Datei-Erweiterung bestimmt. Verwenden sie den alternativen `import` Befehl, wenn sie den Umsetzungstyp ändern möchten. Die Verarbeitung der geladenen Datei wird anhand der Datei-Erweiterung bestimmt. Verwenden sie den alternativen `import` Befehl, wenn sie die verarbeitungsweise ändern möchten.
``` ```
@ -11,14 +11,14 @@ Die Umsetzung der geladenen Datei wird anhand der Datei-Erweiterung bestimmt. Ve
--load <dirpath> [noerror] --load <dirpath> [noerror]
``` ```
Der "load" Befehl erzeugt eine Fehlermeldung, wenn keine Tiddler gefunden werden. Diese Verhalten kann mit dem Parameter "noerror" unterdrückt werden. Der "load" Befehl erzeugt eine Fehlermeldung, wenn keine Tiddler gefunden werden. Dieses Verhalten kann mit dem Parameter "noerror" unterdrückt werden.
Um Daten aus einer verschlüsselten TiddlyWiki Datei zu laden, muss zuerst mit dem "password" Parameter ein Passwort definiert werden. Um Daten aus einer verschlüsselten TiddlyWiki Datei zu laden, muss zuerst mit dem "password" Parameter ein Passwort definiert werden.
Beispiel: Beispiel:
``` ```
tiddlywiki ./MyWiki --password pa55w0rd --load my_encrypted_wiki.html tiddlywiki ./MyWiki --password hier-sicheres-passwort-verwenden --load my_encrypted_wiki.html
``` ```
Hinweis: TiddlyWiki wird nur neuere Versionen eines bestehenden Plugins laden! Hinweis: TiddlyWiki wird nur neuere Versionen eines bestehenden Plugins laden!

View File

@ -1,7 +1,7 @@
title: $:/language/Help/makelibrary title: $:/language/Help/makelibrary
description: Erstellt die "Upgrade Bibliothek", die vom upgrade Prozess benötigt wird description: Erstellt die "Upgrade Bibliothek", die vom "upgrade" Prozess benötigt wird
Erstellt den tiddler: `$:/UpgradeLibrary`, der vom upgrade Prozess benötigt wird. Erstellt den tiddler: `$:/UpgradeLibrary`, der vom "upgrade" Prozess benötigt wird.
Die "Upgrade Bibliothek" ist ein "normales" Plugin, vom Typ: `library`. Es enthält eine Kopie jedes Plugins, Themas und Sprachpacketes, das im TiddlyWiki Archiv enthalten ist. Die "Upgrade Bibliothek" ist ein "normales" Plugin, vom Typ: `library`. Es enthält eine Kopie jedes Plugins, Themas und Sprachpacketes, das im TiddlyWiki Archiv enthalten ist.

View File

@ -1,7 +1,7 @@
title: $:/language/Help/output title: $:/language/Help/output
description: Setzt das Basis Ausgabeverzeichnis für die folgenden Befehle. description: Setzt das Basis Ausgabeverzeichnis für alle folgenden Befehle.
Setzt das Basis Ausgabeverzeichnis für die folgenden Befehle. Das Standard Verzeichnis heißt: `output` und ist ein Unterverzeichnis des `edition` Verzeichnisses. Setzt das Basis Ausgabeverzeichnis für alle folgenden Befehle. Das Standard Verzeichnis heißt: "output" und ist ein Unterverzeichnis des "edition" Verzeichnisses.
``` ```
--output <pathname> --output <pathname>

View File

@ -7,4 +7,4 @@ Setzen eines Passwortes für Verschlüsselungsoperationen
--password <password> --password <password>
``` ```
Hinweis: Diese Option kann nicht verwendet werden, um ein "Server Passwort" festzulegen! Informationen zum Server Passwort siehe "--server" Kommando. Hinweis: Diese Option kann nicht verwendet werden, um ein "Server Passwort" festzulegen! Informationen zum Server Passwort siehe [[ServerCommand]].

View File

@ -1,9 +1,9 @@
title: $:/language/Help/render title: $:/language/Help/render
description: Ausgabe individueller Tiddler in Dateien description: Ausgabe individueller Tiddler in Dateien
Individuelle Tiddler werden anhand von Filtern spezifiziert, gelesen und in Dateien umgesetzt. Individuelle Tiddler werden anhand von Filtern spezifiziert, gelesen und in Dateien umgewandelt.
Optionell kann eine Template-Datei angegeben werden. In diesem Fall wird nicht der Inhalt des Tiddlers, sondern des Templates umgesetzt. Die `currentTiddler` Variable wird auf den Titel, des auszugebenden, Tiddlers gesetzt. Optionell kann eine Template-Datei angegeben werden. In diesem Fall wird nicht der Inhalt des Tiddlers, sondern des Templates übersetzt. Die `currentTiddler` Variable wird auf den Titel, des auszugebenden, Tiddlers gesetzt.
Es können noch zusätzliche Variablen per Name und Wert gesetzt werden. Es können noch zusätzliche Variablen per Name und Wert gesetzt werden.
@ -12,8 +12,8 @@ Es können noch zusätzliche Variablen per Name und Wert gesetzt werden.
``` ```
* ''tiddler-filter'': Ein Filter, der die Auszugebenden Tiddler eindeutig spezifiziert. * ''tiddler-filter'': Ein Filter, der die Auszugebenden Tiddler eindeutig spezifiziert.
* ''filename-filter'': [Option] Filter, der aus Tiddler Titeln, Pfadnamen extrahiert. Wenn weggelassen, dann wird der Standard verwendet: `[is[tiddler]addsuffix[.html]]`, welcher den Titel als Dateiname verwendet. * ''filename-filter'': [Option] Filter, der aus Tiddler Titeln, Pfadnamen generiert. Wenn weggelassen, dann wird der Standard verwendet: `[is[tiddler]addsuffix[.html]]`, welcher den Titel als Dateiname verwendet.
* ''render-type'': [Option] Ausgabe Type: `text/html` (Standard) generiert HTML Text und `text/plain` gibt den "reinen" Text Inhalt zurück. `text/plain` ignoriert HTML Marker und andere "nicht-druckbare" Zeichen. * ''render-type'': [Option] Ausgabe Typ: `text/html` (Standard) generiert HTML Text und `text/plain` gibt den "reinen" Text Inhalt zurück. `text/plain` ignoriert HTML Marker und andere "nicht-druckbare" Zeichen.
* ''template'': [Option] Template, das verwendet werden soll * ''template'': [Option] Template, das verwendet werden soll
* ''name'': [Option] Name einer zusätzlichen Variablen. * ''name'': [Option] Name einer zusätzlichen Variablen.
* ''value'': [Option] Wert dieser zusätzlichen Variablen. * ''value'': [Option] Wert dieser zusätzlichen Variablen.
@ -27,7 +27,7 @@ Wichtig:
* Das `output` Verzeichnis wird nicht gelöscht, bevor neue Dateien geschrieben werden. * Das `output` Verzeichnis wird nicht gelöscht, bevor neue Dateien geschrieben werden.
* Verzeichnisse und Dateien werden automatisch angelegt, sollten sie nicht vorhanden sein. * Verzeichnisse und Dateien werden automatisch angelegt, sollten sie nicht vorhanden sein.
* Wenn eine Datei Leerzeichen enthält, dann muss dies ''doppelt'' angezeigt werden. Für TiddlyWiki mit eckigen Klammern `[[]]` und für die Kommandozeile mit Hochkomma "". Zum Beispiel: `--render "[[Motovun Jack.jpg]]"` * Wenn eine Datei Leerzeichen enthält, dann muss dies ''doppelt'' angezeigt werden. Für TiddlyWiki mit eckigen Klammern `[[]]` und für die Kommandozeile mit Hochkomma "". Zum Beispiel: `--render "[[Motovun Jack.jpg]]"`
* Dateinamens-Filter zeigen immer auf den Titel, des gerade umzusetzenden Tiddlers. Das erlaubt uns, diesen als Basis für den Dateinamen zu verwenden. zB: `[encodeuricomponent[]addprefix[static/]]` ... Verwendet eine URI-Enkodierung für jeden Dateinamen und stellt das Wort `static/` als Pfadname voran. * Dateinamens-Filter zeigen immer auf den Titel, des gerade bearbeiteten Tiddlers. Das erlaubt uns, diesen als Basis für den Dateinamen zu verwenden. zB: `[encodeuricomponent[]addprefix[static/]]` ... Verwendet eine URI-Enkodierung für jeden Dateinamen und stellt das Wort `static/` als Pfadname voran.
* Es können mehrere ''name/value'' Paare verwendet werden. * Es können mehrere ''name/value'' Paare verwendet werden.
* Der `--render` Befehl ist flexibler und ersetzt daher `--rendertiddler` und `--rendertiddlers`, welche mit V5.1.15 auslaufen! * Der `--render` Befehl ist flexibler und ersetzt daher `--rendertiddler` und `--rendertiddlers`, welche mit V5.1.15 auslaufen!

View File

@ -3,7 +3,6 @@ description: Speichert Klartext Tiddler als Dateien
Speichert einzelne oder mehrere Klartext Tiddler als Text oder im Binärformat in Dateien. Die zu speichernden Tiddler werden über Filter spezifiziert. Speichert einzelne oder mehrere Klartext Tiddler als Text oder im Binärformat in Dateien. Die zu speichernden Tiddler werden über Filter spezifiziert.
``` ```
--save <tiddler-filter> <filename-filter> --save <tiddler-filter> <filename-filter>
``` ```

View File

@ -1,6 +1,11 @@
title: $:/language/Help/server title: $:/language/Help/server
description: (Dieser Befehl ist abgekündigt! - Neu ist: "listen") -- Stellt einen HTTP server für TiddlyWiki zur Verfügung. description: (Dieser Befehl ist abgekündigt! - Neu ist: "listen") -- Stellt einen HTTP server für TiddlyWiki zur Verfügung.
''WICHTIG:''
* Dieser Befehl ist abgekündigt!
* Wird durch: "listen" ersetzt.
TiddlyWiki bringt einen einfachen Web-Server mit. TiddlyWiki bringt einen einfachen Web-Server mit.
Der Server kann spezifische Tiddler im angegebenen Format anzeigen (rendern). Zudem können einzelne, oder mehrere Tiddler im JSON Format übertragen werden. Die unterstützten HTTP Funktionen sind: `GET`, `PUT` und `DELETE` Der Server kann spezifische Tiddler im angegebenen Format anzeigen (rendern). Zudem können einzelne, oder mehrere Tiddler im JSON Format übertragen werden. Die unterstützten HTTP Funktionen sind: `GET`, `PUT` und `DELETE`

View File

@ -25,13 +25,13 @@ Encryption/RepeatPassword: Passwort wiederholen
Encryption/PasswordNoMatch: Passwörter stimmen nicht überein Encryption/PasswordNoMatch: Passwörter stimmen nicht überein
Encryption/SetPassword: Passwort setzen Encryption/SetPassword: Passwort setzen
Error/Caption: Fehler Error/Caption: Fehler
Error/DeserializeOperator/MissingOperand: Filter Fehler: Fehlender Operand für 'deserialize' Operator Error/DeserializeOperator/MissingOperand: Filter Fehler: Fehlender Parameter für 'deserialize' Operator
Error/DeserializeOperator/UnknownDeserializer: Filter Fehler: Unbekannter "deserializer" als Operand für 'deserialize' Operator verwendet Error/DeserializeOperator/UnknownDeserializer: Filter Fehler: Unbekannter "deserializer" als Parameter für 'deserialize' Operator verwendet
Error/Filter: Filter Fehler Error/Filter: Filter Fehler
Error/FilterSyntax: Syntax Fehler im Filter-Ausdruck Error/FilterSyntax: Syntax Fehler im Filter-Ausdruck
Error/FilterRunPrefix: Filter Fehler: Unbekanntes Prefix für Filter lauf Error/FilterRunPrefix: Filter Fehler: Unbekanntes Prefix für Filter lauf
Error/IsFilterOperator: Filter Fehler: Unbekannter Operand für den 'is' Filter Operator Error/IsFilterOperator: Filter Fehler: Unbekannter Parameter für den 'is' Filter Operator
Error/FormatFilterOperator: Filter Fehler: Unbekannter Operand für den 'format' Filter Operator Error/FormatFilterOperator: Filter Fehler: Unbekannter Parameter für den 'format' Filter Operator
Error/LoadingPluginLibrary: Fehler beim Laden der "plugin library" Error/LoadingPluginLibrary: Fehler beim Laden der "plugin library"
Error/NetworkErrorAlert: `<h2>''Netzwerk Fehler''</h2>Es scheint, die Verbindung zum Server ist ausgefallen. Das weist auf Probleme mit der Netzwerkverbindung hin. Bitte versuchen Sie die Verbingung wider herzustellen, bevor Sie weitermachen.<br><br>''Nicht gespeicherte Änderungen werden automatich synchronisiert, sobald die Verbindung wider hergestellt ist. Error/NetworkErrorAlert: `<h2>''Netzwerk Fehler''</h2>Es scheint, die Verbindung zum Server ist ausgefallen. Das weist auf Probleme mit der Netzwerkverbindung hin. Bitte versuchen Sie die Verbingung wider herzustellen, bevor Sie weitermachen.<br><br>''Nicht gespeicherte Änderungen werden automatich synchronisiert, sobald die Verbindung wider hergestellt ist.
Error/PutEditConflict: Datei am Server verändert Error/PutEditConflict: Datei am Server verändert
@ -70,7 +70,7 @@ No: Nein
OfficialPluginLibrary: Offizielles ~TiddlyWiki Plugin-Verzeichnis OfficialPluginLibrary: Offizielles ~TiddlyWiki Plugin-Verzeichnis
OfficialPluginLibrary/Hint: Offizielles ~TiddlyWiki Plugin-Verzeichnis auf tiddlywiki.com. Plugin, Themes und Sprach Dateien werden vom "core team" gewartet. OfficialPluginLibrary/Hint: Offizielles ~TiddlyWiki Plugin-Verzeichnis auf tiddlywiki.com. Plugin, Themes und Sprach Dateien werden vom "core team" gewartet.
PageTemplate/Description: das Standard ~TiddlyWiki Layout PageTemplate/Description: das Standard ~TiddlyWiki Layout
PageTemplate/Name: Standard ~PageTemplate PageTemplate/Name: Standard Layout
PluginReloadWarning: Das Wiki muss gespeichert {{$:/core/ui/Buttons/save-wiki}} und neu gladen {{$:/core/ui/Buttons/refresh}} werden, damit die ~JavaScript Plugins ausgeführt werden. PluginReloadWarning: Das Wiki muss gespeichert {{$:/core/ui/Buttons/save-wiki}} und neu gladen {{$:/core/ui/Buttons/refresh}} werden, damit die ~JavaScript Plugins ausgeführt werden.
RecentChanges/DateFormat: YYYY MMM DD RecentChanges/DateFormat: YYYY MMM DD
Shortcuts/Input/AdvancedSearch/Hint: Öffne den ~AdvancedSearch Tiddler vom "Suchmenü" aus Shortcuts/Input/AdvancedSearch/Hint: Öffne den ~AdvancedSearch Tiddler vom "Suchmenü" aus

View File

@ -1,5 +1,4 @@
title: $:/language/Modals/Download title: $:/language/Modals/Download
type: text/vnd.tiddlywiki
subtitle: Änderungen Speichern subtitle: Änderungen Speichern
footer: <$button message="tm-close-tiddler">Schließen</$button> footer: <$button message="tm-close-tiddler">Schließen</$button>
help: https://tiddlywiki.com/static/DownloadingChanges.html help: https://tiddlywiki.com/static/DownloadingChanges.html

View File

@ -65,6 +65,10 @@ sidebar-tab-foreground-selected: 侧边栏选定页签前景
sidebar-tab-foreground: 侧边栏页签前景 sidebar-tab-foreground: 侧边栏页签前景
sidebar-tiddler-link-foreground-hover: 侧边栏悬停条目链结前景 sidebar-tiddler-link-foreground-hover: 侧边栏悬停条目链结前景
sidebar-tiddler-link-foreground: 侧边栏条目链结前景 sidebar-tiddler-link-foreground: 侧边栏条目链结前景
stability-stable: 稳定性等级 "stable" 的徽章
stability-experimental: 稳定性等级 "experimental" 的徽章
stability-deprecated: 稳定性等级 "deprecated" 的徽章
stability-legacy: 稳定性等级 "legacy" 的徽章
testcase-accent-level-1: 无嵌套的测试案例强调色 testcase-accent-level-1: 无嵌套的测试案例强调色
testcase-accent-level-2: 第二级嵌套的测试案例强调色 testcase-accent-level-2: 第二级嵌套的测试案例强调色
testcase-accent-level-3: 第三级或更高级别嵌套的测试案例强调色 testcase-accent-level-3: 第三级或更高级别嵌套的测试案例强调色

View File

@ -65,6 +65,10 @@ sidebar-tab-foreground-selected: 側邊欄選定頁籤前景
sidebar-tab-foreground: 側邊欄頁籤前景 sidebar-tab-foreground: 側邊欄頁籤前景
sidebar-tiddler-link-foreground-hover: 側邊欄懸停條目鏈結前景 sidebar-tiddler-link-foreground-hover: 側邊欄懸停條目鏈結前景
sidebar-tiddler-link-foreground: 側邊欄條目鏈結前景 sidebar-tiddler-link-foreground: 側邊欄條目鏈結前景
stability-stable: 穩定性等級 "stable" 的徽章
stability-experimental: 穩定性等級 "experimental" 的徽章
stability-deprecated: 穩定性等級 "deprecated" 的徽章
stability-legacy: 穩定性等級 "legacy" 的徽章
testcase-accent-level-1: 無嵌套的測試案例強調色 testcase-accent-level-1: 無嵌套的測試案例強調色
testcase-accent-level-2: 第二級嵌套的測試案例強調色 testcase-accent-level-2: 第二級嵌套的測試案例強調色
testcase-accent-level-3: 第三級或更高級別嵌套的測試案例強調色 testcase-accent-level-3: 第三級或更高級別嵌套的測試案例強調色

View File

@ -571,3 +571,5 @@ Anders Jarmund, @andjar, 2024/04/05
@sarna, 2024/04/28 @sarna, 2024/04/28
Fokzo Kat, @CyberFoxar, 2024/05/20 Fokzo Kat, @CyberFoxar, 2024/05/20
Andrei Rybak, @rybak, 2024/06/09

View File

@ -33,7 +33,7 @@ ConfettiManager.prototype.launch = function (delay,options) {
self.outstandingTimers.splice(p,1); self.outstandingTimers.splice(p,1);
} else { } else {
console.log("Confetti Manager Error: Cannot find previously stored timer ID"); console.log("Confetti Manager Error: Cannot find previously stored timer ID");
debugger; // debugger;
} }
confetti(options); confetti(options);
},delay); },delay);

View File

@ -3,7 +3,8 @@ tags: $:/tags/ConfettiExample
<$button> <$button>
<$action-sendmessage $message="tm-confetti-launch"/> <$action-sendmessage $message="tm-confetti-launch"/>
<$action-sendmessage $message="tm-confetti-launch" originY=0.6 spread=70 delay=300/> <$action-sendmessage $message="tm-confetti-launch" delay=300 originY=0.6 spread=100 scalar=1.5/>
<$action-sendmessage $message="tm-confetti-launch" originY=0.55 spread=30 delay=600/> <$action-sendmessage $message="tm-confetti-launch" delay=400 originY=0.55 spread=130/>
Launch three staggered rounds of confetti <$action-sendmessage $message="tm-confetti-launch" delay=500 originY=0.55 spread=170 scalar=2/>
Launch four staggered rounds of confetti
</$button> </$button>

View File

@ -6,5 +6,5 @@ Type the word "launch": <$edit-text tiddler="$:/temp/confetti/launchstatus" tag=
<$list filter="[{$:/temp/confetti/launchstatus}match:caseinsensitive[launch]]" variable="ignore"> <$list filter="[{$:/temp/confetti/launchstatus}match:caseinsensitive[launch]]" variable="ignore">
Launched! Launched!
<$confetti particleCount=100/> <$confetti particleCount=100/>
<$confetti particleCount=100 delay=300/> <$confetti particleCount=100 spread=170 delay=300/>
</$list> </$list>

View File

@ -66,7 +66,7 @@ ElementSpotlight.prototype.querySelectorSafe = function(selector) {
ElementSpotlight.prototype.positionSpotlight = function(x,y,innerRadius,outerRadius,opacity) { ElementSpotlight.prototype.positionSpotlight = function(x,y,innerRadius,outerRadius,opacity) {
this.spotlightElement.style.display = "block"; this.spotlightElement.style.display = "block";
this.spotlightElement.style.backgroundImage = "radial-gradient(circle at " + (x / window.innerWidth * 100) + "% " + (y / window.innerHeight * 100) + "%, transparent " + innerRadius + "px, rgba(0, 0, 0, " + opacity + ") " + outerRadius + "px)"; this.spotlightElement.style.backgroundImage = "radial-gradient(circle at " + (x / document.documentElement.clientWidth * 100) + "% " + (y / document.documentElement.clientHeight * 100) + "%, transparent " + innerRadius + "px, rgba(0, 0, 0, " + opacity + ") " + outerRadius + "px)";
}; };
ElementSpotlight.prototype.easeInOut = function(v) { ElementSpotlight.prototype.easeInOut = function(v) {

View File

@ -10,7 +10,7 @@ The following attributes are supported:
|!Attribute |!Description | |!Attribute |!Description |
|''state'' |The title of a state tiddler used to track the state of the map in the `zoom`, `long` and `lat` fields | |''state'' |The title of a state tiddler used to track the state of the map in the `zoom`, `long` and `lat` fields |
|''startPosition'' |Optional starting position for the map: "world" (the default) shows the entire map, "bounds" zooms to the bounds of the loaded layes | |''startPosition'' |Optional keyword representing the starting position for the map: "world" (the default) shows the entire map, "bounds" zooms to the bounds of the loaded layers |
|''layersPanel'' |Optional starting status for the layers panel: "collapsed" (the default) causes the layers panel to initially be shown collapsed, "open" causes the layers panel to initially be shown opened | |''layersPanel'' |Optional starting status for the layers panel: "collapsed" (the default) causes the layers panel to initially be shown collapsed, "open" causes the layers panel to initially be shown opened |
If no base layers are defined by `<$geobaselayer>` widgets within the `<$geomap>` widget then all the available base layers will be loaded by the equivalent of the following code: If no base layers are defined by `<$geobaselayer>` widgets within the `<$geomap>` widget then all the available base layers will be loaded by the equivalent of the following code:

View File

@ -54,7 +54,7 @@ GeomapWidget.prototype.render = function(parent,nextSibling) {
parent.insertBefore(this.domNode,nextSibling); parent.insertBefore(this.domNode,nextSibling);
this.domNodes.push(this.domNode); this.domNodes.push(this.domNode);
// Render the map // Render the map
if($tw.browser) { if($tw.browser && !this.domNode.isTiddlyWikiFakeDom) {
this.renderMap(); this.renderMap();
this.refreshMap(); this.refreshMap();
} }

View File

@ -3,13 +3,12 @@ tags: $:/tags/ControlPanel/Toolbars
caption: Menu Bar caption: Menu Bar
\define config-base() $:/config/plugins/menubar/MenuItems/Visibility/ \define config-base() $:/config/plugins/menubar/MenuItems/Visibility/
\define lingo-base() $:/plugins/tiddlywiki/menubar/language/
! <<lingo Config/Heading1>> ! Menu Bar Configuration
!! <<lingo Config/MenuItems/Heading>> !! Menu Items
<<lingo Config/MenuItems/Description>> Select which menu items will be shown. You can also drag items to reorder them.
<$set name="tv-config-toolbar-icons" value="yes"> <$set name="tv-config-toolbar-icons" value="yes">
@ -21,18 +20,18 @@ caption: Menu Bar
</$set> </$set>
!! <<lingo Config/BreakpointPosition/Heading>> !! Breakpoint Position
<<lingo Config/BreakpointPosition/Description>> The breakpoint position between narrow and wide screens. Should include CSS units (eg. `400px`).
<$edit-text tiddler="$:/config/plugins/menubar/breakpoint" default="" tag="input"/> <$edit-text tiddler="$:/config/plugins/menubar/breakpoint" default="" tag="input"/>
!! <<lingo Config/ContentsTag/Heading>> !! Contents Tag
<<lingo Config/ContentsTag/Description>> The tag for the ~TableOfContents used in the Contents dropdown
<$edit-text tiddler="$:/config/plugins/menubar/TableOfContents/Tag" default="" tag="input"/> <$edit-text tiddler="$:/config/plugins/menubar/TableOfContents/Tag" default="" tag="input"/>
!! <<lingo Config/MenuBarColours/Heading>> !! Menu Bar Colours
<<lingo Config/MenuBarColours/Description>> To change the colour of the menu bar, define the colours `menubar-foreground` and `menubar-background` in the currently selected palette

View File

@ -1,6 +1,6 @@
title: $:/plugins/tiddlywiki/menubar/items/contents title: $:/plugins/tiddlywiki/menubar/items/contents
caption: <<lingo Items/TOC/Name $:/plugins/tiddlywiki/menubar/language/>> caption: Contents
description: <<lingo Items/TOC/Description $:/plugins/tiddlywiki/menubar/language/>> description: Table of Contents
is-dropdown: yes is-dropdown: yes
tags: $:/tags/MenuBar tags: $:/tags/MenuBar

View File

@ -1,7 +1,7 @@
title: $:/plugins/tiddlywiki/menubar/items/hamburger title: $:/plugins/tiddlywiki/menubar/items/hamburger
tags: $:/tags/MenuBar tags: $:/tags/MenuBar
caption: <<lingo Items/Hamburger/Name $:/plugins/tiddlywiki/menubar/language/>> caption: Hamburger
description: <<lingo Items/Hamburger/Description $:/plugins/tiddlywiki/menubar/language/>> description: Show the full menu bar on a narrow screen
custom-menu-content: {{$:/plugins/tiddlywiki/menubar/items/hamburger}} custom-menu-content: {{$:/plugins/tiddlywiki/menubar/items/hamburger}}
show-when: narrow show-when: narrow

View File

@ -1,7 +1,7 @@
title: $:/plugins/tiddlywiki/menubar/items/pagecontrols title: $:/plugins/tiddlywiki/menubar/items/pagecontrols
tags: $:/tags/MenuBar tags: $:/tags/MenuBar
description: <<lingo Items/PageControls/Name $:/plugins/tiddlywiki/menubar/language/>> description: Page controls from the sidebar
caption: <<lingo Items/PageControls/Name $:/plugins/tiddlywiki/menubar/language/>> caption: Page controls
custom-menu-content: <$transclude tiddler="$:/plugins/tiddlywiki/menubar/items/pagecontrols" mode="inline"/> custom-menu-content: <$transclude tiddler="$:/plugins/tiddlywiki/menubar/items/pagecontrols" mode="inline"/>
\whitespace trim \whitespace trim

View File

@ -1,7 +1,7 @@
title: $:/plugins/tiddlywiki/menubar/items/search title: $:/plugins/tiddlywiki/menubar/items/search
custom-menu-content: {{$:/plugins/tiddlywiki/menubar/items/search}} custom-menu-content: {{$:/plugins/tiddlywiki/menubar/items/search}}
description: <<lingo Items/Search/Name $:/plugins/tiddlywiki/menubar/language/>> description: Search
caption: <<lingo Items/Search/Name $:/plugins/tiddlywiki/menubar/language/>> caption: Search
tags: $:/tags/MenuBar tags: $:/tags/MenuBar
\define cancel-search-actions() \define cancel-search-actions()

View File

@ -1,7 +1,7 @@
title: $:/plugins/tiddlywiki/menubar/items/server title: $:/plugins/tiddlywiki/menubar/items/server
tags: $:/tags/MenuBar tags: $:/tags/MenuBar
description: <<lingo Items/Server/Description $:/plugins/tiddlywiki/menubar/language/>> description: Server options
caption: <<lingo Items/Server/Name $:/plugins/tiddlywiki/menubar/language/>> caption: Server
custom-menu-content: <$transclude tiddler="$:/plugins/tiddlywiki/menubar/items/server" mode="inline"/> custom-menu-content: <$transclude tiddler="$:/plugins/tiddlywiki/menubar/items/server" mode="inline"/>
<$list filter="[[$:/status/IsLoggedIn]get[text]else[no]match[yes]]" variable="ignore"> <$list filter="[[$:/status/IsLoggedIn]get[text]else[no]match[yes]]" variable="ignore">

View File

@ -1,6 +1,6 @@
title: $:/plugins/tiddlywiki/menubar/items/sidebar title: $:/plugins/tiddlywiki/menubar/items/sidebar
caption: <<lingo Items/Sidebar/Name $:/plugins/tiddlywiki/menubar/language/>> caption: Sidebar
description: <<lingo Items/Sidebar/Name $:/plugins/tiddlywiki/menubar/language/>> description: Sidebar
is-dropdown: yes is-dropdown: yes
tags: $:/tags/MenuBar tags: $:/tags/MenuBar

View File

@ -1,7 +1,7 @@
title: $:/plugins/tiddlywiki/menubar/items/topleftbar title: $:/plugins/tiddlywiki/menubar/items/topleftbar
tags: $:/tags/MenuBar tags: $:/tags/MenuBar
description: <<lingo Items/TopLeftBar/Description $:/plugins/tiddlywiki/menubar/language/>> description: Items from $:/tags/TopLeftBar
caption: <<lingo Items/TopLeftBar/Name $:/plugins/tiddlywiki/menubar/language/>> caption: Legacy Top Left Bar
custom-menu-content: <$transclude tiddler="$:/plugins/tiddlywiki/menubar/items/topleftbar" mode="inline"/> custom-menu-content: <$transclude tiddler="$:/plugins/tiddlywiki/menubar/items/topleftbar" mode="inline"/>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TopLeftBar]!has[draft.of]]" variable="listItem" storyview="pop"> <$list filter="[all[shadows+tiddlers]tag[$:/tags/TopLeftBar]!has[draft.of]]" variable="listItem" storyview="pop">

View File

@ -1,7 +1,7 @@
title: $:/plugins/tiddlywiki/menubar/items/toprightbar title: $:/plugins/tiddlywiki/menubar/items/toprightbar
tags: $:/tags/MenuBar tags: $:/tags/MenuBar
description: <<lingo Items/TopRightBar/Description $:/plugins/tiddlywiki/menubar/language/>> description: Items from $:/tags/TopRightBar
caption: <<lingo Items/TopRightBar/Name $:/plugins/tiddlywiki/menubar/language/>> caption: Legacy Top Right Bar
custom-menu-content: <$transclude tiddler="$:/plugins/tiddlywiki/menubar/items/toprightbar" mode="inline"/> custom-menu-content: <$transclude tiddler="$:/plugins/tiddlywiki/menubar/items/toprightbar" mode="inline"/>
custom-menu-styles-wide: float: right; custom-menu-styles-wide: float: right;

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