1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-01-25 12:23:42 +00:00

Compare commits

..

51 Commits

Author SHA1 Message Date
Saq Imtiaz
0b38a1a921 Remove trailing newline from list.tid 2026-01-20 09:57:45 +01:00
Saq Imtiaz
c87d72d849 Fix regressions in list-tagged-draggable 2026-01-20 09:55:57 +01:00
Bram Chen
faee49ee01 Update chinese language files (#9576)
* Update chinese language files
* add chinese translations for alert aria message

* Update chinese language files
* update related change note
2026-01-20 07:33:05 +01:00
yaisog
dd20be49f0 Make impact note for #9337 less verbose / repetitive (#9481)
* Make impact note less verbose / repetitive for #9337

* Correct some fields
2026-01-20 07:16:21 +01:00
Simon Huber
a27f74bbdc Fixes bug in sidebar tab Open to allow disabling drag and drop (#9504)
the variable is called `tv-enable-drag-and-drop` - not `tv-allow-drag-and-drop`
2026-01-20 07:06:29 +01:00
Jeremy Ruston
ae4e99951a Revert #9554 Refactor stylesheets in single <style> tags
These changes break the palette switcher
2026-01-18 11:40:10 +00:00
Mario Pietsch
be84dee26b Allow unused variables in function headers and caught exceptions (#9588) 2026-01-17 17:51:51 +00:00
XLBilly
00e17874f0 Add stylesheet wiki information (#9565)
* Add stylesheet wiki information

* Use 2 spaces

* Update change note

* Use ∈ symbol instead
I think this one is less confusing than the previous one
2026-01-17 15:00:32 +00:00
XLBilly
9041f099a3 Refactor stylesheets in single <style> tags (#9554)
* Create RootStylesheet.tid

* put stylesheets into single <style> tags

* viewHandler should not be a widget

* format RootStylesheet

* add ROOT_STYLESHEET_TITLE constant

* use let widget in RootStylesheet

* use view widget from #8135 for testing

* reformat RootStylesheet

* update view widget

* update view widget

* update view widget

* update view widget

* update view widget

* update view widget

* trying to fix the date parsing

* refactor view widget with more extensible architecture

* remove performance instrumentation

* hardcode reset and base stylesheets

* adopt ES2017 syntax for view widget

* don't hardcode vanilla/base

* remove unused constructors

* remove unused variable

* make refresh method static

* trying to fix missingThis

* add changenote

* revert change in vanilla/base

* Revert changes to the view widget

* Refactor RootStylesheet.tid
* Use transclude widget instead of view widget
* Remove hardcoded noramlize.css

* Add comment for debugging

* Migrate some templates to use RootStylesheet

* Remove PAGE_STYLESHEET_TITLE
Since it is no longer used in render.js

* Update change note

---------

Co-authored-by: Simon Huber <huber.simon@protonmail.com>
2026-01-17 14:59:10 +00:00
yaisog
3ba31be2a8 Add the words and lines modes to $diff-text (#9551)
* Initial commit

* Add line ending configuration for consistent tests

* Initial commit

* Correctly consider editcost parameter

* Move diffPartsToChars() to $tw.utils

* Remove superfluous file

* Correct "efficiency" parameter naming in the documentation

The parameter was incorrectly referred to as "efficent" in several places.

* Update diffPartsToChars to ES2017 style

* Consolidate let/const declarations
2026-01-17 14:57:52 +00:00
XLBilly
99d8afd515 Bump markdown-it to latest version (#9513)
* Bump markdown-it to newest version

* Update change note
2026-01-17 14:56:16 +00:00
Jeremy Ruston
2ab5f26644 Merge branch 'tiddlywiki-com' 2026-01-16 17:36:54 +00:00
Mario Pietsch
419fe68ee2 [Docs] Improve tag-pill documentation and examples (#9580)
* [Docs] Improve tag-pill documentation and examples

* Apply suggestion from @saqimtiaz

---------

Co-authored-by: Saq Imtiaz <saq.imtiaz@gmail.com>
2026-01-14 14:04:34 +01:00
XLBilly
0e765bdbdb Make alert aria message translatable (#9575)
* Make alerts aria message translatable

* Update change notes

* Update change note
2026-01-12 10:21:35 +01:00
Jeremy Ruston
855d8a9638 Fix images loaded from _canonical_uri tiddlers do not have loading and error classes assigned (#9570)
* Fix images loaded from _canonical_uri tiddlers do not have loading and error classes assigned

* Create changenote

* Joyously fix eslint error
2026-01-10 14:50:31 +00:00
Jeremy Ruston
afcf108d29 Add changenote 2026-01-10 14:42:58 +00:00
Jeremy Ruston
8f9acc0ca2 Fix missing file extension 2026-01-10 14:35:26 +00:00
Jeremy Ruston
5e4b8fbb3c Additional fix for #9177 2026-01-08 18:20:57 +00:00
lin onetwo
8e301178a4 Feat/view button condition (#9466)
* feat: support condition field on $:/tags/ViewToolbar button

* Delete convert-markdown.tid

* Create #9466.tid

* Update title.tid
2026-01-08 13:34:58 +01:00
Cameron Fischer
a72d3a09bf Quick fix to some deprecated class methods (#9561) 2026-01-08 10:13:16 +01:00
Jeremy Ruston
56634ffe29 Merge branch 'tiddlywiki-com' 2026-01-05 16:36:49 +00:00
Jeremy Ruston
24c317e1ab Revert "Add macro operator (#9520)"
This reverts commit 3c8ee86e23.
2026-01-05 16:18:01 +00:00
Jeremy Ruston
07329c6849 Revert "Root stylesheet refresh - Stylesheets in single <style> tags (#8130)"
This reverts commit da41a55f29.
2026-01-05 16:05:15 +00:00
yaisog
47ab3476f6 Improve LogWidget and ActionLogWidget documentation (#9550) 2026-01-05 14:31:11 +01:00
Mario Pietsch
f0e64660f2 [DOCS] Add multi-columns class to Widgets in Wikitext (#9516) 2026-01-04 21:45:19 +00:00
Mohammad Rahmani
9663e65f4b list-tagged-draggable to use title field by default (#9177)
* Revert the list-tagged-draggable to use title field by default

* Update list.tid

It seems `<$transclude field=<<__field__>> />` when field default value is empty does not work as expected.
This commit uses `field:"title"` instead of `field:""` in the list-tagged-draggable header.

* Update list.tid

The redundant `field` removed. The new `displayField` attribute is used to let user choose the filed they like to display when the list items are rendered as simple links.

* Update list.tid

The proposed field attribute in list-tagged-draggable updated to use the same `displayField` aslist-links-draggable.

* Create #9177

change note for #9177 was created

* Update list.tid

The `list-links-draggable` now is fully backward compatible. It uses caption as default field as before and is compatible with `list-links`.

The `list-tagged-draggable` is fully backward compatible while got a new displayField parameter.

* Update list-tagged-draggable Macro.tid

Update docs to reflect new displayField parameter

* Update list-links-draggable Macro.tid

Update documentation to reflect the new displayField parameter.

* Update list-tagged-draggable Macro.tid

Update docs. Remove formatting error in doc.
2026-01-04 21:41:38 +00:00
Mario Pietsch
7cb422242a DOCS - Fix typo in Date Fields (#9518) 2026-01-04 21:36:57 +00:00
Jeremy Ruston
f075f24e6b Merge branch 'tiddlywiki-com' 2026-01-04 20:48:58 +00:00
superuser-does
5fa1098c03 tw5.com: remove duplicate text from Forums tiddler (#9523) 2026-01-04 18:15:37 +00:00
superuser-does
92dc927c7b docs: savetiddlers extension is now Firefox-only (#9524)
* tw5.com: removed Chrome browser from savetiddlers

Was deprecated in early 2025, and is now Firefox-only

Additional changes:
* Lowercased buggyj in line with how the name is used elsewhere on tw5.com and the rest of the internet
* Pulled url from the url field (following the example of Timimi resource tiddler)
* Changed formatting of title to match other community resources

* tw5.com: update French & Japanese savetiddlers plugin docs to note it is now Firefox-only

Please note this update was validated using machine translation
2026-01-04 18:12:56 +00:00
XLBilly
98a61f01bb Add locale support for sort operator (#9400)
* Locale support for sort operator

* Add checkLanguageCode util function

* Update docs & add language code validation

* Replace multiple isDescending with reverse

* Revert "Replace multiple isDescending with reverse"

This reverts commit 793177b8bc.

* Simplify sortTiddler with Intl.Collator

* Add change notes

* Remove comment

* Update makeCompareFunction to support locale

* Update checkLanguageCode

* Add locale support for sortsub

* Add locale support for sort filter run prefix

* Revert "Add locale support for sort filter run prefix"

This reverts commit 9479a156d7.

* Remove checkLanguageCode
Since filters are able to catch errors now

* Update locale example

* Revert " Add locale support for sortsub"

This reverts commit 4a617188fc.

* Revert "Update makeCompareFunction to support locale"

This reverts commit 0ebca08036.

* Update docs

* Update change note
2026-01-04 18:03:54 +00:00
superuser-does
f3fa69e229 Docs: rename 'definition lists' to 'description lists' (#9535)
* docs: Definition Lists to definition lists

* tw5.com: rename Definition Lists to Description Lists throught tiddler

* apply recommendations by @pmario on #9535
2026-01-04 17:37:54 +00:00
Mario Pietsch
e2fb22ade0 Bug report template: Rename description to about (#9546) 2026-01-04 16:50:01 +00:00
peteratkins
7fb8560908 Signing CLA (#9534)
Co-authored-by: Jeremy Ruston <jeremy@jermolene.com>
2026-01-04 13:30:54 +00:00
Jeremy Ruston
ff7814360e Cleanup whitespace in CLA 2026-01-04 13:19:24 +00:00
hsteve11
2d9303c6ff Signing CLA (#9539) 2026-01-04 13:18:46 +00:00
Mario Pietsch
6aee5eb0c7 Add Filter Syntax History link to Filters tiddler (#9541) 2026-01-04 13:16:54 +00:00
Mario Pietsch
6eb881bffe New issue and bug report templates (#9512)
* New issue and bug report templates

* Change bug_report to .md file

* update bug report text

* Move To Reproduce up next to Problem Description

* Fix typo
2026-01-04 13:08:40 +00:00
IchijikuIchigo
2a5ce95d99 Update Japanese translation (#9542)
* Update Japanese translation

* Update Japanese translation

* Update Japanese translation

* Update Japanese translation
2026-01-04 12:14:41 +00:00
XLBilly
bd4fdd8f2e Improve tabs macro accessibility (#9348)
* Improve tabs macro accessibility

* Fix wrong aria-selected attribute

* Patch button widget to allow changing the default aria-checked attribute

* Patch button widget to have aria-checked attribute set to false

* Update tests

* Further fix tests

* Update docs

* Update change notes
2026-01-04 12:13:10 +00:00
XLBilly
09379abd5d Bidirectional improvements for core classes (#9148)
* Bidirectional improvements for core classes

* Fix Control Panel table text direction

* Switch to logical properties

* Add -webkit-margin-* properties

* Improve backward compatibility

* Use supports CSS at-rule for fallback

* Tiddler controls, alert, TOC update.

* tc-tree & testcase update

* .tc-sidebar-scrollable use new syntax

* Snow white use standard value

* Update divider

* Avoid negative logic

* Remove :dir rules at the moment

* Use property procedures

* Add change note

* Update blockquote

* Update unfold banner

* Update tiddlerinfo close button

* Group supports rule

* Update tiddler title icon

* Fix wrong float and margin
2026-01-04 12:02:28 +00:00
XLBilly
c6906120d8 Migrate diff-match-patch to a modern fork (#9511)
* Migrate to diff-match-patch-es & update api

* Update acknowledgements

* Update change notes

* Fix editcost attribute not working

* Make library compatible with ES2017
2026-01-04 11:56:25 +00:00
Jeremy Ruston
c4c60933f4 Merge branch 'tiddlywiki-com' 2026-01-04 11:40:01 +00:00
XLBilly
a3979cda9c Refactor base64 utility functions (#9488)
* Split base64 utility functions to two platforms

* Simplify Nodejs atob

* Update change note

* Update docs

* Move base64Decode & base64Encode back to utils.js

* Add missing use strict
2026-01-04 11:35:02 +00:00
XLBilly
3c8ee86e23 Add macro operator (#9520)
* Add macro operator

* Replace unnecessary usage of wikify widget

* Simplify multiple let widget

* fixup! Replace unnecessary usage of wikify widget

* Update tests

* Update change note

* fixup! Replace unnecessary usage of wikify widget

* Update docs

* fixup! Update tests
2026-01-04 11:31:30 +00:00
XLBilly
921c0174fb Purge IE related docs (#9134) 2026-01-04 09:42:01 +01:00
XLBilly
4196d96adc [DOCS] Update docs about saving via WebDAV (#9543) 2026-01-02 09:42:58 +01:00
Jeremy Ruston
743e99d12d Further fix to #9538 2025-12-29 21:44:57 +00:00
Jeremy Ruston
6beeb23d10 Fix browser storage plugin triggers save (#9538)
* Initial Commit

* Add changenote
2025-12-29 21:09:43 +00:00
wiki-tutor
838fad916d Signing CLA (#9527) 2025-12-28 18:30:51 +00:00
Jeremy Ruston
935e89bd93 Tweak HelloThere thumbnail ordering 2025-12-20 09:25:25 +00:00
142 changed files with 2530 additions and 2747 deletions

62
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,62 @@
---
name: Bug report
about: Create a report to help us improve TiddlyWiki 5
title: "[Report] "
type: report
---
<!-- Remove elements, that you do not need -->
<!-- Add screenshots where needed -->
**Problem Description**
<!-- Describe your problem: A clear and concise description of what your problem is -->
**To Reproduce**
Steps to reproduce the behavior:
1. At https://tiddlywiki.com
2. Click on ...
3. Scroll down to ...
4. See ...
**Expected behavior**
As a user,
<!-- As a developer, -->
I would expect ...
**TiddlyWiki Configuration**
<!-- Please complete the following information -->
- Report created with: [Wiki Information](https://tiddlywiki.com/#%24%3A%2Fcore%2Fui%2FControlPanel%2FWikiInformation)
<!-- Your report comes here -->
<!-- or -->
<!-- Add it manually -->
- Version: <!-- e.g. v5.3.8 -->
- Saving mechanism: <!-- e.g. Node.js, TiddlyDesktop, TiddlyHost etc -->
- Plugins installed: <!-- e.g. Freelinks, TiddlyMap ... other 3rd party plugins -->
**Desktop**
<!-- Please complete the following information -->
- OS: <!-- e.g. iOS -->
- Browser: <!-- e.g. chrome, safari, FireFox -- Version: -->
**Smartphone**
<!-- Please complete the following information -->
- Device: <!-- e.g. iPhone6 -->
- OS: <!-- e.g. iOS8.1 -->
- Browser: <!-- e.g. stock browser, safari, FireFox -- Version: -->
**Additional context**
<!-- Add any other context about the problem here. -->

View File

@@ -1,68 +0,0 @@
name: Bug report
description: Create a report to help us improve TiddlyWiki 5
title: "[BUG] "
type: bug
body:
- type: textarea
id: Describe
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
id: Expected
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
validations:
required: false
- type: textarea
id: Reproduce
attributes:
label: To Reproduce
description: "Steps to reproduce the behavior:"
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
validations:
required: false
- type: textarea
id: Screenshots
attributes:
label: Screenshots
description: If applicable, add screenshots to help explain your problem.
placeholder: Drag image here to upload screenshot!
validations:
required: false
- type: textarea
id: Configuration
attributes:
label: TiddlyWiki Configuration
description: please complete the following information
placeholder: |
- Version [e.g. v5.1.24]
- Saving mechanism [e.g. Node.js, TiddlyDesktop, TiddlyHost etc]
- Plugins installed [e.g. Freelinks, TiddlyMap]
### Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
### Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
validations:
required: true
- type: textarea
id: Context
attributes:
label: Additional context
description: Add any other context about the problem here.

View File

@@ -4,18 +4,23 @@ about: Suggest an idea for TiddlyWiki 5
title: "[IDEA]"
labels: ''
assignees: ''
type: feature
type: idea
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Is your idea related to a problem? Please describe.**
A clear and concise description of what the problem is. Eg:
As a user, I would like [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@@ -0,0 +1,30 @@
/*\
title: $:/core-modules/modules/utils/base64.js
type: application/javascript
module-type: utils-node
Base64 UTF-8 utlity functions.
\*/
"use strict";
const{ TextEncoder, TextDecoder } = require("node:util");
exports.btoa = binstr => Buffer.from(binstr, "binary").toString("base64");
exports.atob = b64 => Buffer.from(b64, "base64").toString("binary");
function base64ToBytes(base64) {
const binString = exports.atob(base64);
return Uint8Array.from(binString, m => m.codePointAt(0));
};
function bytesToBase64(bytes) {
const binString = Array.from(bytes, byte => String.fromCodePoint(byte)).join("");
return exports.btoa(binString);
};
exports.base64EncodeUtf8 = str => bytesToBase64(new TextEncoder().encode(str));
exports.base64DecodeUtf8 = str => new TextDecoder().decode(base64ToBytes(str));

View File

@@ -5,3 +5,4 @@ TiddlyWiki incorporates code from these fine OpenSource projects:
* [[The Stanford Javascript Crypto Library|http://bitwiseshiftleft.github.io/sjcl/]]
* [[The Jasmine JavaScript Test Framework|https://jasmine.github.io/]]
* [[modern-normalize by Sindre Sorhus|https://github.com/sindresorhus/modern-normalize]]
* [[diff-match-patch-es by antfu|https://github.com/antfu/diff-match-patch-es]]

View File

@@ -1,5 +1,6 @@
title: $:/language/
Alerts: Alerts
AboveStory/ClassicPlugin/Warning: It looks like you are trying to load a plugin designed for ~TiddlyWiki Classic. Please note that [[these plugins do not work with TiddlyWiki version 5.x.x|https://tiddlywiki.com/#TiddlyWikiClassic]]. ~TiddlyWiki Classic plugins detected:
BinaryWarning/Prompt: This tiddler contains binary data
ClassicWarning/Hint: This tiddler is written in TiddlyWiki Classic wiki text format, which is not fully compatible with TiddlyWiki version 5. See https://tiddlywiki.com/static/Upgrading.html for more details.

View File

@@ -14,31 +14,31 @@ Export our filter function
*/
exports.sort = function(source,operator,options) {
var results = prepare_results(source);
options.wiki.sortTiddlers(results,operator.operand || "title",operator.prefix === "!",false,false);
options.wiki.sortTiddlers(results,operator.operands[0] || "title",operator.prefix === "!",false,false,undefined,operator.operands[1]);
return results;
};
exports.nsort = function(source,operator,options) {
var results = prepare_results(source);
options.wiki.sortTiddlers(results,operator.operand || "title",operator.prefix === "!",false,true);
options.wiki.sortTiddlers(results,operator.operands[0] || "title",operator.prefix === "!",false,true,undefined,operator.operands[1]);
return results;
};
exports.sortan = function(source, operator, options) {
var results = prepare_results(source);
options.wiki.sortTiddlers(results, operator.operand || "title", operator.prefix === "!",false,false,true);
options.wiki.sortTiddlers(results, operator.operands[0] || "title", operator.prefix === "!",false,false,true,operator.operands[1]);
return results;
};
exports.sortcs = function(source,operator,options) {
var results = prepare_results(source);
options.wiki.sortTiddlers(results,operator.operand || "title",operator.prefix === "!",true,false);
options.wiki.sortTiddlers(results,operator.operands[0] || "title",operator.prefix === "!",true,false,undefined,operator.operands[1]);
return results;
};
exports.nsortcs = function(source,operator,options) {
var results = prepare_results(source);
options.wiki.sortTiddlers(results,operator.operand || "title",operator.prefix === "!",true,true);
options.wiki.sortTiddlers(results,operator.operands[0] || "title",operator.prefix === "!",true,true,undefined,operator.operands[1]);
return results;
};

View File

@@ -37,14 +37,14 @@ exports.trim = function(source,operator,options) {
operand = (operator.operand || ""),
fnCalc;
if(suffix === "prefix") {
fnCalc = function(a,b) {return [$tw.utils.trimPrefix(a,b)];}
fnCalc = function(a,b) {return [$tw.utils.trimPrefix(a,b)];};
} else if(suffix === "suffix") {
fnCalc = function(a,b) {return [$tw.utils.trimSuffix(a,b)];}
fnCalc = function(a,b) {return [$tw.utils.trimSuffix(a,b)];};
} else {
if(operand === "") {
fnCalc = function(a) {return [$tw.utils.trim(a)];}
fnCalc = function(a) {return [$tw.utils.trim(a)];};
} else {
fnCalc = function(a,b) {return [$tw.utils.trimSuffix($tw.utils.trimPrefix(a,b),b)];}
fnCalc = function(a,b) {return [$tw.utils.trimSuffix($tw.utils.trimPrefix(a,b),b)];};
}
}
source(function(tiddler,title) {
@@ -71,107 +71,53 @@ exports.join = makeStringReducingOperator(
},null
);
var dmp = require("$:/core/modules/utils/diff-match-patch/diff_match_patch.js");
const dmp = require("$:/core/modules/utils/diff-match-patch/diff_match_patch.js");
exports.levenshtein = makeStringBinaryOperator(
function(a,b) {
var dmpObject = new dmp.diff_match_patch(),
diffs = dmpObject.diff_main(a,b);
return [dmpObject.diff_levenshtein(diffs) + ""];
const diffs = dmp.diffMain(a,b);
return [dmp.diffLevenshtein(diffs).toString()];
}
);
// these two functions are adapted from https://github.com/google/diff-match-patch/wiki/Line-or-Word-Diffs
// this function is adapted from https://github.com/google/diff-match-patch/wiki/Line-or-Word-Diffs
function diffLineWordMode(text1,text2,mode) {
var dmpObject = new dmp.diff_match_patch();
var a = diffPartsToChars(text1,text2,mode);
var a = $tw.utils.diffPartsToChars(text1,text2,mode);
var lineText1 = a.chars1;
var lineText2 = a.chars2;
var lineArray = a.lineArray;
var diffs = dmpObject.diff_main(lineText1,lineText2,false);
dmpObject.diff_charsToLines_(diffs,lineArray);
var diffs = dmp.diffMain(lineText1,lineText2,false);
dmp.diffCharsToLines(diffs,lineArray);
return diffs;
}
function diffPartsToChars(text1,text2,mode) {
var lineArray = [];
var lineHash = {};
lineArray[0] = '';
function diff_linesToPartsMunge_(text,mode) {
var chars = '';
var lineStart = 0;
var lineEnd = -1;
var lineArrayLength = lineArray.length,
regexpResult;
var searchRegexp = /\W+/g;
while(lineEnd < text.length - 1) {
if(mode === "words") {
regexpResult = searchRegexp.exec(text);
lineEnd = searchRegexp.lastIndex;
if(regexpResult === null) {
lineEnd = text.length;
}
lineEnd = --lineEnd;
} else {
lineEnd = text.indexOf('\n', lineStart);
if(lineEnd == -1) {
lineEnd = text.length - 1;
}
}
var line = text.substring(lineStart, lineEnd + 1);
if(lineHash.hasOwnProperty ? lineHash.hasOwnProperty(line) : (lineHash[line] !== undefined)) {
chars += String.fromCharCode(lineHash[line]);
} else {
if(lineArrayLength == maxLines) {
line = text.substring(lineStart);
lineEnd = text.length;
}
chars += String.fromCharCode(lineArrayLength);
lineHash[line] = lineArrayLength;
lineArray[lineArrayLength++] = line;
}
lineStart = lineEnd + 1;
}
return chars;
}
var maxLines = 40000;
var chars1 = diff_linesToPartsMunge_(text1,mode);
maxLines = 65535;
var chars2 = diff_linesToPartsMunge_(text2,mode);
return {chars1: chars1, chars2: chars2, lineArray: lineArray};
};
exports.makepatches = function(source,operator,options) {
var dmpObject = new dmp.diff_match_patch(),
suffix = operator.suffix || "",
var suffix = operator.suffix || "",
result = [];
source(function(tiddler,title) {
var diffs, patches;
if(suffix === "lines" || suffix === "words") {
diffs = diffLineWordMode(title,operator.operand,suffix);
patches = dmpObject.patch_make(title,diffs);
} else {
patches = dmpObject.patch_make(title,operator.operand);
}
Array.prototype.push.apply(result,[dmpObject.patch_toText(patches)]);
});
source(function(tiddler,title) {
let diffs, patches;
if(suffix === "lines" || suffix === "words") {
diffs = diffLineWordMode(title,operator.operand,suffix);
patches = dmp.patchMake(title,diffs);
} else {
patches = dmp.patchMake(title,operator.operand);
}
Array.prototype.push.apply(result,[dmp.patchToText(patches)]);
});
return result;
};
exports.applypatches = makeStringBinaryOperator(
function(a,b) {
var dmpObject = new dmp.diff_match_patch(),
patches;
let patches;
try {
patches = dmpObject.patch_fromText(b);
patches = dmp.patchFromText(b);
} catch(e) {
}
if(patches) {
return [dmpObject.patch_apply(patches,a)[0]];
return [dmp.patchApply(patches,a)[0]];
} else {
return [a];
}
@@ -279,7 +225,7 @@ exports.pad = function(source,operator,options) {
}
});
return results;
}
};
exports.charcode = function(source,operator,options) {
var chars = [];

View File

@@ -11,17 +11,16 @@ The image parser parses an image into an embeddable HTML element
var ImageParser = function(type,text,options) {
var element = {
type: "element",
tag: "img",
attributes: {}
};
type: "image",
attributes: {}
};
if(options._canonical_uri) {
element.attributes.src = {type: "string", value: options._canonical_uri};
element.attributes.source = {type: "string", value: options._canonical_uri};
} else if(text) {
if(type === "image/svg+xml" || type === ".svg") {
element.attributes.src = {type: "string", value: "data:image/svg+xml," + encodeURIComponent(text)};
element.attributes.source = {type: "string", value: "data:image/svg+xml," + encodeURIComponent(text)};
} else {
element.attributes.src = {type: "string", value: "data:" + type + ";base64," + text};
element.attributes.source = {type: "string", value: "data:" + type + ";base64," + text};
}
}
this.tree = [element];

View File

@@ -18,7 +18,6 @@ exports.synchronous = true;
// Default story and history lists
var PAGE_TITLE_TITLE = "$:/core/wiki/title";
var PAGE_STYLESHEET_TITLE = "$:/core/ui/PageStylesheet";
var ROOT_STYLESHEET_TITLE = "$:/core/ui/RootStylesheet";
var PAGE_TEMPLATE_TITLE = "$:/core/ui/RootTemplate";
// Time (in ms) that we defer refreshing changes to draft tiddlers
@@ -45,13 +44,22 @@ exports.startup = function() {
publishTitle();
}
});
var styleParser = $tw.wiki.parseTiddler(ROOT_STYLESHEET_TITLE,{parseAsInline: true}),
styleWidgetNode = $tw.wiki.makeWidget(styleParser,{document: document});
styleWidgetNode.render(document.head,null);
// Set up the styles
$tw.styleWidgetNode = $tw.wiki.makeTranscludeWidget(PAGE_STYLESHEET_TITLE,{document: $tw.fakeDocument});
$tw.styleContainer = $tw.fakeDocument.createElement("style");
$tw.styleWidgetNode.render($tw.styleContainer,null);
$tw.styleWidgetNode.assignedStyles = $tw.styleContainer.textContent;
$tw.styleElement = document.createElement("style");
$tw.styleElement.innerHTML = $tw.styleWidgetNode.assignedStyles;
document.head.insertBefore($tw.styleElement,document.head.firstChild);
$tw.wiki.addEventListener("change",$tw.perf.report("styleRefresh",function(changes) {
styleWidgetNode.refresh(changes,document.head,null);
if($tw.styleWidgetNode.refresh(changes,$tw.styleContainer,null)) {
var newStyles = $tw.styleContainer.textContent;
if(newStyles !== $tw.styleWidgetNode.assignedStyles) {
$tw.styleWidgetNode.assignedStyles = newStyles;
$tw.styleElement.innerHTML = $tw.styleWidgetNode.assignedStyles;
}
}
}));
// Display the $:/core/ui/PageTemplate tiddler to kick off the display
$tw.perf.report("mainRender",function() {
@@ -60,7 +68,7 @@ exports.startup = function() {
$tw.utils.addClass($tw.pageContainer,"tc-page-container-wrapper");
document.body.insertBefore($tw.pageContainer,document.body.firstChild);
$tw.pageWidgetNode.render($tw.pageContainer,null);
$tw.hooks.invokeHook("th-page-refreshed");
$tw.hooks.invokeHook("th-page-refreshed");
})();
// Remove any splash screen elements
var removeList = document.querySelectorAll(".tc-remove-when-wiki-loaded");

View File

@@ -63,16 +63,24 @@ exports.startup = function() {
$tw.eventBus.emit("window:closed",{windowID});
},false);
// Set up the styles
var styleParser = $tw.wiki.parseTiddler("$:/core/ui/RootStylesheet",{parseAsInline: true}),
styleWidgetNode = $tw.wiki.makeWidget(styleParser,{document: srcDocument});
styleWidgetNode.render(srcDocument.head,null);
var styleWidgetNode = $tw.wiki.makeTranscludeWidget("$:/core/ui/PageStylesheet",{
document: $tw.fakeDocument,
variables: variables,
importPageMacros: true}),
styleContainer = $tw.fakeDocument.createElement("style");
styleWidgetNode.render(styleContainer,null);
var styleElement = srcDocument.createElement("style");
styleElement.innerHTML = styleContainer.textContent;
srcDocument.head.insertBefore(styleElement,srcDocument.head.firstChild);
// Render the text of the tiddler
var parser = $tw.wiki.parseTiddler(template),
widgetNode = $tw.wiki.makeWidget(parser,{document: srcDocument, parentWidget: $tw.rootWidget, variables: variables});
widgetNode.render(srcDocument.body,srcDocument.body.firstChild);
// Function to handle refreshes
refreshHandler = function(changes) {
styleWidgetNode.refresh(changes);
if(styleWidgetNode.refresh(changes,styleContainer,null)) {
styleElement.innerHTML = styleContainer.textContent;
}
widgetNode.refresh(changes);
};
$tw.wiki.addEventListener("change",refreshHandler);

View File

@@ -0,0 +1,31 @@
/*\
title: $:/core/modules/utils/base64.js
type: application/javascript
module-type: utils-browser
Base64 utility functions
\*/
"use strict";
/*
Base64 utility functions that work in either browser or Node.js
*/
exports.btoa = binstr => window.btoa(binstr);
exports.atob = b64 => window.atob(b64);
function base64ToBytes(base64) {
const binString = exports.atob(base64);
return Uint8Array.from(binString, m => m.codePointAt(0));
};
function bytesToBase64(bytes) {
const binString = Array.from(bytes, byte => String.fromCodePoint(byte)).join("");
return exports.btoa(binString);
};
exports.base64EncodeUtf8 = str => bytesToBase64(new TextEncoder().encode(str));
exports.base64DecodeUtf8 = str => new TextDecoder().decode(base64ToBytes(str));

View File

@@ -44,15 +44,15 @@ exports.domMatchesSelector = (node,selector) => node.matches(selector);
exports.hasClass = (el,className) => el.classList && el.classList.contains(className);
exports.addClass = function(el,className) {
el.classList && el.classList.add(className);
el.classList && className && el.classList.add(className);
};
exports.removeClass = function(el,className) {
el.classList && el.classList.remove(className);
el.classList && className && el.classList.remove(className);
};
exports.toggleClass = function(el,className,status) {
el.classList && el.classList.toggle(className, status);
el.classList && className && el.classList.toggle(className, status);
};
exports.getLocationPath = () => window.location.origin + window.location.pathname;

File diff suppressed because one or more lines are too long

View File

@@ -55,7 +55,7 @@ Return the dflt (default) parameter if str is not a base-10 number.
exports.getInt = function(str,deflt) {
var i = parseInt(str,10);
return isNaN(i) ? deflt : i;
}
};
/*
Repeatedly replaces a substring within a string. Like String.prototype.replace, but without any of the default special handling of $ sequences in the replace string
@@ -69,12 +69,12 @@ exports.replaceString = function(text,search,replace) {
exports.trimPrefix = function(str,unwanted) {
if(typeof str === "string" && typeof unwanted === "string") {
if(unwanted === "") {
return str.replace(/^\s\s*/, '');
return str.replace(/^\s\s*/, "");
} else {
// Safely regexp-escape the unwanted text
unwanted = unwanted.replace(/[\\^$*+?.()|[\]{}]/g, '\\$&');
var regex = new RegExp('^(' + unwanted + ')+');
return str.replace(regex, '');
unwanted = unwanted.replace(/[\\^$*+?.()|[\]{}]/g, "\\$&");
var regex = new RegExp("^(" + unwanted + ")+");
return str.replace(regex, "");
}
} else {
return str;
@@ -84,12 +84,12 @@ exports.trimPrefix = function(str,unwanted) {
exports.trimSuffix = function(str,unwanted) {
if(typeof str === "string" && typeof unwanted === "string") {
if(unwanted === "") {
return str.replace(/\s\s*$/, '');
return str.replace(/\s\s*$/, "");
} else {
// Safely regexp-escape the unwanted text
unwanted = unwanted.replace(/[\\^$*+?.()|[\]{}]/g, '\\$&');
var regex = new RegExp('(' + unwanted + ')+$');
return str.replace(regex, '');
unwanted = unwanted.replace(/[\\^$*+?.()|[\]{}]/g, "\\$&");
var regex = new RegExp("(" + unwanted + ")+$");
return str.replace(regex, "");
}
} else {
return str;
@@ -101,14 +101,14 @@ Convert a string to sentence case (ie capitalise first letter)
*/
exports.toSentenceCase = function(str) {
return (str || "").replace(/^\S/, function(c) {return c.toUpperCase();});
}
};
/*
Convert a string to title case (ie capitalise each initial letter)
*/
exports.toTitleCase = function(str) {
return (str || "").replace(/(^|\s)\S/g, function(c) {return c.toUpperCase();});
}
};
/*
Find the line break preceding a given position in a string
@@ -358,8 +358,8 @@ exports.formatDateString = function(date,template) {
}],
[/^TZD/, function() {
var tz = date.getTimezoneOffset(),
atz = Math.abs(tz);
return (tz < 0 ? '+' : '-') + $tw.utils.pad(Math.floor(atz / 60)) + ':' + $tw.utils.pad(atz % 60);
atz = Math.abs(tz);
return (tz < 0 ? "+" : "-") + $tw.utils.pad(Math.floor(atz / 60)) + ":" + $tw.utils.pad(atz % 60);
}],
[/^wYY/, function() {
return $tw.utils.pad($tw.utils.getYearForWeekNo(date) - 2000);
@@ -568,9 +568,9 @@ exports.unescapeLineBreaks = function(s) {
exports.escape = function(ch) {
var charCode = ch.charCodeAt(0);
if(charCode <= 0xFF) {
return '\\x' + $tw.utils.pad(charCode.toString(16).toUpperCase());
return "\\x" + $tw.utils.pad(charCode.toString(16).toUpperCase());
} else {
return '\\u' + $tw.utils.pad(charCode.toString(16).toUpperCase(),4);
return "\\u" + $tw.utils.pad(charCode.toString(16).toUpperCase(),4);
}
};
@@ -587,11 +587,11 @@ exports.stringify = function(s, rawUnicode) {
*/
var regex = rawUnicode ? /[\x00-\x1f]/g : /[\x00-\x1f\x80-\uFFFF]/g;
return (s || "")
.replace(/\\/g, '\\\\') // backslash
.replace(/\\/g, "\\\\") // backslash
.replace(/"/g, '\\"') // double quote character
.replace(/'/g, "\\'") // single quote character
.replace(/\r/g, '\\r') // carriage return
.replace(/\n/g, '\\n') // line feed
.replace(/\r/g, "\\r") // carriage return
.replace(/\n/g, "\\n") // line feed
.replace(regex, exports.escape); // non-ASCII characters
};
@@ -601,15 +601,15 @@ exports.jsonStringify = function(s, rawUnicode) {
// See http://www.json.org/
var regex = rawUnicode ? /[\x00-\x1f]/g : /[\x00-\x1f\x80-\uFFFF]/g;
return (s || "")
.replace(/\\/g, '\\\\') // backslash
.replace(/\\/g, "\\\\") // backslash
.replace(/"/g, '\\"') // double quote character
.replace(/\r/g, '\\r') // carriage return
.replace(/\n/g, '\\n') // line feed
.replace(/\x08/g, '\\b') // backspace
.replace(/\x0c/g, '\\f') // formfeed
.replace(/\t/g, '\\t') // tab
.replace(/\r/g, "\\r") // carriage return
.replace(/\n/g, "\\n") // line feed
.replace(/\x08/g, "\\b") // backspace
.replace(/\x0c/g, "\\f") // formfeed
.replace(/\t/g, "\\t") // tab
.replace(regex,function(s) {
return '\\u' + $tw.utils.pad(s.charCodeAt(0).toString(16).toUpperCase(),4);
return "\\u" + $tw.utils.pad(s.charCodeAt(0).toString(16).toUpperCase(),4);
}); // non-ASCII characters
};
@@ -617,7 +617,7 @@ exports.jsonStringify = function(s, rawUnicode) {
Escape the RegExp special characters with a preceding backslash
*/
exports.escapeRegExp = function(s) {
return s.replace(/[\-\/\\\^\$\*\+\?\.\(\)\|\[\]\{\}]/g, '\\$&');
return s.replace(/[\-\/\\\^\$\*\+\?\.\(\)\|\[\]\{\}]/g, "\\$&");
};
/*
@@ -700,7 +700,7 @@ exports.parseTextReference = function(textRef) {
}
} else {
// If we couldn't parse it
result.title = textRef
result.title = textRef;
}
return result;
};
@@ -759,60 +759,17 @@ Cryptographic hash function as used by sha256 filter operator
options.length .. number of characters returned defaults to 64
*/
exports.sha256 = function(str, options) {
options = options || {}
options = options || {};
return $tw.sjcl.codec.hex.fromBits($tw.sjcl.hash.sha256.hash(str)).substr(0,options.length || 64);
}
/*
Base64 utility functions that work in either browser or Node.js
*/
if(typeof window !== 'undefined') {
exports.btoa = function(binstr) { return window.btoa(binstr); }
exports.atob = function(b64) { return window.atob(b64); }
} else {
exports.btoa = function(binstr) {
return Buffer.from(binstr, 'binary').toString('base64');
}
exports.atob = function(b64) {
return Buffer.from(b64, 'base64').toString('binary');
}
}
exports.base64ToBytes = function(base64) {
const binString = exports.atob(base64);
return Uint8Array.from(binString, (m) => m.codePointAt(0));
};
exports.bytesToBase64 = function(bytes) {
const binString = Array.from(bytes, (byte) => String.fromCodePoint(byte)).join("");
return exports.btoa(binString);
};
exports.base64EncodeUtf8 = function(str) {
if ($tw.browser) {
return exports.bytesToBase64(new TextEncoder().encode(str));
} else {
const buff = Buffer.from(str, "utf-8");
return buff.toString("base64");
}
};
exports.base64DecodeUtf8 = function(str) {
if ($tw.browser) {
return new TextDecoder().decode(exports.base64ToBytes(str));
} else {
const buff = Buffer.from(str, "base64");
return buff.toString("utf-8");
}
};
/*
Decode a base64 string
*/
exports.base64Decode = function(string64,binary,urlsafe) {
const encoded = urlsafe ? string64.replace(/_/g,'/').replace(/-/g,'+') : string64;
if(binary) return exports.atob(encoded)
else return exports.base64DecodeUtf8(encoded);
const encoded = urlsafe ? string64.replace(/_/g,"/").replace(/-/g,"+") : string64;
if(binary) return $tw.utils.atob(encoded);
else return $tw.utils.base64DecodeUtf8(encoded);
};
/*
@@ -820,10 +777,10 @@ Encode a string to base64
*/
exports.base64Encode = function(string64,binary,urlsafe) {
let encoded;
if(binary) encoded = exports.btoa(string64);
else encoded = exports.base64EncodeUtf8(string64);
if(binary) encoded = $tw.utils.btoa(string64);
else encoded = $tw.utils.base64EncodeUtf8(string64);
if(urlsafe) {
encoded = encoded.replace(/\+/g,'-').replace(/\//g,'_');
encoded = encoded.replace(/\+/g,"-").replace(/\//g,"_");
}
return encoded;
};
@@ -957,3 +914,56 @@ exports.makeCompareFunction = function(type,options) {
};
return (types[type] || types[options.defaultType] || types.number);
};
/*
Split text into parts (lines or words) for diff operations
Adapted from https://github.com/google/diff-match-patch/wiki/Line-or-Word-Diffs
*/
exports.diffPartsToChars = function(text1,text2,mode) {
const lineArray = [""],
lineHash = Object.create(null);
function diff_linesToPartsMunge_(text,mode) {
let chars = "",
lineStart = 0,
lineEnd = -1,
lineArrayLength = lineArray.length,
regexpResult;
const searchRegexp = /\W+/g;
while(lineEnd < text.length - 1) {
if(mode === "words") {
regexpResult = searchRegexp.exec(text);
lineEnd = searchRegexp.lastIndex;
if(regexpResult === null) {
lineEnd = text.length;
}
lineEnd = --lineEnd;
} else {
lineEnd = text.indexOf("\n", lineStart);
if(lineEnd === -1) {
lineEnd = text.length - 1;
}
}
let line = text.substring(lineStart, lineEnd + 1);
if(line in lineHash) {
chars += String.fromCharCode(lineHash[line]);
} else {
if(lineArrayLength === maxLines) {
line = text.substring(lineStart);
lineEnd = text.length;
}
chars += String.fromCharCode(lineArrayLength);
lineHash[line] = lineArrayLength;
lineArray[lineArrayLength++] = line;
}
lineStart = lineEnd + 1;
}
return chars;
}
let maxLines = 40000;
const chars1 = diff_linesToPartsMunge_(text1,mode);
maxLines = 65535;
const chars2 = diff_linesToPartsMunge_(text2,mode);
return {chars1, chars2, lineArray};
};

View File

@@ -9,6 +9,8 @@ Button widget
"use strict";
const ALLOWED_SELECTED_ARIA_ATTR = ["aria-checked", "aria-selected", "aria-pressed"];
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var Popup = require("$:/core/modules/utils/dom/popup.js");
@@ -44,9 +46,14 @@ ButtonWidget.prototype.render = function(parent,nextSibling) {
var classes = this["class"].split(" ") || [],
isPoppedUp = (this.popup || this.popupTitle) && this.isPoppedUp();
if(this.selectedClass) {
if((this.set || this.setTitle) && this.setTo && this.isSelected()) {
$tw.utils.pushTop(classes, this.selectedClass.split(" "));
domNode.setAttribute("aria-checked", "true");
if((this.set || this.setTitle) && this.setTo) {
const selectedAria = ALLOWED_SELECTED_ARIA_ATTR.includes(this.selectedAria) ? this.selectedAria : "aria-checked";
if(this.isSelected()) {
$tw.utils.pushTop(classes, this.selectedClass.split(" "));
domNode.setAttribute(selectedAria, "true");
} else {
domNode.setAttribute(selectedAria, "false");
}
}
if(isPoppedUp) {
$tw.utils.pushTop(classes,this.selectedClass.split(" "));
@@ -221,6 +228,7 @@ ButtonWidget.prototype.execute = function() {
this.style = this.getAttribute("style");
this["class"] = this.getAttribute("class","");
this.selectedClass = this.getAttribute("selectedClass");
this.selectedAria = this.getAttribute("selectedAria");
this.defaultSetValue = this.getAttribute("default","");
this.buttonTag = this.getAttribute("tag");
this.dragTiddler = this.getAttribute("dragTiddler");

View File

@@ -9,8 +9,8 @@ Widget to display a diff between two texts
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget,
dmp = require("$:/core/modules/utils/diff-match-patch/diff_match_patch.js");
var Widget = require("$:/core/modules/widgets/widget.js").widget;
const dmp = require("$:/core/modules/utils/diff-match-patch/diff_match_patch.js");
var DiffTextWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
@@ -35,19 +35,24 @@ DiffTextWidget.prototype.render = function(parent,nextSibling) {
this.computeAttributes();
this.execute();
// Create the diff object
var dmpObject = new dmp.diff_match_patch();
dmpObject.Diff_EditCost = $tw.utils.parseNumber(this.getAttribute("editcost","4"));
var diffs = dmpObject.diff_main(this.getAttribute("source",""),this.getAttribute("dest",""));
const editCost = $tw.utils.parseNumber(this.getAttribute("editcost","4"));
const mode = this.getAttribute("mode") || "chars";
let diffs;
if(mode === "lines" || mode === "words") {
diffs = diffLineWordMode(this.getAttribute("source",""),this.getAttribute("dest",""),mode,editCost);
} else {
diffs = dmp.diffMain(this.getAttribute("source",""),this.getAttribute("dest",""),{diffEditCost: editCost});
}
// Apply required cleanup
switch(this.getAttribute("cleanup","semantic")) {
case "none":
// No cleanup
break;
case "efficiency":
dmpObject.diff_cleanupEfficiency(diffs);
dmp.diffCleanupEfficiency(diffs, {diffEditCost: editCost});
break;
default: // case "semantic"
dmpObject.diff_cleanupSemantic(diffs);
dmp.diffCleanupSemantic(diffs);
break;
}
// Create the elements
@@ -133,7 +138,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
*/
DiffTextWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes.source || changedAttributes.dest || changedAttributes.cleanup || changedAttributes.editcost) {
if(changedAttributes.source || changedAttributes.dest || changedAttributes.cleanup || changedAttributes.mode || changedAttributes.editcost) {
this.refreshSelf();
return true;
} else {
@@ -141,4 +146,15 @@ DiffTextWidget.prototype.refresh = function(changedTiddlers) {
}
};
// This function is adapted from https://github.com/google/diff-match-patch/wiki/Line-or-Word-Diffs
function diffLineWordMode(text1,text2,mode,editCost) {
var a = $tw.utils.diffPartsToChars(text1,text2,mode);
var lineText1 = a.chars1;
var lineText2 = a.chars2;
var lineArray = a.lineArray;
var diffs = dmp.diffMain(lineText1,lineText2,{diffEditCost: editCost});
dmp.diffCharsToLines(diffs,lineArray);
return diffs;
}
exports["diff-text"] = DiffTextWidget;

View File

@@ -9,376 +9,215 @@ View widget
"use strict";
const Widget = require("$:/core/modules/widgets/widget.js").widget;
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var ViewWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
};
/*
==========================================
ViewHandler Base Class
==========================================
Base class for all view format handlers.
Provides common functionality and defines the interface for subclasses.
Inherit from the base widget class
*/
class ViewHandler {
constructor(widget) {
this.widget = widget;
this.wiki = widget.wiki;
this.document = widget.document;
this.viewTitle = widget.viewTitle;
this.viewField = widget.viewField;
this.viewIndex = widget.viewIndex;
this.viewSubtiddler = widget.viewSubtiddler;
this.viewTemplate = widget.viewTemplate;
this.viewMode = widget.viewMode;
}
render(parent, nextSibling) {
this.text = this.getValue();
this.createTextNode(parent, nextSibling);
}
getValue() {
return this.widget.getValueAsText();
}
createTextNode(parent, nextSibling) {
if(this.text) {
const textNode = this.document.createTextNode(this.text);
parent.insertBefore(textNode, nextSibling);
this.widget.domNodes.push(textNode);
} else {
this.widget.makeChildWidgets();
this.widget.renderChildren(parent, nextSibling);
}
}
refresh() {
var self = this;
return false;
}
}
ViewWidget.prototype = new Widget();
/*
==========================================
Wikified View Handler Base
==========================================
Base class for wikified view handlers
Render this widget into the DOM
*/
class WikifiedViewHandler extends ViewHandler {
constructor(widget) {
super(widget);
this.fakeWidget = null;
this.fakeNode = null;
}
render(parent, nextSibling) {
this.createFakeWidget();
this.text = this.getValue();
this.createWikifiedTextNode(parent, nextSibling);
}
createFakeWidget() {
this.fakeWidget = this.wiki.makeTranscludeWidget(this.viewTitle, {
document: $tw.fakeDocument,
field: this.viewField,
index: this.viewIndex,
parseAsInline: this.viewMode !== "block",
mode: this.viewMode === "block" ? "block" : "inline",
parentWidget: this.widget,
subTiddler: this.viewSubtiddler
});
this.fakeNode = $tw.fakeDocument.createElement("div");
this.fakeWidget.makeChildWidgets();
this.fakeWidget.render(this.fakeNode, null);
}
createWikifiedTextNode(parent, nextSibling) {
const textNode = this.document.createTextNode(this.text || "");
parent.insertBefore(textNode, nextSibling);
this.widget.domNodes.push(textNode);
}
refresh(changedTiddlers) {
const refreshed = this.fakeWidget.refresh(changedTiddlers);
if(refreshed) {
const newText = this.getValue();
if(newText !== this.text) {
this.widget.domNodes[0].textContent = newText;
this.text = newText;
}
}
return refreshed;
}
}
/*
==========================================
Text View Handler
==========================================
Default handler for plain text display
*/
class TextViewHandler extends ViewHandler {}
/*
==========================================
HTML Wikified View Handler
==========================================
Handler for wikified HTML content
*/
class HTMLWikifiedViewHandler extends WikifiedViewHandler {
getValue() {
return this.fakeNode.innerHTML;
}
}
/*
==========================================
Plain Wikified View Handler
==========================================
Handler for wikified plain text content
*/
class PlainWikifiedViewHandler extends WikifiedViewHandler {
getValue() {
return this.fakeNode.textContent;
}
}
/*
==========================================
HTML Encoded Plain Wikified View Handler
==========================================
Handler for HTML-encoded wikified plain text
*/
class HTMLEncodedPlainWikifiedViewHandler extends WikifiedViewHandler {
getValue() {
return $tw.utils.htmlEncode(this.fakeNode.textContent);
}
}
/*
==========================================
HTML Encoded View Handler
==========================================
Handler for HTML-encoded text
*/
class HTMLEncodedViewHandler extends ViewHandler {
getValue() {
return $tw.utils.htmlEncode(this.widget.getValueAsText());
}
}
/*
==========================================
HTML Text Encoded View Handler
==========================================
Handler for HTML text-encoded content
*/
class HTMLTextEncodedViewHandler extends ViewHandler {
getValue() {
return $tw.utils.htmlTextEncode(this.widget.getValueAsText());
}
}
/*
==========================================
URL Encoded View Handler
==========================================
Handler for URL-encoded text
*/
class URLEncodedViewHandler extends ViewHandler {
getValue() {
return $tw.utils.encodeURIComponentExtended(this.widget.getValueAsText());
}
}
/*
==========================================
Double URL Encoded View Handler
==========================================
Handler for double URL-encoded text
*/
class DoubleURLEncodedViewHandler extends ViewHandler {
getValue() {
const text = this.widget.getValueAsText();
return $tw.utils.encodeURIComponentExtended($tw.utils.encodeURIComponentExtended(text));
}
}
/*
==========================================
Date View Handler
==========================================
Handler for date formatting
*/
class DateViewHandler extends ViewHandler {
getValue() {
const format = this.viewTemplate || "YYYY MM DD 0hh:0mm";
const rawValue = this.widget.getValueAsText();
const value = $tw.utils.parseDate(rawValue);
if(value && $tw.utils.isDate(value) && value.toString() !== "Invalid Date") {
return $tw.utils.formatDateString(value, format);
} else {
return "";
}
}
}
/*
==========================================
Relative Date View Handler
==========================================
Handler for relative date display
*/
class RelativeDateViewHandler extends ViewHandler {
getValue() {
const rawValue = this.widget.getValueAsText();
const value = $tw.utils.parseDate(rawValue);
if(value && $tw.utils.isDate(value) && value.toString() !== "Invalid Date") {
return $tw.utils.getRelativeDate((new Date()) - (new Date(value))).description;
} else {
return "";
}
}
}
/*
==========================================
Strip Comments View Handler
==========================================
Handler for stripping comments from text
*/
class StripCommentsViewHandler extends ViewHandler {
getValue() {
const lines = this.widget.getValueAsText().split("\n");
const out = [];
for(const text of lines) {
if(!/^\s*\/\/#/.test(text)) {
out.push(text);
}
}
return out.join("\n");
}
}
/*
==========================================
JS Encoded View Handler
==========================================
Handler for JavaScript string encoding
*/
class JSEncodedViewHandler extends ViewHandler {
getValue() {
return $tw.utils.stringify(this.widget.getValueAsText());
}
}
/*
==========================================
ViewHandlerFactory
==========================================
Factory for creating appropriate view handlers based on format
*/
const ViewHandlerFactory = {
handlers: {
"text": TextViewHandler,
"htmlwikified": HTMLWikifiedViewHandler,
"plainwikified": PlainWikifiedViewHandler,
"htmlencodedplainwikified": HTMLEncodedPlainWikifiedViewHandler,
"htmlencoded": HTMLEncodedViewHandler,
"htmltextencoded": HTMLTextEncodedViewHandler,
"urlencoded": URLEncodedViewHandler,
"doubleurlencoded": DoubleURLEncodedViewHandler,
"date": DateViewHandler,
"relativedate": RelativeDateViewHandler,
"stripcomments": StripCommentsViewHandler,
"jsencoded": JSEncodedViewHandler
},
createHandler(format, widget) {
const HandlerClass = this.handlers[format] || this.handlers["text"];
return new HandlerClass(widget);
},
registerHandler(format, handlerClass) {
this.handlers[format] = handlerClass;
ViewWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
this.computeAttributes();
this.execute();
if(this.text) {
var textNode = this.document.createTextNode(this.text);
parent.insertBefore(textNode,nextSibling);
this.domNodes.push(textNode);
} else {
this.makeChildWidgets();
this.renderChildren(parent,nextSibling);
}
};
/*
==========================================
ViewWidget
==========================================
Main widget class that orchestrates view handlers
Compute the internal state of the widget
*/
class ViewWidget extends Widget {
constructor(parseTreeNode, options) {
super();
this.initialise(parseTreeNode, options);
ViewWidget.prototype.execute = function() {
// Get parameters from our attributes
this.viewTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler"));
this.viewSubtiddler = this.getAttribute("subtiddler");
this.viewField = this.getAttribute("field","text");
this.viewIndex = this.getAttribute("index");
this.viewFormat = this.getAttribute("format","text");
this.viewTemplate = this.getAttribute("template","");
this.viewMode = this.getAttribute("mode","block");
switch(this.viewFormat) {
case "htmlwikified":
this.text = this.getValueAsHtmlWikified(this.viewMode);
break;
case "plainwikified":
this.text = this.getValueAsPlainWikified(this.viewMode);
break;
case "htmlencodedplainwikified":
this.text = this.getValueAsHtmlEncodedPlainWikified(this.viewMode);
break;
case "htmlencoded":
this.text = this.getValueAsHtmlEncoded();
break;
case "htmltextencoded":
this.text = this.getValueAsHtmlTextEncoded();
break;
case "urlencoded":
this.text = this.getValueAsUrlEncoded();
break;
case "doubleurlencoded":
this.text = this.getValueAsDoubleUrlEncoded();
break;
case "date":
this.text = this.getValueAsDate(this.viewTemplate);
break;
case "relativedate":
this.text = this.getValueAsRelativeDate();
break;
case "stripcomments":
this.text = this.getValueAsStrippedComments();
break;
case "jsencoded":
this.text = this.getValueAsJsEncoded();
break;
default: // "text"
this.text = this.getValueAsText();
break;
}
};
render(parent, nextSibling) {
this.parentDomNode = parent;
this.computeAttributes();
this.execute();
this.viewHandler = ViewHandlerFactory.createHandler(this.viewFormat, this);
this.viewHandler.render(parent, nextSibling);
}
/*
The various formatter functions are baked into this widget for the moment. Eventually they will be replaced by macro functions
*/
execute() {
this.viewTitle = this.getAttribute("tiddler", this.getVariable("currentTiddler"));
this.viewSubtiddler = this.getAttribute("subtiddler");
this.viewField = this.getAttribute("field", "text");
this.viewIndex = this.getAttribute("index");
this.viewFormat = this.getAttribute("format", "text");
this.viewTemplate = this.getAttribute("template", "");
this.viewMode = this.getAttribute("mode", "block");
}
getValue(options = {}) {
let value = options.asString ? "" : undefined;
if(this.viewIndex) {
value = this.wiki.extractTiddlerDataItem(this.viewTitle, this.viewIndex);
/*
Retrieve the value of the widget. Options are:
asString: Optionally return the value as a string
*/
ViewWidget.prototype.getValue = function(options) {
options = options || {};
var value = options.asString ? "" : undefined;
if(this.viewIndex) {
value = this.wiki.extractTiddlerDataItem(this.viewTitle,this.viewIndex);
} else {
var tiddler;
if(this.viewSubtiddler) {
tiddler = this.wiki.getSubTiddler(this.viewTitle,this.viewSubtiddler);
} else {
let tiddler;
if(this.viewSubtiddler) {
tiddler = this.wiki.getSubTiddler(this.viewTitle, this.viewSubtiddler);
tiddler = this.wiki.getTiddler(this.viewTitle);
}
if(tiddler) {
if(this.viewField === "text" && !this.viewSubtiddler) {
// Calling getTiddlerText() triggers lazy loading of skinny tiddlers
value = this.wiki.getTiddlerText(this.viewTitle);
} else {
tiddler = this.wiki.getTiddler(this.viewTitle);
}
if(tiddler) {
if(this.viewField === "text" && !this.viewSubtiddler) {
value = this.wiki.getTiddlerText(this.viewTitle);
} else {
if($tw.utils.hop(tiddler.fields, this.viewField)) {
if(options.asString) {
value = tiddler.getFieldString(this.viewField);
} else {
value = tiddler.fields[this.viewField];
}
if($tw.utils.hop(tiddler.fields,this.viewField)) {
if(options.asString) {
value = tiddler.getFieldString(this.viewField);
} else {
value = tiddler.fields[this.viewField];
}
}
} else {
if(this.viewField === "title") {
value = this.viewTitle;
}
}
} else {
if(this.viewField === "title") {
value = this.viewTitle;
}
}
return value;
}
return value;
};
getValueAsText() {
return this.getValue({asString: true});
ViewWidget.prototype.getValueAsText = function() {
return this.getValue({asString: true});
};
ViewWidget.prototype.getValueAsHtmlWikified = function(mode) {
return this.wiki.renderText("text/html","text/vnd.tiddlywiki",this.getValueAsText(),{
parseAsInline: mode !== "block",
parentWidget: this
});
};
ViewWidget.prototype.getValueAsPlainWikified = function(mode) {
return this.wiki.renderText("text/plain","text/vnd.tiddlywiki",this.getValueAsText(),{
parseAsInline: mode !== "block",
parentWidget: this
});
};
ViewWidget.prototype.getValueAsHtmlEncodedPlainWikified = function(mode) {
return $tw.utils.htmlEncode(this.wiki.renderText("text/plain","text/vnd.tiddlywiki",this.getValueAsText(),{
parseAsInline: mode !== "block",
parentWidget: this
}));
};
ViewWidget.prototype.getValueAsHtmlEncoded = function() {
return $tw.utils.htmlEncode(this.getValueAsText());
};
ViewWidget.prototype.getValueAsHtmlTextEncoded = function() {
return $tw.utils.htmlTextEncode(this.getValueAsText());
};
ViewWidget.prototype.getValueAsUrlEncoded = function() {
return $tw.utils.encodeURIComponentExtended(this.getValueAsText());
};
ViewWidget.prototype.getValueAsDoubleUrlEncoded = function() {
return $tw.utils.encodeURIComponentExtended($tw.utils.encodeURIComponentExtended(this.getValueAsText()));
};
ViewWidget.prototype.getValueAsDate = function(format) {
format = format || "YYYY MM DD 0hh:0mm";
var value = $tw.utils.parseDate(this.getValue());
if(value && $tw.utils.isDate(value) && value.toString() !== "Invalid Date") {
return $tw.utils.formatDateString(value,format);
} else {
return "";
}
};
refresh(changedTiddlers) {
const changedAttributes = this.computeAttributes();
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index ||
changedAttributes.template || changedAttributes.format || changedTiddlers[this.viewTitle]) {
this.refreshSelf();
return true;
} else {
return this.viewHandler.refresh(changedTiddlers);
ViewWidget.prototype.getValueAsRelativeDate = function(format) {
var value = $tw.utils.parseDate(this.getValue());
if(value && $tw.utils.isDate(value) && value.toString() !== "Invalid Date") {
return $tw.utils.getRelativeDate((new Date()) - (new Date(value))).description;
} else {
return "";
}
};
ViewWidget.prototype.getValueAsStrippedComments = function() {
var lines = this.getValueAsText().split("\n"),
out = [];
for(var line=0; line<lines.length; line++) {
var text = lines[line];
if(!/^\s*\/\/#/.test(text)) {
out.push(text);
}
}
}
return out.join("\n");
};
exports.view = ViewWidget;
ViewWidget.prototype.getValueAsJsEncoded = function() {
return $tw.utils.stringify(this.getValueAsText());
};
/*
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
ViewWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.template || changedAttributes.format || changedTiddlers[this.viewTitle]) {
this.refreshSelf();
return true;
} else {
return false;
}
};
exports.view = ViewWidget;

View File

@@ -369,31 +369,16 @@ Sort an array of tiddler titles by a specified field
isDescending: true if the sort should be descending
isCaseSensitive: true if the sort should consider upper and lower case letters to be different
*/
exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive,isNumeric,isAlphaNumeric) {
exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive,isNumeric,isAlphaNumeric,locale) {
var self = this;
if(sortField === "title") {
if(!isNumeric && !isAlphaNumeric) {
if(isCaseSensitive) {
if(isDescending) {
titles.sort(function(a,b) {
return b.localeCompare(a);
});
} else {
titles.sort(function(a,b) {
return a.localeCompare(b);
});
}
const sorter = new Intl.Collator(locale, { sensitivity: isCaseSensitive ? "variant" : "accent" });
if(isDescending) {
titles.sort((a,b) => sorter.compare(b, a));
} else {
if(isDescending) {
titles.sort(function(a,b) {
return b.toLowerCase().localeCompare(a.toLowerCase());
});
} else {
titles.sort(function(a,b) {
return a.toLowerCase().localeCompare(b.toLowerCase());
});
}
}
titles.sort((a,b) => sorter.compare(a, b));
}
} else {
titles.sort(function(a,b) {
var x,y;
@@ -414,14 +399,8 @@ exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive,is
}
}
}
if(isAlphaNumeric) {
return isDescending ? b.localeCompare(a,undefined,{numeric: true,sensitivity: "base"}) : a.localeCompare(b,undefined,{numeric: true,sensitivity: "base"});
}
if(!isCaseSensitive) {
a = a.toLowerCase();
b = b.toLowerCase();
}
return isDescending ? b.localeCompare(a) : a.localeCompare(b);
const sorter = new Intl.Collator(locale, { numeric: isAlphaNumeric, sensitivity: isAlphaNumeric ? "base" : isCaseSensitive ? "variant" : "accent" });
return isDescending ? sorter.compare(b, a) : sorter.compare(a, b);
});
}
} else {
@@ -463,14 +442,8 @@ exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive,is
}
a = String(a);
b = String(b);
if(isAlphaNumeric) {
return isDescending ? b.localeCompare(a,undefined,{numeric: true,sensitivity: "base"}) : a.localeCompare(b,undefined,{numeric: true,sensitivity: "base"});
}
if(!isCaseSensitive) {
a = a.toLowerCase();
b = b.toLowerCase();
}
return isDescending ? b.localeCompare(a) : a.localeCompare(b);
const sorter = new Intl.Collator(locale, { numeric: isAlphaNumeric, sensitivity: isAlphaNumeric ? "base" : isCaseSensitive ? "variant" : "accent" });
return isDescending ? sorter.compare(b, a) : sorter.compare(a, b);
});
}
};

View File

@@ -25,7 +25,6 @@ title: $:/core/templates/tiddlywiki5.html
`{{{ [enlist<saveTiddlerAndShadowsFilter>tag[$:/core/wiki/rawmarkup]] ||$:/core/templates/plain-text-tiddler}}}
{{{ [enlist<saveTiddlerAndShadowsFilter>tag[$:/tags/RawMarkup]] ||$:/core/templates/plain-text-tiddler}}}
{{{ [enlist<saveTiddlerAndShadowsFilter>tag[$:/tags/RawMarkupWikified]] ||$:/core/templates/raw-static-tiddler}}}`
<!--~~ Style section start ~~-->
</head>
<body class="tc-body">
<!--~~ Raw markup for the top of the body section ~~-->

View File

@@ -1,7 +1,7 @@
title: $:/core/ui/PageTemplate/alerts
tags: $:/tags/PageTemplate
<div class="tc-alerts" role="region" aria-label="Alerts">
<div class="tc-alerts" role="region" aria-label={{$:/language/Alerts}}>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Alert]!is[draft]]" template="$:/core/ui/AlertTemplate" storyview="pop"/>

View File

@@ -1,15 +0,0 @@
title: $:/core/ui/RootStylesheet
code-body: yes
\import [subfilter{$:/core/config/GlobalImportFilter}]
\whitespace trim
<$let currentTiddler={{$:/language}} languageTitle={{!!name}}>
<style type="text/css">
<$view tiddler="$:/themes/tiddlywiki/vanilla/reset" format="text" mode="block"/>
</style>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Stylesheet]!is[draft]] -[[$:/themes/tiddlywiki/vanilla/reset]]">
<style type="text/css">
<$view format={{{ [<currentTiddler>tag[$:/tags/Stylesheet/Static]then[text]else[plainwikified]] }}} mode="block"/>
</style>
</$list>
</$let>

View File

@@ -15,7 +15,7 @@ caption: {{$:/language/SideBar/Open/Caption}}
\define droppable-item(button)
\whitespace trim
<$droppable actions=<<drop-actions>> enable=<<tv-allow-drag-and-drop>> tag="div">
<$droppable actions=<<drop-actions>> enable=<<tv-enable-drag-and-drop>> tag="div">
<<placeholder>>
<div>
$button$

View File

@@ -2,7 +2,7 @@ title: $:/core/ui/TiddlerInfo
\whitespace trim
<div style="position:relative;">
<div class="tc-tiddler-controls" style="position:absolute;right:0;">
<div class="tc-tiddler-controls tc-tiddler-info-controls">
<$reveal state="$:/config/TiddlerInfo/Mode" type="match" text="sticky">
<$button set=<<tiddlerInfoState>> setTo="" tooltip={{$:/language/Buttons/Info/Hint}} aria-label={{$:/language/Buttons/Info/Caption}} class="tc-btn-invisible">
{{$:/core/images/close-button}}

View File

@@ -11,9 +11,13 @@ tags: $:/tags/ViewTemplate
storyview="pop"
variable="listItem"
>
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">
<$transclude tiddler=<<listItem>>/>
</$set>
<$let condition={{{ [<listItem>get[condition]] }}}>
<%if [<condition>!is[blank]] :and[<currentTiddler>subfilter<condition>limit[1]] :else[<condition>is[blank]then[true]] %>
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">
<$transclude tiddler=<<listItem>>/>
</$set>
<%endif%>
</$let>
</$list>
</span>
<$set name="tv-wikilinks" value={{$:/config/Tiddlers/TitleLinks}}>

View File

@@ -41,6 +41,8 @@ Drag this link to copy this tool to another wiki
</$wikify>
\end capture-item-wikified
\function get.shadow.source() [shadowsource[]]
\procedure capture-wiki-info(tempWikiInfo)
<$transclude $variable="capture-item-wikified" label="TiddlyWiki Version" value="<<version>>"/>
<$transclude $variable="capture-item" label="Current palette" value={{$:/palette}}/>
@@ -64,6 +66,7 @@ Drag this link to copy this tool to another wiki
<$transclude $variable="capture-item" label="Keyboard shortcuts that have been customised" value={{{ [all[tiddlers]prefix[$:/config/shortcuts]] +[join[,]] }}}/>
<$transclude $variable="capture-item" label="Disabled plugins" value={{{ [all[tiddlers]prefix[$:/config/Plugins/Disabled/]] :filter[{!!text}match[yes]] :map[<currentTiddler>removeprefix[$:/config/Plugins/Disabled/]] +[join[,]] }}}/>
<$transclude $variable="capture-item" label="Plugins" value={{{ [has[plugin-type]sort[]] :filter[<currentTiddler>addprefix[$:/config/Plugins/Disabled/]get[text]else[no]!match[yes]] :map[{!!version}addprefix[ - ]addprefix<currentTiddler>] +[addprefix[ ]addprefix<crlf>join[]] }}}/>
<$transclude $variable="capture-item" label="Stylesheets" value={{{ [all[shadows+tiddlers]tag[$:/tags/Stylesheet]!is[draft]] :map[is[shadow]addsuffix[ ∈ ]addsuffix<get.shadow.source>else<currentTiddler>] +[addprefix[ ]addprefix<crlf>join[]] }}}/>
\end capture-wiki-info
\procedure template-header()

View File

@@ -0,0 +1,39 @@
title: $:/core/macros/CSS/property
<!-- CSS property macros -->
<!-- TODO: Deprecate the following CSS macros once 2020 baseline is supported -->
\procedure margin-start(size)
-webkit-margin-start: <<size>>;
margin-inline-start: <<size>>;
\end
\procedure margin-end(size)
-webkit-margin-end: <<size>>;
margin-inline-end: <<size>>;
\end
\procedure padding-start(size)
-webkit-padding-start: <<size>>;
padding-inline-start: <<size>>;
\end
\procedure padding-end(size)
-webkit-padding-end: <<size>>;
padding-inline-end: <<size>>;
\end
\procedure margin-inline(start,end)
-webkit-margin-start: <<start>>;
margin-inline-start: <<start>>;
-webkit-margin-end: <<end>>;
margin-inline-end: <<end>>;
\end
\procedure padding-inline(start,end)
-webkit-padding-start: <<start>>;
padding-inline-start: <<start>>;
-webkit-padding-end: <<end>>;
padding-inline-end: <<end>>;
\end

View File

@@ -22,7 +22,7 @@ tags: $:/tags/Macro
<$action-listops $tiddler=<<targetTiddler>> $field=<<targetField>> $subfilter="+[insertbefore<actionTiddler>,<currentTiddler>]"/>
\end
\define list-links-draggable(tiddler,field:"list",emptyMessage,type:"ul",subtype:"li",class:"",itemTemplate)
\define list-links-draggable(tiddler,field:"list",emptyMessage,type:"ul",subtype:"li",class:"",itemTemplate, displayField:"caption")
\whitespace trim
<$set name="_tiddler" value="""$tiddler$""" emptyValue=<<currentTiddler>> >
<$let field-reference={{{ [<_tiddler>] "!!" [[$field$]] +[join[]] }}}
@@ -42,7 +42,7 @@ tags: $:/tags/Macro
<$transclude tiddler="""$itemTemplate$""">
<$link to={{!!title}}>
<$let tv-wikilinks="no">
<$transclude field="caption">
<$transclude field=<<__displayField__>>>
<$view field="title"/>
</$transclude>
</$let>
@@ -92,7 +92,7 @@ tags: $:/tags/Macro
</$set>
\end
\define list-tagged-draggable(tag,subFilter,emptyMessage,itemTemplate,elementTag:"div",storyview:"")
\define list-tagged-draggable(tag,subFilter,emptyMessage,itemTemplate,elementTag:"div",storyview:"",displayField:"title")
\whitespace trim
<span class="tc-tagged-draggable-list">
<$set name="tag" value=<<__tag__>>>
@@ -110,7 +110,11 @@ tags: $:/tags/Macro
<$genesis $type=<<__elementTag__>>>
<$transclude tiddler="""$itemTemplate$""">
<$link to={{!!title}}>
<$view field="title"/>
<$let tv-wikilinks="no">
<$transclude field=<<__displayField__>>>
<$view field="title"/>
</$transclude>
</$let>
</$link>
</$transclude>
</$genesis>

View File

@@ -9,8 +9,9 @@ code-body: yes
setTo=<<currentTab>>
default=<<__default__>>
selectedClass="tc-tab-selected"
selectedAria="aria-selected"
tooltip={{!!tooltip}}
role="switch"
role="tab"
data-tab-title=<<currentTab>>
>
<$tiddler tiddler=<<save-currentTiddler>>>
@@ -57,12 +58,12 @@ code-body: yes
\whitespace trim
<$qualify title=<<__state__>> name="qualifiedState">
<$let tabsState={{{ [<__explicitState__>minlength[1]] ~[<qualifiedState>] }}}>
<div class={{{ [[tc-tab-set]addsuffix[ ]addsuffix<__class__>] }}}>
<div class={{{ [[tc-tab-set]addsuffix[ ]addsuffix<__class__>] }}} role="tablist">
<div class={{{ [[tc-tab-buttons]addsuffix[ ]addsuffix<__class__>] }}}>
<<tabs-tab-list>>
</div>
<div class={{{ [[tc-tab-divider]addsuffix[ ]addsuffix<__class__>] }}}/>
<div class={{{ [[tc-tab-content]addsuffix[ ]addsuffix<__class__>] }}}>
<div class={{{ [[tc-tab-content]addsuffix[ ]addsuffix<__class__>] }}} role="tabpanel">
<<tabs-tab-body>>
</div>
</div>

View File

@@ -1,17 +0,0 @@
caption: savetiddlers
color: #4DB6AC
community-author: Buggyj
created: 20171109171935039
delivery: Browser Extension
description: Extension pour les navigateurs Chrome et Firefox
fr-title:
method: save
modified: 20220402105820520
tags: Chrome Firefox Saving [[Other Resources]] plugins
title: "savetiddlers" Extension for Chrome and Firefox by buggyj
type: text/vnd.tiddlywiki
url: https://github.com/buggyj/savetiddlers
Une extension pour Google Chrome et Mozilla Firefox qui fluidifie l'utilisation de [[l'enregistreur HTML5 par défaut|Saving with the HTML5 fallback saver]] de <<tw>>, et le rend presque aussi convivial que ~TiddlyFox une fois configurée.
https://github.com/buggyj/savetiddlers

View File

@@ -0,0 +1,17 @@
caption: savetiddlers
color: #4DB6AC
community-author: buggyj
created: 20171109171935039
delivery: Browser Extension
description: Extension pour les navigateur Firefox
fr-title:
method: save
modified: 20250809092435788
tags: Firefox Saving [[Other Resources]] plugins
title: savetiddlers: Extension for Firefox by buggyj
type: text/vnd.tiddlywiki
url: https://github.com/buggyj/savetiddlers
Une extension Mozilla Firefox qui fluidifie l'utilisation de [[l'enregistreur HTML5 par défaut|Saving with the HTML5 fallback saver]] de <<tw>>, et le rend presque aussi convivial que [[TiddlyFox]] une fois configurée.
{{!!url}}

View File

@@ -1,18 +0,0 @@
caption: savetiddlers
color: #4DB6AC
community-author: Buggyj
created: 20171109171935039
delivery: Browser Extension
description: ChromeとFirefoxのブラウザ拡張機能
method: save
modified: 20241014110546647
original-modified: 20210106151027189
tags: Chrome Firefox Saving [[Other Resources]] plugins
title: "savetiddlers" Extension for Chrome and Firefox by buggyj
ja-title: buggyjによるChromeとFirefoxの"savetiddlers"拡張機能
type: text/vnd.tiddlywiki
url: https://github.com/buggyj/savetiddlers
Google ChromeとMozilla Firefoxの拡張機能で、TiddlyWikiの組み込み[[HTML5セーバー|Saving with the HTML5 saver]]による使いにくさの一部を解消し、正しく設定すればTiddlyFoxとほぼ同じくらい簡単に使用できるようになります。
https://github.com/buggyj/savetiddlers

View File

@@ -0,0 +1,18 @@
caption: savetiddlers
color: #4DB6AC
community-author: buggyj
created: 20171109171935039
delivery: Browser Extension
description: Firefoxのブラウザ拡張機能
method: save
modified: 20250809092435788
original-modified: 20250809092435788
tags: Firefox Saving [[Other Resources]] plugins
title: savetiddlers: Extension for Firefox by buggyj
ja-title: buggyjによるFirefoxの"savetiddlers"拡張機能
type: text/vnd.tiddlywiki
url: https://github.com/buggyj/savetiddlers
Mozilla Firefoxの拡張機能で、TiddlyWikiの組み込み[[HTML5セーバー|Saving with the HTML5 saver]]による使いにくさの一部を解消し、正しく設定すれば[[TiddlyFox]]とほぼ同じくらい簡単に使用できるようになります。
{{!!url}}

View File

@@ -2,4 +2,4 @@ title: expected-test-tabs-horizontal-a
type: text/html
description: Horizontal tabs test - This is the expected HTML output from a test in test-wikitext-tabs-macro.js
<p><div class="tc-tab-set "><div class="tc-tab-buttons "><button class="" data-tab-title="TabOne" role="switch">t 1</button><button aria-checked="true" class=" tc-tab-selected" data-tab-title="TabTwo" role="switch">t 2</button><button class="" data-tab-title="TabThree" role="switch">t 3</button><button class="" data-tab-title="TabFour" role="switch">TabFour</button></div><div class="tc-tab-divider "></div><div class="tc-tab-content "><div class="tc-reveal" hidden="true"></div><div class="tc-reveal"><p>Text tab 2</p></div><div class="tc-reveal" hidden="true"></div><div class="tc-reveal" hidden="true"></div></div></div></p>
<p><div class="tc-tab-set " role="tablist"><div class="tc-tab-buttons "><button aria-selected="false" class="" data-tab-title="TabOne" role="tab">t 1</button><button aria-selected="true" class=" tc-tab-selected" data-tab-title="TabTwo" role="tab">t 2</button><button aria-selected="false" class="" data-tab-title="TabThree" role="tab">t 3</button><button aria-selected="false" class="" data-tab-title="TabFour" role="tab">TabFour</button></div><div class="tc-tab-divider "></div><div class="tc-tab-content " role="tabpanel"><div class="tc-reveal" hidden="true"></div><div class="tc-reveal"><p>Text tab 2</p></div><div class="tc-reveal" hidden="true"></div><div class="tc-reveal" hidden="true"></div></div></div></p>

View File

@@ -2,4 +2,4 @@ title: expected-test-tabs-horizontal-all
type: text/html
description: Horizontal tabs with all parameters active. This is the expected HTML output from a test in test-wikitext-tabs-macro.js
<p><div class="tc-tab-set "><div class="tc-tab-buttons "><button class="" data-tab-title="TabOne" role="switch">t 1</button><button aria-checked="true" class=" tc-tab-selected" data-tab-title="TabTwo" role="switch">t 2</button><button class="" data-tab-title="TabThree" role="switch">desc</button><button class="" data-tab-title="TabFour" role="switch">TabFour</button></div><div class="tc-tab-divider "></div><div class="tc-tab-content "><div class="tc-reveal" hidden="true"></div><div class="tc-reveal"><h2 class="">TabTwo</h2><p><p>Text tab 2</p></p></div><div class="tc-reveal" hidden="true"></div><div class="tc-reveal" hidden="true"></div></div></div></p>
<p><div class="tc-tab-set " role="tablist"><div class="tc-tab-buttons "><button aria-selected="false" class="" data-tab-title="TabOne" role="tab">t 1</button><button aria-selected="true" class=" tc-tab-selected" data-tab-title="TabTwo" role="tab">t 2</button><button aria-selected="false" class="" data-tab-title="TabThree" role="tab">desc</button><button aria-selected="false" class="" data-tab-title="TabFour" role="tab">TabFour</button></div><div class="tc-tab-divider "></div><div class="tc-tab-content " role="tabpanel"><div class="tc-reveal" hidden="true"></div><div class="tc-reveal"><h2 class="">TabTwo</h2><p><p>Text tab 2</p></p></div><div class="tc-reveal" hidden="true"></div><div class="tc-reveal" hidden="true"></div></div></div></p>

View File

@@ -2,4 +2,4 @@ title: expected-test-tabs-vertical
type: text/html
description: Vertical tabs test -- This is the expected HTML output from the test in test-wikitext-tabs-macro.js
<p><div class="tc-tab-set tc-vertical"><div class="tc-tab-buttons tc-vertical"><button class="" data-tab-title="TabOne" role="switch">t 1</button><button aria-checked="true" class=" tc-tab-selected" data-tab-title="TabTwo" role="switch">t 2</button><button class="" data-tab-title="TabThree" role="switch">t 3</button><button class="" data-tab-title="TabFour" role="switch">TabFour</button></div><div class="tc-tab-divider tc-vertical"></div><div class="tc-tab-content tc-vertical"><div class="tc-reveal" hidden="true"></div><div class="tc-reveal"><p>Text tab 2</p></div><div class="tc-reveal" hidden="true"></div><div class="tc-reveal" hidden="true"></div></div></div></p>
<p><div class="tc-tab-set tc-vertical" role="tablist"><div class="tc-tab-buttons tc-vertical"><button aria-selected="false" class="" data-tab-title="TabOne" role="tab">t 1</button><button aria-selected="true" class=" tc-tab-selected" data-tab-title="TabTwo" role="tab">t 2</button><button aria-selected="false" class="" data-tab-title="TabThree" role="tab">t 3</button><button aria-selected="false" class="" data-tab-title="TabFour" role="tab">TabFour</button></div><div class="tc-tab-divider tc-vertical"></div><div class="tc-tab-content tc-vertical" role="tabpanel"><div class="tc-reveal" hidden="true"></div><div class="tc-reveal"><p>Text tab 2</p></div><div class="tc-reveal" hidden="true"></div><div class="tc-reveal" hidden="true"></div></div></div></p>

View File

@@ -0,0 +1,6 @@
created: 20251001034405510
list: A a Ä ä Z z O o Õ õ Ö ö Ü ü Y y
modified: 20251218023544134
tags:
title: Locale Example
type: text/vnd.tiddlywiki

View File

@@ -26,7 +26,6 @@ For the convenience of existing users, we also continue to operate the original
* [[TiddlyWiki Subreddit|https://www.reddit.com/r/TiddlyWiki5/]]
* Chat on Discord at https://discord.gg/HFFZVQ8
* [[TiddlyWiki Subreddit|https://www.reddit.com/r/TiddlyWiki5/]]
!! Developers

View File

@@ -1,16 +0,0 @@
caption: savetiddlers
color: #4DB6AC
community-author: Buggyj
created: 20171109171935039
delivery: Browser Extension
description: Browser extension for Chrome and Firefox
method: save
modified: 20210106151027189
tags: Chrome Firefox Saving [[Other Resources]] plugins
title: "savetiddlers" Extension for Chrome and Firefox by buggyj
type: text/vnd.tiddlywiki
url: https://github.com/buggyj/savetiddlers
An extension for Google Chrome and Mozilla Firefox that smoothes out some of the friction from TiddlyWiki's built-in [[HTML5 saver|Saving with the HTML5 saver]], making it almost as easy to use as TiddlyFox once it is set up correctly.
https://github.com/buggyj/savetiddlers

View File

@@ -0,0 +1,16 @@
caption: savetiddlers
color: #4DB6AC
community-author: buggyj
created: 20171109171935039
delivery: Browser Extension
description: Browser extension for Firefox
method: save
modified: 20250809092435788
tags: Firefox Saving [[Other Resources]] plugins
title: savetiddlers: Extension for Firefox by buggyj
type: text/vnd.tiddlywiki
url: https://github.com/buggyj/savetiddlers
An extension for Mozilla Firefox that smoothes out some of the friction from TiddlyWiki's built-in [[HTML5 saver|Saving with the HTML5 saver]], making it almost as easy to use as [[TiddlyFox]] once it is set up correctly.
{{!!url}}

View File

@@ -1,5 +1,5 @@
created: 20150117190213631
modified: 20230226144641763
modified: 20251225215015507
tags: Concepts
title: Date Fields
type: text/vnd.tiddlywiki
@@ -28,4 +28,5 @@ As an example, the <<.field created>> field of this tiddler has the value <<.val
Dates can be [[converted to other formats|DateFormat]] for display:
<$macrocall $name="wikitext-example-without-html"
src="""<$view field="created" format="date" template="DDD DDth MMM YYYY"/>""">
src="""<$view field="created" format="date" template="DDD DDth MMM YYYY"/>"""/>

View File

@@ -25,4 +25,4 @@ A filter output can change as tiddlers are added and deleted in the wiki. ~Tiddl
* <$linkcatcher message="tm-navigate" actions=<<openAdvancedSearch>> >[[Advanced Search|$:/AdvancedSearch]]</$linkcatcher> -- has a <<.advancedsearch-tab Filter>> tab that makes it easy to experiment with filters.
* [[Filtered Transclusions|Transclusion in WikiText]] -- if you want to use filter results in your text
* [[TiddlyWiki Syntax History]] -- if you are curious why the filter syntax is the way it is
* [[Filter Syntax History]] -- if you are curious why the filter syntax is the way it is

View File

@@ -1,9 +0,0 @@
created: 20131211220000000
modified: 20131211224200000
tags: Definitions
title: TiddlyIE
type: text/vnd.tiddlywiki
TiddlyIE is an extension for Internet Explorer that allows standalone TiddlyWiki files to save their changes directly to the file system. TiddlyIE works with the desktop version of Internet Explorer.
See [[Saving with TiddlyIE]].

View File

@@ -1,7 +1,9 @@
created: 20211117003509226
modified: 20251119135921343
modified: 20260102135713260
tags: sampletag1 sampletag2 [[Widget Examples]]
title: SampleTiddlerFirst
type: text/vnd.tiddlywiki
This is a test tiddler called SampleTidlerFirst.
This is a test tiddler called SampleTidlerFirst.
It is used in [[DiffTextWidget]].
You can modify its content.

View File

@@ -1,6 +1,8 @@
created: 20211117003511221
modified: 20211117003724108
modified: 20260102135739735
tags: sampletag1 sampletag2 [[Widget Examples]]
title: SampleTiddlerSecond
This test tiddler is called SampleTiddlerSecond.
This test tiddler is called SampleTiddlerSecond.
It is used in [[DiffTextWidget]].
You can edit its content.

View File

@@ -1,5 +1,5 @@
created: 20150124112340000
modified: 20150124113250000
modified: 20251218023608468
tags: [[sort Operator]] [[Operator Examples]]
title: sort Operator (Examples)
type: text/vnd.tiddlywiki
@@ -11,3 +11,10 @@ type: text/vnd.tiddlywiki
<<.operator-example 3 "one two Three four +[sort[]]">>
<<.operator-example 4 "[prefix[Tiddl]sort[text]]">>
<<.operator-example 5 "[has[created]sort[created]limit[10]]" "the oldest 10 tiddlers in the wiki">>
! Using a custom locale
The following examples shows the differences when using the sort operator with default, Swedish and Estonian locale.
<<.operator-example 6 "[list[Locale Example]sort[]]">>
<<.operator-example 7 "[list[Locale Example]sort[],[sv]]">>
<<.operator-example 8 "[list[Locale Example]sort[],[et]]">>

View File

@@ -1,15 +1,15 @@
caption: nsort
created: 20140410103123179
modified: 20150203190051000
modified: 20251227084602319
op-input: a [[selection of titles|Title Selection]]
op-neg-output: the input, likewise sorted into descending order
op-output: the input, sorted into ascending order by field <<.field F>>, treating field values as numbers
op-parameter: accept same parameters as the [[sort Operator]]
op-parameter-name: F
op-purpose: sort the input by number field
tags: [[Filter Operators]] [[Field Operators]] [[Order Operators]] [[Negatable Operators]]
title: nsort Operator
type: text/vnd.tiddlywiki
caption: nsort
op-purpose: sort the input by number field
op-input: a [[selection of titles|Title Selection]]
op-parameter: the name of a [[field|TiddlerFields]], defaulting to <<.field title>>
op-parameter-name: F
op-output: the input, sorted into ascending order by field <<.field F>>, treating field values as numbers
op-neg-output: the input, likewise sorted into descending order
Non-numeric values are treated as having a higher value than any number, and the difference between capital and lowercase letters is ignored. Compare <<.olink nsortcs>>.

View File

@@ -1,10 +1,10 @@
caption: nsortcs
created: 20140410103123179
modified: 20150417125717078
modified: 20251227084615705
op-input: a [[selection of titles|Title Selection]]
op-neg-output: the input, likewise sorted into descending order
op-output: the input, sorted into ascending order by field <<.place F>>, treating field values as numbers
op-parameter: the name of a [[field|TiddlerFields]], defaulting to <<.field title>>
op-parameter: accept same parameters as the [[sort Operator]]
op-parameter-name: F
op-purpose: sort the input titles by number field, treating upper and lower case as different
tags: [[Filter Operators]] [[Field Operators]] [[Order Operators]] [[Negatable Operators]]

View File

@@ -1,16 +1,22 @@
caption: sort
created: 20140410103123179
modified: 20150203191228000
modified: 20251227084644651
op-input: a [[selection of titles|Title Selection]]
op-neg-output: the input, likewise sorted into descending order
op-output: the input, sorted into ascending order by field <<.field F>>, treating field values as text
op-parameter: the <<.op sort>> operator accepts 1 or 2 parameters, see below for details
op-parameter-name: F
op-purpose: sort the input by text field
tags: [[Filter Operators]] [[Common Operators]] [[Field Operators]] [[Order Operators]] [[Negatable Operators]]
title: sort Operator
type: text/vnd.tiddlywiki
caption: sort
op-purpose: sort the input by text field
op-input: a [[selection of titles|Title Selection]]
op-parameter: the name of a [[field|TiddlerFields]], defaulting to <<.field title>>
op-parameter-name: F
op-output: the input, sorted into ascending order by field <<.field F>>, treating field values as text
op-neg-output: the input, likewise sorted into descending order
The difference between capital and lowercase letters is ignored. Compare <<.olink sortcs>>.
```
[sort[<field>],[<locale>]]
```
* ''field'' : the name of a [[field|TiddlerFields]], defaulting to <<.field title>>
* ''locale'': (optional). A string with a [[BCP 47 language tag|https://developer.mozilla.org/en-US/docs/Glossary/BCP_47_language_tag]]
<<.operator-examples "sort">>

View File

@@ -1,10 +1,10 @@
caption: sortan
created: 20180222071605739
modified: 20180223012553446
modified: 20251227084439804
op-input: a [[selection of titles|Title Selection]]
op-neg-output: the input, likewise sorted into descending order
op-output: the input, sorted into ascending order by field <<.field F>>, treating field values as alphanumerics
op-parameter: the name of a [[field|TiddlerFields]], defaulting to <<.field title>>
op-parameter: accept same parameters as the [[sort Operator]]
op-parameter-name: F
op-purpose: sort the input by text field considering them as alphanumerics
tags: [[Filter Operators]] [[Common Operators]] [[Field Operators]] [[Order Operators]] [[Negatable Operators]]

View File

@@ -1,10 +1,10 @@
caption: sortcs
created: 20140410103123179
modified: 20150417125704503
modified: 20251227084416522
op-input: a [[selection of titles|Title Selection]]
op-neg-output: the input, likewise sorted into descending order
op-output: the input, sorted into ascending order by field <<.field F>>, treating field values as text
op-parameter: the name of a [[field|TiddlerFields]], defaulting to <<.field title>>
op-parameter: accept same parameters as the [[sort Operator]]
op-parameter-name: F
op-purpose: sort the input by text field, treating upper and lower case as different
tags: [[Filter Operators]] [[Field Operators]] [[Order Operators]] [[Negatable Operators]]

View File

@@ -1,10 +0,0 @@
caption: Internet Explorer
created: 20140811172058274
modified: 20211114031651879
tags: GettingStarted $:/deprecated
title: GettingStarted - Internet Explorer
type: text/vnd.tiddlywiki
{{Saving with TiddlyIE}}
The [[Windows HTA Hack]] describes an alternative method of using TiddlyWiki with Internet Explorer.

View File

@@ -1,5 +1,5 @@
created: 20150414070451144
list: [[HelloThumbnail - Community Survey 2025]] [[HelloThumbnail - Twenty Years of TiddlyWiki]] [[HelloThumbnail - Introduction Video]] [[HelloThumbnail - TiddlyWiki Privacy]] [[HelloThumbnail - Latest Version]] [[HelloThumbnail - Newsletter]] [[HelloThumbnail - Grok TiddlyWiki]] [[HelloThumbnail - TiddlyWikiLinks]] [[HelloThumbnail - MultiWikiServer]] [[HelloThumbnail - Funding]] [[HelloThumbnail - Marketplace]] [[HelloThumbnail - Intertwingled Innovations]]
list: [[HelloThumbnail - Newsletter]] [[HelloThumbnail - Community Survey 2025]] [[HelloThumbnail - Introduction Video]] [[HelloThumbnail - Grok TiddlyWiki]] [[HelloThumbnail - Latest Version]] [[HelloThumbnail - MultiWikiServer]] [[HelloThumbnail - Twenty Years of TiddlyWiki]] [[HelloThumbnail - Funding]] [[HelloThumbnail - TiddlyWiki Privacy]] [[HelloThumbnail - Marketplace]] [[HelloThumbnail - Intertwingled Innovations]] [[HelloThumbnail - TiddlyWikiLinks]]
modified: 20150414070948246
title: HelloThumbnail
type: text/vnd.tiddlywiki

View File

@@ -5,5 +5,6 @@ link: TiddlyWiki Newsletter
image: TiddlyWiki Newsletter Badge
color: #fff
type: text/vnd.tiddlywiki
ribbon-text: NEW
Subscribe to the ~TiddlyWiki Newsletter, a summary of the most interesting and relevant news from the ~TiddlyWiki community

View File

@@ -1,17 +0,0 @@
caption: HTA Hack
color: #F06292
created: 20131212223146250
delivery: DIY
description: Manual method to let Internet Explorer save changes directly
method: save
modified: 20200507110355115
tags: Saving Windows $:/deprecated
title: Windows HTA Hack
type: text/vnd.tiddlywiki
<<.deprecated-since "5.3.6">>
Under Windows it is possible to convert TiddlyWiki into a true local application by renaming the HTML file to have the extension `*.hta`. The ''fsosaver'' module can then use the ~ActiveX ~FileSystemObject to save changes.
Note that one disadvantage of this approach is that the TiddlyWiki file is saved in UTF-16 format, making it up to twice as large as it would be with the usual UTF-8 encoding. However, opening and saving the file via another saving method will re-encode the file to UTF-8.
See Wikipedia for more details: https://en.wikipedia.org/wiki/HTML_Application

View File

@@ -31,6 +31,10 @@ The <<.def list-links-draggable>> [[macro|Macros]] renders the ListField of a ti
; itemTemplate
: Optional title of a tiddler to use as the template for rendering list items
;displayField
: Optional name of the field to display when the list is rendered. Defaults to the "caption" field; if "caption" is not present, the "title" field is used instead
If the `itemTemplate` parameter is not provided then the list items are rendered as simple links. Within the `itemTemplate`, the [[currentTiddler Variable]] refers to the current list item.
<<.macro-examples "list-links-draggable">>

View File

@@ -17,6 +17,9 @@ The <<.def list-tagged-draggable>> [[macro|Macros]] renders the tiddlers with a
: Optional title of a tiddler to use as the template for rendering list items
;emptyMessage
: Optional wikitext to display if there are no tiddlers with the specified tag
Heres a corrected and polished version of your sentence in clear, standard English:
;displayField
: Optional name of the field to display when the list is rendered. Defaults to `title` field.
Note that the [[ordering|Order of Tagged Tiddlers]] is accomplished by assigning a new list to the `list` field of the tag tiddler. Any `list-before` or `list-after` fields on any of the other tiddlers carrying the tag are also removed to ensure the `list` field is respected.

View File

@@ -1,6 +1,6 @@
caption: tag-pill
created: 20161128190930538
modified: 20161128191220364
modified: 20260114112210310
tags: Macros [[Core Macros]]
title: tag-pill Macro
type: text/vnd.tiddlywiki
@@ -9,13 +9,18 @@ The <<.def tag-pill>> [[macro|Macros]] generates a static tag pill showing a spe
!! Parameters
;tag
; tag
: The title of the tag
;element-tag
: The element name to be used for the pill (defaults to "span")
;element-attributes
: Additional attributes for the pill element
;actions
: Action widgets to be triggered when the pill is clicked. Within the text, the macro parameter ''tag'' contains the title of the selected tag.
; element-tag
: The element name to be used for the pill (defaults to HTML element SPAN).
: If an ''actions'' parameter is used the element-tag needs to be set to `$button`
; element-attributes
: Additional attributes for the element specified in ''element-tag''
; actions
: If an actions parameter should be activated, the ''element-tag'' parameter needs to be set to `$button`.
: Action widgets to be triggered when the pill is clicked. Within the text, the macro parameter ''tag'' contains the title of the selected tag
<<.macro-examples "tag-pill">>

View File

@@ -1,17 +0,0 @@
title: $:/changenotes/5.4.0/#8130
created: 20251212171804335
modified: 20251212171804335
tags: $:/tags/ChangeNote
change-type: performance
change-category: internal
description: Different Stylesheets are now included as single `<style>` tags in the Header
release: 5.4.0
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/8130
github-contributors: BurningTreeC
type: text/vnd.tiddlywiki
Previously, all stylesheets were combined in a single `<style>` tag in the `<head>`.
Now, a separate `<style>` tag is created in the `<head>` for each stylesheet.
As part of these changes, the 'view widget' has also been updated. It can now respond dynamically to changes in the 'wikified' formats as well.

View File

@@ -0,0 +1,10 @@
title: $:/changenotes/5.4.0/#9148
description: Bidirectional improvements for core classes
release: 5.4.0
tags: $:/tags/ChangeNote
change-type: enhancement
change-category: theme
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9148
github-contributors: Leilei332
Make some core classes display properly when Tiddlywiki's language uses bidrectional scripts.

View File

@@ -0,0 +1,12 @@
title: $:/changenotes/5.4.0/#9177
description: Add Display Field to list-tagged-draggable and list-links-draggable
release: 5.4.0
tags: $:/tags/ChangeNote
change-type: enhancement
change-category: usability
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9177
github-contributors: kookma
A new input parameter, `displayField`, has been added to the `list-links-draggable` and `list-tagged-draggable` macros,
allowing users to specify which field (e.g., title, caption, or any custom field) should be displayed when a tiddler is
rendered via the draggable macro.

View File

@@ -1,17 +1,7 @@
title: $:/changenotes/5.4.0/#9337/compatibility-break/math-filters
title: $:/changenotes/5.4.0/#9337/impacts/math-filters
changenote: $:/changenotes/5.4.0/#9337
created - 20251112152513384
modified - 20251112152513384
created: 20251112152513384
modified: 20251209160312626
tags: $:/tags/ImpactNote
description: filter output with empty input changes for some math filter operators
impact-type: compatibility-break
These math operators will now output an empty list when the input list is empty:
* sum[] - previously returned 0
* product[] - previously returned 1
* maxall[] - previously returned -Infinity
* minall[] - previously returned Infinity
* average[] - previously returned NaN
* variance[] - previously returned NaN
* standard-deviation[] - previously returned NaN
description: filter output changes for some math filter operators when input list is empty
impact-type: compatibility-break

View File

@@ -0,0 +1,10 @@
title: $:/changenotes/5.4.0/#9348
description: Improve tabs macro accessibility
release: 5.4.0
tags: $:/tags/ChangeNote
change-type: enhancement
change-category: usability
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9348
github-contributors: Leilei332
Adds `tablist`, `tabpanel` and `tab` roles to the tabs macro to improve its accessibility. It also adds a `selectedAria` attribute to the button widget.

View File

@@ -4,7 +4,8 @@ release: 5.4.0
tags: $:/tags/ChangeNote
change-type: enhancement
change-category: translation
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9375
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9375 https://github.com/TiddlyWiki/TiddlyWiki5/pull/9576
github-contributors: BramChen
* change camel-case hint text for chinese translations
* change camel-case hint text for chinese translations
* add alerts ARIA message

View File

@@ -0,0 +1,9 @@
title: $:/changenotes/5.4.0/#9400/impacts/collator
changenote: $:/changenotes/5.4.0/#9400
created: 20251114102355243
modified: 20251114102355243
tags: $:/tags/ImpactNote
description: Tiddlywiki no longer works on browsers that doesn't support [[Intl.Collator|https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator]]
impact-type: compatibility-break

View File

@@ -0,0 +1,10 @@
title: $:/changenotes/5.4.0/#9400
description: Add locale support for sort operators
release: 5.4.0
tags: $:/tags/ChangeNote
change-type: feature
change-category: filters
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9400
github-contributors: Leilei332
Add a new parameter for `sort`, `nsort`, `sortan`, `sortcs` and `nsortcs` to support sorting with a custom locale.

View File

@@ -0,0 +1,15 @@
title: $:/changenotes/5.4.0/#9466
description: ViewToolbar buttons now support condition field
tags: $:/tags/ChangeNote
release: 5.4.0
change-type: feature
change-category: hackability
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9466
github-contributors: linonetwo
ViewToolbar buttons can now be conditionally displayed based on the currentTiddler using a `condition` field. Similar to how `$:/tags/Exporter` and `$:/tags/EditorTools` already have. An example would be:
```tid
tags: $:/tags/ViewToolbar
condition: [<currentTiddler>type[text/x-markdown]] [<currentTiddler>type[text/markdown]]
```

View File

@@ -0,0 +1,15 @@
title: $:/changenotes/5.4.0/#9551
description: Add words and lines modes to diff-text widget
release: 5.4.0
tags: $:/tags/ChangeNote
change-type: enhancement
change-category: widget
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9551
github-contributors: yaisog
The DiffTextWidget now supports two additional diff modes via the `mode` attribute:
* `mode="words"` - Performs word-level diff operations, making differences more intelligible when comparing text
* `mode="lines"` - Performs line-level diff operations, highlighting entire lines that have changed
The default `mode="chars"` continues to work as before, performing character-level diff operations.

View File

@@ -0,0 +1,10 @@
title: $:/changenotes/5.4.0/#9570
description: Fix images loaded from _canonical_uri tiddlers not having progress classes assigned
release: 5.4.0
tags: $:/tags/ChangeNote
change-type: bugfix
change-category: internal
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9570
github-contributors: jermolene
Fixes issue whereby transcluding a _canonical_uri tiddler with a missing image did not assign the progress classes `tc-image-loading`, `tc-image-loaded` and `tc-image-error`.

View File

@@ -0,0 +1,10 @@
title: $:/changenotes/5.4.0/#9565
description: Add stylesheet wiki information
release: 5.4.0
tags: $:/tags/ChangeNote
change-type: feature
change-category: internal
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9565
github-contributors: Leilei332
Extend wiki information tool to display stylesheet information.

View File

@@ -0,0 +1,18 @@
title: $:/changenotes/5.4.0/#9513
description: Bump markdown-it and its plugins to newest version
release: 5.4.0
tags: $:/tags/ChangeNote
change-type: enhancement
change-category: plugin
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9513
github-contributors: Leilei332
Upgrade the markdown-it libraries used by the [[Markdown Plugin]]:
* markdown-it: 14.1.0
* markdown-it-deflist: 3.0.0
* markdown-it-footnote: 4.0.0
* markdown-it-ins: 4.0.0
* markdown-it-mark: 4.0.0
* markdown-it-sub: 2.0.0
* markdown-it-sup: 2.0.0

View File

@@ -0,0 +1,10 @@
title: $:/changenotes/5.4.0/#9248
description: Improve alert accessibility
release: 5.4.0
tags: $:/tags/ChangeNote
change-type: enhancement
change-category: usability
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9248 https://github.com/TiddlyWiki/TiddlyWiki5/pull/9575
github-contributors: Leilei332

View File

@@ -0,0 +1,11 @@
title: $:/changenotes/5.4.0/#9511/impacts/api
changenote: $:/changenotes/5.4.0/#9511
created: 20251220010540143
modified: 20251220010540143
tags: $:/tags/ImpactNote
description: The diff-match-patch-es library uses different APIs
impact-type: compatibility-break
* Default export and the class constructor has been removed
* Function name has been unified to camelCase
* Previous options like Diff_Timeout and Diff_EditCost are now passed as an options object in the arguments if needed

View File

@@ -0,0 +1,10 @@
title: $:/changenotes/5.4.0/#9511
description: Migrate diff-match-patch library to diff-match-patch-es
release: 5.4.0
tags: $:/tags/ChangeNote
change-type: enhancement
change-category: developer
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9511
github-contributors: Leilei332
Migrate the unmaintained [[diff-match-patch|https://github.com/google/diff-match-patch]] library to the maintained and modern fork [[diff-match-patch-es|https://github.com/antfu/diff-match-patch-es]].

View File

@@ -0,0 +1,14 @@
title: $:/changenotes/5.4.0/#9488
description: Refactor base64 utility functions
release: 5.4.0
tags: $:/tags/ChangeNote
change-type: enhancement
change-category: internal
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9488
github-contributors: Leilei332
Refactor base64 utility functions in [[$:/core/modules/utils/utils.js]] to make it easier for maintainence.
* Split base64 utility functions to two platforms
* Use `TextEncoder` and `TextDecoder` api in Node.js
* Do not export `base64ToBytes` and `bytesToBase64`

View File

@@ -4,7 +4,7 @@ created: 20160216191710789
delivery: Protocol
description: Standard web protocol available on products such as Sharepoint
method: save
modified: 20220615155048712
modified: 20260102081028704
tags: Android Chrome Firefox [[Internet Explorer]] Linux Mac Opera PHP Safari Saving Windows iOS Edge
title: Saving via WebDAV
type: text/vnd.tiddlywiki
@@ -19,6 +19,9 @@ Lightweight, portable and easy to use solutions
* [[rclone|https://rclone.org/commands/rclone_serve_webdav/]]
** Running it can be as simple as: <br/>`rclone serve webdav some_directory_containing_tiddlywiki_files`
* [[copyparty|https://github.com/9001/copyparty]]
** Copyparty comes with a ~WebDAV server. Simply run `copyparty -v .::rwd:c,daw` to serve the current folder and visit [[http://[::1]:3923/]] to use TiddlyWiki
** Note that you need to grant read, write and delete permission and add `daw` volflag to allow copyparty to overwrite existing files.
* [[micromata dave - the simple webdav server|https://github.com/micromata/dave]]
* [[dav-server|https://github.com/edrex/dav-server]] is a quick way to serve up a folder of HTML ~TiddlyWikis.
* [[hacdias webdav server|https://github.com/hacdias/webdav/]]
@@ -44,6 +47,10 @@ Lightweight, portable and easy to use solutions
* RCX is an open source file manager for Android based on //rclone//. It is available on both //F-Droid// and //Google Play//. Thanks to its integrated WebDAV server, it lets you edit the wikis that you keep in your pocket. You can share them with other devices on the local network too.
!! iOS
* There are no native apps that can serve a ~WebDAV server, but you can use rclone or copyparty on [[iSH Shell|https://apps.apple.com/cn/app/ish-shell/id1436902243]] or copyparty on [[a-Shell|https://apps.apple.com/cn/app/a-shell/id1473805438]].
!! Servers
Many [[NAS|https://en.wikipedia.org/wiki/NAS]] or [[Subversion|https://en.wikipedia.org/wiki/Apache_Subversion]] servers support ~WebDAV out of the box. Setting up your own server might take some effort though:

View File

@@ -1,25 +0,0 @@
caption: ~TiddlyIE
color: #4DB6AC
community-author: David Jade
created: 20131211220000000
delivery: Browser Extension
description: Browser extension for Internet Explorer
method: save
modified: 20200507201415232
tags: [[Internet Explorer]] Saving $:/deprecated
title: Saving with TiddlyIE
type: text/vnd.tiddlywiki
<<.deprecated-since "5.3.6">>
# Install the TiddlyIE add-on from:
#* https://github.com/davidjade/TiddlyIE/releases
# Restart Internet Explorer. IE will prompt you to enable the TiddlyIE add-on.
#> You may also see a prompt to enable the //Microsoft Script Runtime//
# [[Download]] an empty TiddlyWiki by saving this link:
#> https://tiddlywiki.com/empty.html
# Locate the file you just downloaded
#* You may rename it, but be sure to keep the `.html` or `.htm` extension
# Open the file in Internet Explorer
# Try creating a new tiddler using the ''new tiddler'' <<.icon $:/core/images/new-button>> button in the sidebar. Type some content for the tiddler, and click the <<.icon $:/core/images/done-button>> ''ok'' button
# Save your changes by clicking the <<.icon $:/core/images/save-button-dynamic>> ''save changes'' button in the sidebar. Internet Explorer will ask for your consent to save the file locally by presenting a file ''Save As'' dialog.
# Refresh the browser window to verify that your changes have been saved correctly

View File

@@ -1,5 +1,5 @@
created: 20230803034230294
modified: 20230803043848449
modified: 20260114112240512
tags: [[Macro Examples]] [[tag-pill Macro]]
title: tag-pill Macro (Examples)
@@ -12,3 +12,9 @@ This example displays the [[Definitions]] tag as an unclickable, but still-style
<$transclude $variable=".example" n="2" eg="""<<tag-pill Definitions element-tag:"big" element-attributes:"inert">>"""/>
<$transclude $variable=".example" n="3" eg="""\procedure tag-actions()
<$action-confirm $message="test"/>
\end
<$transclude $variable="tag-pill" tag="asdf" element-tag="$button" actions=<<tag-actions>>/>
""">>

View File

@@ -1,51 +1,77 @@
caption: action-log
created: 20201114113318785
modified: 20201120155202652
modified: 20260105121108063
tags: Widgets ActionWidgets [[Debugging Widgets]]
title: ActionLogWidget
type: text/vnd.tiddlywiki
! Introduction
<<.from-version "5.1.23">> The ''action-log'' widget is an [[action widget|ActionWidgets]] that can be used to output debugging information to the [[JavaScript console|Web Developer Tools]] supported by most browsers. This can be useful because otherwise it is difficult to observe what is going on within a sequence of actions.
<<.from-version "5.1.23">> The <<.wid action-log>> widget is an [[action widget|ActionWidgets]] that can be used to output debugging information to the [[JavaScript console|Web Developer Tools]] supported by most browsers. This can be useful to observe and debug the behavior within a sequence of actions.
When the action is invoked, the names and values of all [[attributes|Widget Attributes]] are logged to the JavaScript console.
```
<$action-log name=value />
```
ActionWidgets are used within triggering widgets such as the ButtonWidget.
<<.tip """ For debugging outside of actions see [[LogWidget]]""">>
<<.note """ For debugging outside of actions see [[LogWidget]]""">>
! Content and Attributes
The ''action-log'' widget is invisible. Any content within it is ignored.
When the actions are invoked, the names and values of all attributes are logged to the JavaScript console.
In addition there are optional attributes that can be used:
|!Optional Attribute |!Description |
|$$filter|All variables matching this filter will also be logged. |
|$$message |A message to display as the title of the information logged. Useful when several `action-log` widgets are used in sequence. |
|$$all |Set to "yes" to log all variables in a collapsed table. Note that if there is nothing specified to log, all variables are always logged instead.|
The <<.wid action-log>> widget is invisible. Any content within it is ignored.
<<.from-version "5.4.0">> Any [[multi-valued variables|Multi-Valued Variables]] or attributes are logged as a list of values.
<<.tip """A handy tip if an action widget is not behaving as expected is to temporarily change it to an `<$action-log>` widget so that the attributes can be observed.""">>
|!Attribute |!Description |
|<<.attr $$filter>>|(Optional) All variables whose name matches the [[Filter Expression]] will be logged |
|<<.attr $$message>> |(Optional) A message to display as the title of the information logged. Useful when several <<.wid action-log>> widgets are used in sequence |
|<<.attr $$all>> |(Optional) Set to <<.value yes>> to log all variables |
! Example
<<.note """ If `<$action-log />` is called without any attributes, all defined variables will be logged as if `$$all=yes` were set.""">>
Here is an example of logging two variables:
<<.note """When logging [[Variable Attribute Values]], the body text of macros and procedures will be output as their value. Functions are evaluated and their first result is logged.""">>
! Examples
!! Basic Example
Log the value of variable <<.var name>>, the first result of the filter expression `[tag[Learning]]` and the value of field <<.field created>> of the current tiddler:
```
<$action-log myVar=<<myVar>> otherVar=<<otherVar>>/>
<$action-log name=<<name>> filter={{{ [tag[Learning]] }}} created={{!!created}} />
```
To log all variables:
!! Example using <<.attr $$filter>> and <<.attr $$message>>
Log all core variables (which start with <<.var tv->>) with a table title:
```
<$action-log />
<$action-log $$message="Core Variables" $$filter="[prefix[tv-]]" />
```
!! Widget Debugging
To log two variables as well as all core variables (which start with `tv-`):
Change a misbehaving <<.wlink ActionSetFieldWidget>> widget to an <<.wid action-log>> widget to verify that <<.var currentTiddler>> and <<.var value>> match their expected values:
<<.tip """If an action widget is not behaving as expected it is often useful to temporarily change it to an <<.wid action-log>> widget so that the passed attributes can be verified.""">>
```
<$action-log myVar=<<myVar>> other={{!!status}} $$filter="[prefix[tv-]]"/>
<$action-log $tiddler=<<currentTiddler>> $field="text" $value=<<value>> />
```
This application is the primary reason that the attributes of the <<.wid action-log>> widget are prefixed with two dollar signs instead of one. Otherwise, the attributes of the original widget could be interpreted as attributes to <<.wid action-log>> and lead to unintended consequences.
!! Example with Function
Log the <<.var tiddlerList>> function definition and its first evaluation result:
```
\function tiddlerList() [tag[Learning]]
<$action-log $$filter="[title[tiddlerList]]" value=<<tiddlerList>> />
```
<<.note """The values output with the <<.attr $$filter>> or <<.attr $$all>> attributes will only contain the definition of functions instead of their values, as the evaluation of many functions can lead to significant performance penalties.""">>

View File

@@ -1,6 +1,6 @@
caption: button
created: 20131024141900000
modified: 20250720025737830
modified: 20251101091926820
tags: Widgets TriggeringWidgets
title: ButtonWidget
type: text/vnd.tiddlywiki
@@ -34,6 +34,7 @@ The content of the `<$button>` widget is displayed within the button.
|setIndex |An ''index'' to which the new value will be assigned, if the attribute <<.attr setTitle>> is present |
|setTo |The new value to assign to the TextReference identified in the `set` attribute or the text field / the field specified through <<.attr setField>> / the index specified through <<.attr setIndex>> of the title given through <<.attr setTitle>> |
|selectedClass |An optional additional CSS class to be assigned if the popup is triggered or the tiddler specified in <<.attr set>> already has the value specified in <<.attr setTo>> |
|selectedAria |<<.from-version "5.4.0">> An ARIA attribute to be set to `true` or `false` when <<.attr selectedClass>> is defined. Allowed values are `aria-checked` (default), `aria-selected` and `aria-pressed` |
|default |Default value if <<.attr set>> tiddler is missing for testing against <<.attr setTo>> to determine <<.attr selectedClass>> |
|popup |Title of a state tiddler for a popup that is toggled when the button is clicked. See PopupMechanism for details |
|popupTitle |Title of a state tiddler for a popup that is toggled when the button is clicked. In difference to the <<.attr popup>> attribute, ''no'' TextReference is used. See PopupMechanism for details |

View File

@@ -1,69 +1,85 @@
caption: diff-text
created: 20180316162725329
modified: 20251117054552220
modified: 20260102132650194
tags: Widgets
title: DiffTextWidget
type: text/vnd.tiddlywiki
! Introduction
<<.from-version "5.1.16">> The diff text widget analyses the differences between a pair of source and destination text strings and displays the results as highlighted insertions and deletions (similar to the "track changes" function of a word processor). For example:
<<.from-version "5.1.16">> The diff text widget analyses the differences between a pair of source and destination text strings and displays the results as highlighted insertions and deletions (similar to the "track changes" function of a word processor).
```
<$diff-text source="This is the original text" dest="This is the text to compare to" mode="words>
These are the <<diff-count>> differences:
</$diff-text>
```
<$diff-text source="Hey Jude, don't make it bad. Take a sad song and make it better. Remember to let her into your heart
Then you can start to make it better." dest="Hey Jude, don't be afraid. You were made to go out and get her. The minute you let her under your skin. Then you begin to make it better."/>
! Content and Attributes
!! Content
The content of the <<.wid diff-text>> widget is displayed immediately before the differences. Within the content, the variable <<.var diff-count>> is available, containing the number of differences found. If the widget has no content then it automatically transcludes the tiddler [[$:/language/Diffs/CountMessage]].
The content of the `<$diff-text>` widget is rendered immediately before the diffs. Within it, the variable `diff-count` is available, containing the number of differences found. If the widget has no content then it automatically transcludes the tiddler [[$:/language/Diffs/CountMessage]].
<<<
In other words, these three invocations are all equivalent:
```
<$diff-text source={{FirstTiddler}} dest={{SecondTiddler}}>
{{$:/language/Diffs/CountMessage}}
</$diff-text>
<$diff-text source={{FirstTiddler}} dest={{SecondTiddler}}>
</$diff-text>
<$diff-text source={{FirstTiddler}} dest={{SecondTiddler}}/>
```
<<<
!! Attributes
<<.note """The algorithm counts changes as both insertion and deletion, and therefore the number of differences can be higher than expected.""">>
|!Attribute |!Description |
|source |The source text |
|dest |The destination text |
|cleanup |Defines a way to allow diffs to be human readable |
|editcost |<<.from-version "5.4.0">> Only active if the cleanup flag is set to "efficient" |
|<<.attr source>> |The source text |
|<<.attr dest>> |The destination text |
|<<.attr cleanup>> |Optional post-processing to improve readability (default is <<.value semantic>>) |
|<<.attr editcost>> |<<.from-version "5.4.0">> Threshold parameter for <<.value efficiency>> cleanup mode (default is <<.value 4>>) |
|<<.attr mode>> |<<.from-version "5.4.0">> Specifies the granularity at which differences are computed and displayed (default is <<.value chars>>) |
!!! Cleanup Flags
!! <<.attr cleanup>> / <<.attr editcost>>
The ''cleanup'' attribute determines which optional post-processing should be applied to the diffs:
The <<.attr cleanup>> attribute determines which optional post-processing should be applied to the diffs:
* ''none'': no cleanup is performed
* ''semantic'' (default): rewrites the diffs for human readability
* ''efficient'': rewrites the diffs to minimise the number of operations for subsequent processing
** If efficient is defined, ''editcost'' defines how the cleanup algorithm for human readability works. See example slider
* <<.value none>>: No cleanup is performed
* <<.value semantic>> (default): Optimizes the differences for readability
* <<.value efficiency>>: Optimizes the differences to minimise the number of operations for subsequent processing
** When using <<.value efficiency>> mode, the <<.attr editcost>> parameter controls the cost threshold for the cleanup algorithm, determining how aggressively the diff algorithm merges nearby edits for better human readability (default value is 4).
<<.note """Note that in many cases the results will be the same regardless of the cleanup option. See the [[docs|https://github.com/google/diff-match-patch/wiki/API]] of the underlying library for more details""">>
!! <<.attr mode>>
The <<.attr mode>> attribute determines how differences are computed and displayed:
* <<.value chars>>: Compares differences at the //character level// for precise change detection
* <<.value words>>: Compares differences at the //word level// for more readable text comparisons
* <<.value lines>>: Compares differences at the //line level// for better visibility of structural changes
! Examples
In this example we compare two texts:
A basic example:
<$macrocall $name='wikitext-example-without-html'
src="""|tc-max-width tc-edit-max-width|k
<<.example n:1 e.g."""<$diff-text source="The quick brown fox jumps" dest="The slick brown fox leaps"/>""">>
In <<.value words>> mode, differences are computed at the words level:
<<.example n:2 e.g."""<$diff-text mode="words" source="The quick brown fox jumps" dest="The slick brown fox leaps"/>""">>
To see the effects of all parameters, use this example:
|tc-max-width tc-edit-max-width|k
|<$edit-text tiddler="SampleTiddlerFirst" rows="5"/>|<$edit-text tiddler="SampleTiddlerSecond" rows="5"/>|
Edit cost: {{$:/temp/SampleTiddlerEditCost}} -- Drag to 7 and then to 33
<$range tiddler="$:/temp/SampleTiddlerEditCost" min="1" max="200" default="4" class="tc-max-width"/>
<$diff-text source={{SampleTiddlerFirst}} dest={{SampleTiddlerSecond}} cleanup={{{ [{!!cleanup}!is[blank]else[efficiency]] }}} editcost={{{ [{!!editcost}!is[blank]else[4]] }}} mode={{{ [{!!mode}!is[blank]else[chars]] }}}/>
<$diff-text source={{SampleTiddlerFirst}} dest={{SampleTiddlerSecond}} cleanup=efficiency editcost={{$:/temp/SampleTiddlerEditCost}}/>
"""/>
!! <<.attr mode>>
<$radio field="mode" value="chars" default="chars" class="tc-small-gap-right"> <<.value chars>></$radio>
<$radio field="mode" value="words" class="tc-small-gap-right"> <<.value words>></$radio>
<$radio field="mode" value="lines"> <<.value lines>></$radio>
!! <<.attr cleanup>>
<$radio field="cleanup" value="none" class="tc-small-gap-right"> <<.value none>></$radio>
<$radio field="cleanup" value="semantic" class="tc-small-gap-right"> <<.value semantic>></$radio>
<$radio field="cleanup" value="efficiency" default="efficiency"> <<.value efficiency>></$radio>
<% if [{!!cleanup}!match[none]!match[semantic]] %>
!! <<.attr editcost>>: <$transclude $variable=".value" _={{{ [{!!editcost}!is[blank]else[4]] }}} />
<$range field="editcost" min="1" max="200" default="4" class="tc-max-width" style.max-width="500px" />
<% endif %>

View File

@@ -1,45 +1,71 @@
created: 20201120152706842
modified: 20201120154927696
modified: 20260105121111637
tags: Widgets [[Debugging Widgets]]
title: LogWidget
type: text/vnd.tiddlywiki
! Introduction
<<.from-version "5.1.23">> The ''log'' widget can be used to output debugging information to the [[JavaScript console|Web Developer Tools]] supported by most browsers.
<<.from-version "5.1.23">> The <<.wid log>> widget is a [[widget|Widgets]] that can be used to output debugging information to the [[JavaScript console|Web Developer Tools]] supported by most browsers.
<<.tip """ For use with ActionWidgets see [[ActionLogWidget]] which uses identical parameters""">>
When the widget is rendered or refreshed, the names and values of all [[attributes|Widget Attributes]] are logged to the JavaScript console.
```
<$log name=value />
```
<<.note """ For debugging inside of actions see [[ActionLogWidget]]""">>
! Content and Attributes
The ''log'' widget is invisible. Any content within it is ignored. Note that the widget will log to the console both when it is first rendered and also every time it refreshes.
When the widget is rendered, the names and values of all attributes are logged to the JavaScript console.
In addition there are optional attributes that can be used:
|!Optional Attribute |!Description |
|$$filter|All variables matching this filter will also be logged. |
|$$message |A message to display as the title of the information logged. Useful when several `log` widgets are used in sequence. |
|$$all |Set to "yes" to log all variables in a collapsed table. Note that if there is nothing specified to log, all variables are always logged instead.|
The <<.wid log>> widget is invisible. Any content within it is ignored.
! Example
|!Attribute |!Description |
|<<.attr $$filter>>|(Optional) All variables whose name matches the [[Filter Expression]] will be logged |
|<<.attr $$message>> |(Optional) A message to display as the title of the information logged. Useful when several <<.wid log>> widgets are used in sequence |
|<<.attr $$all>> |(Optional) Set to <<.value yes>> to log all variables |
Here is an example of logging two variables:
<<.note """ If `<$log />` is called without any attributes, all defined variables will be logged as if `$$all=yes` were set.""">>
<<.note """When logging [[Variable Attribute Values]], the body text of macros and procedures will be output as their value. Functions are evaluated and their first result is logged.""">>
! Examples
!! Basic Example
Log the value of variable <<.var name>>, the first result of the filter expression `[tag[Learning]]` and the value of field <<.field created>> of the current tiddler:
```
<$log myVar=<<myVar>> otherVar=<<otherVar>>/>
<$log name=<<name>> filter={{{ [tag[Learning]] }}} created={{!!created}} />
```
To log all variables:
!! Example using <<.attr $$filter>> and <<.attr $$message>>
Log all core variables (which start with <<.var tv->>) with a table title:
```
<$log />
<$log $$message="Core Variables" $$filter="[prefix[tv-]]" />
```
!! Widget Debugging
To log two variables as well as all core variables (which start with `tv-`):
Change a misbehaving <<.wlink TranscludeWidget>> widget to a <<.wid log>> widget to verify that <<.var name>> and <<.var mode>> match their expected values:
<<.tip """If a widget is not behaving as expected it is often useful to temporarily change it to a <<.wid log>> widget so that the passed attributes can be verified.""">>
```
<$log myVar=<<myVar>> other={{!!status}} $$filter="[prefix[tv-]]"/>
<$log $variable=<<name>> $mode=<<mode>> />
```
This application is the primary reason that the attributes of the <<.wid log>> widget are prefixed with two dollar signs instead of one. Otherwise, the attributes of the original widget could be interpreted as attributes to <<.wid log>> and lead to unintended consequences.
!! Example with Function
Log the <<.var tiddlerList>> function definition and its first evaluation result (see browser console after clicking "Try it"):
<<.example n:"2" eg:"""\function tiddlerList() [tag[Learning]]
<$log $$filter="[title[tiddlerList]]" value=<<tiddlerList>> />""" >>
<<.note """The values output with the <<.attr $$filter>> or <<.attr $$all>> attributes will only contain the definition of functions instead of their values, as the evaluation of many functions can lead to significant performance penalties.""">>

View File

@@ -1,14 +1,7 @@
caption: Definitions
created: 20131205160424246
modified: 20131205160450910
tags: WikiText
modified: 20251229110936191
title: Definitions in WikiText
type: text/vnd.tiddlywiki
caption: Definitions
HTML definition lists are created with this syntax:
<<wikitext-example src:"; Term being defined
: Definition of that term
; Another term
: Another definition
">>
To use HTML Definition Lists through WikiText, see [[Description Lists in WikiText]].

View File

@@ -0,0 +1,14 @@
caption: Description Lists
created: 20131205160424246
modified: 20251229110936191
tags: WikiText
title: Description Lists in WikiText
type: text/vnd.tiddlywiki
HTML description lists (<abbr title="also known as">AKA</abbr> definition lists) are created with this syntax:
<<wikitext-example src:"; Term being described
: Description / Definition of that term
; Another term
: Another description / definition
">>

View File

@@ -28,4 +28,4 @@ See [[HTML in WikiText]] for more details.
The available widgets include:
<<list-links "[tag[Widgets]]">>
<<list-links "[tag[Widgets]]" class:"multi-columns">>

View File

@@ -15,7 +15,7 @@ Common characteristics of such block mode WikiText:
|!~WikiText|!Punctuation|
|[[Block Quotes in WikiText]] |Multi-line block quotes are enclosed by lines containing only the text `<<<`; single line block quotes are also possible.|
|[[Code Blocks in WikiText]]|Enclosed by lines containing only the text <code>&#96;&#96;&#96;</code>|
|[[Definitions in WikiText]]|Each term is on its own line and each definition is on its own line.|
|[[Description Lists in WikiText]]|Each term is on its own line and each definition is on its own line.|
|[[Hard Linebreaks in WikiText]]|Enclosed by lines containing only the text `"""`.|
|[[Headings in WikiText]]|Entire line starting with `!`.|
|[[Horizontal Rules in WikiText]]|A line containing only the text `---`.|
@@ -27,7 +27,7 @@ Common characteristics of such block mode WikiText:
The above WikiText types are only recognised in ''block mode''. However, the text <<.em enclosed>> by most of them will be parsed in ''inline mode'' ([[Block Quotes in WikiText]] and [[Styles and Classes in WikiText]] are the two exceptions in which the parser will continue in ''block mode''). While in ''inline mode'' the parser may encounter something which moves it to ''block mode'' (see [[WikiText parser mode transitions]]).
At the end of the terminating line, the parser will return to ''block mode''.
At the end of the terminating line, the parser will return to ''block mode''.
<<.tip 'Note: [[Hard Linebreaks in WikiText]] require an extra blank line after the trailing `"""` before the parser will return to <strong>block mode</strong>.'>>
If the punctuation for the above types of WikiText is encountered while the parser is in ''inline mode'', it will be //ignored// and output as-is.

View File

@@ -290,10 +290,12 @@ js.configs.recommended,
"@stylistic/wrap-iife": "off",
"@stylistic/wrap-regex": "off",
"@stylistic/yield-star-spacing": "error",
yoda: "off",
// temporary rules
"yoda": "off",
"no-useless-escape": "off",
"no-unused-vars": "warn",
"no-unused-vars": ["warn", {
"args": "none",
"caughtErrors": "none"
}],
"no-empty": "off",
"@stylistic/no-extra-semi": "off",
"no-redeclare": "off",

View File

@@ -22,6 +22,8 @@ CopyToClipboard/Caption: クリップボードへコピー
CopyToClipboard/Hint: このテキストをクリップボードへコピーします
Delete/Caption: 削除
Delete/Hint: Tiddler を削除します
DeleteTiddlers/Caption: Tiddler一式の削除
DeleteTiddlers/Hint: Tiddler一式を削除します
Edit/Caption: 編集
Edit/Hint: この Tiddler を編集します
EditorHeight/Caption: エディタの縦幅
@@ -43,7 +45,8 @@ Excise/Caption/Replace/Link: リンク
Excise/Caption/Replace/Macro: マクロ
Excise/Caption/Replace/Transclusion: 転出
Excise/Caption/Tag: 新しい Tiddler にこの Tiddler のタイトルをタグ付けします
Excise/Caption/TiddlerExists: Warning: Tiddler はすでに存在します
Excise/Caption/TiddlerExists: 警告: Tiddler はすでに存在します
Excise/DefaultTitle: 新しい切り取り
Excise/Hint: 選択したテキストを新しいティドラーに切り出します
ExportPage/Caption: すべてエクスポート
ExportPage/Hint: すべての Tiddler をエクスポートします
@@ -87,6 +90,8 @@ Italic/Caption: 斜体
Italic/Hint: 選択範囲に斜体書式を適用します
Language/Caption: 言語
Language/Hint: メニューの言語を選択します
LayoutSwitcher/Caption: レイアウト
LayoutSwitcher/Hint: レイアウト切り替えを開きます
LineWidth/Caption: 線の長さ
LineWidth/Hint: 線画する線の長さを設定します
Link/Caption: リンク
@@ -105,6 +110,8 @@ MonoLine/Caption: 等幅
MonoLine/Hint: 選択範囲に等幅の文字書式を適用します
More/Caption: その他のコマンド
More/Hint: その他のコマンドを表示します
NetworkActivity/Caption: ネットワークアクティビティ
NetworkActivity/Hint: すべてのネットワークアクティビティをキャンセルします
NewHere/Caption: タグ付き Tiddler の作成
NewHere/Hint: この Tiddler のタイトルのタグを付けた、新しい Tidder を作成します
NewImage/Caption: 新しい画像
@@ -119,6 +126,7 @@ NewTiddler/Caption: 新しい Tiddler
NewTiddler/Hint: 新しい Tiddler を作成します
Opacity/Caption: 透明度
Opacity/Hint: ペイントの透明度を設定します
OpenControlPanel/Hint: この Wiki の設定画面を開きます
OpenWindow/Caption: 新しいウインドウで開く
OpenWindow/Hint: 新しいウインドウで Tiddler を開く
Paint/Caption: ペイント色
@@ -155,10 +163,10 @@ Size/Caption/Height: 縦幅:
Size/Caption/Resize: 画像のサイズを変更
Size/Caption/Width: 横幅:
Size/Hint: 画像サイズの設定
Stamp/Caption: 自己紹介
Stamp/Caption/New: 自己紹介を追加します
Stamp/Caption: スタンプ
Stamp/Caption/New: 独自のスニペットを追加します
Stamp/Hint: あらかじめ設定されたスニペットを挿入します
Stamp/New/Text: スニペットのテキスト (キャプションフィールドに説明的なタイトルを追加することを忘れないでください)
Stamp/New/Text: スニペットのテキスト (captionフィールドに説明的なタイトルを追加することを忘れないでください)
Stamp/New/Title: メニューに表示する名前
StoryView/Caption: Tidder 表示切替
StoryView/Hint: Tiddler の表示方法を切り替えます
@@ -170,6 +178,8 @@ Superscript/Caption: 上付き文字
Superscript/Hint: 選択範囲に上付き文字の書式を適用します
TagManager/Caption: タグの管理
TagManager/Hint: タグの管理画面を開きます
TestCaseImport/Caption: Tiddler一式のインポート
TestCaseImport/Hint: Tiddler一式をインポートします
Theme/Caption: テーマ
Theme/Hint: 表示のテーマを選択します
Timestamp/Caption: タイムスタンプ

View File

@@ -98,6 +98,10 @@ Plugins/Plugins/Caption: プラグイン
Plugins/Plugins/Hint: プラグイン
Plugins/PluginWillRequireReload: (再読み込みが必要)
Plugins/Reinstall/Caption: 再インストール
Plugins/Stability/Deprecated: 非推奨
Plugins/Stability/Experimental: 実験的
Plugins/Stability/Legacy: レガシー
Plugins/Stability/Stable: 安定版
Plugins/SubPluginPrompt: <<count>> 件サブプラグインが利用可能です
Plugins/Theme/Prompt: テーマ
Plugins/Themes/Caption: テーマ
@@ -155,6 +159,8 @@ Settings/DefaultMoreSidebarTab/Caption: デフォルトのサイドバー 詳し
Settings/DefaultMoreSidebarTab/Hint: デフォルトで表示されるサイドバー 詳しく タブを指定します
Settings/DefaultSidebarTab/Caption: 標準サイドバータブ
Settings/DefaultSidebarTab/Hint: 標準で表示されるサイドバータブを指定します
Settings/DefaultTiddlerInfoTab/Caption: Tiddler情報のデフォルトタブ
Settings/DefaultTiddlerInfoTab/Hint: Tiddler情報パネルを開いたときにデフォルトで表示されるタブを指定します
Settings/EditorToolbar/Caption: エディターツールバー
Settings/EditorToolbar/Description: エディターツールバーを表示
Settings/EditorToolbar/Hint: エディターツールバーの有効・無効を切り替えます:
@@ -189,6 +195,8 @@ Settings/NavigationPermalinkviewMode/UpdateAddressBar/Description: アドレス
Settings/PerformanceInstrumentation/Caption: パフォーマンス統計情報
Settings/PerformanceInstrumentation/Description: パフォーマンス統計情報の有効
Settings/PerformanceInstrumentation/Hint: ブラウザの開発者コンソールにパフォーマンスの統計情報を表示します。有効にするには再読み込みが必要です
Settings/RecentLimit/Caption: 最近の更新タブの上限
Settings/RecentLimit/Hint: サイドバーの"最近の更新"タブに表示されるTiddlerの最大数
Settings/TitleLinks/Caption: Tiddler タイトル
Settings/TitleLinks/Hint: オプションで Tiddler のタイトルをリンクとして表示することができます
Settings/TitleLinks/No/Description: Tiddler のタイトルをリンクとして表示しない
@@ -202,6 +210,12 @@ Settings/ToolbarButtonStyle/Hint: ツールバーのボタンのスタイルを
Settings/ToolbarButtonStyle/Styles/Borderless: 枠なし
Settings/ToolbarButtonStyle/Styles/Boxed: 四角
Settings/ToolbarButtonStyle/Styles/Rounded: 角丸
SocialCard/Caption: ソーシャルメディアカード
SocialCard/Domain/Prompt: リンクに表示するドメイン名(例: ''tiddlywiki.com'')
SocialCard/Hint: この情報は、オンラインでホストされているこの~TiddlyWikiへのリンクのプレビューカードを表示するために、ソーシャルサービスやメッセージングサービスによって使用されます
SocialCard/PreviewUrl/Preview: プレビュー画像:
SocialCard/PreviewUrl/Prompt: この~TiddlyWikiのプレビュー画像のフルURL
SocialCard/Url/Prompt: この~TiddlyWikiのフルURL
StoryTiddler/Caption: Tiddler 表示部
StoryTiddler/Hint: このルールカスケードは、Tiddler 表示部にに Tiddler を表示するためのテンプレートを動的に選択するために使用されます。
StoryView/Caption: 表示スタイル
@@ -210,6 +224,12 @@ Stylesheets/Caption: スタイルシート
Stylesheets/Expand/Caption: すべて展開
Stylesheets/Hint: <<tag "$:/tags/Stylesheet">> でタグ付けされた現在のスタイルシートの Tiddler でレンダリングされた CSS です
Stylesheets/Restore/Caption: 復旧
TestCases/All/Caption: すべてのテストケース
TestCases/All/Hint: すべてのテストケース
TestCases/Caption: テストケース
TestCases/Failed/Caption: 失敗したテストケース
TestCases/Failed/Hint: 失敗したテストケースのみ
TestCases/Hint: テストケースは、それ自体で完結していて、テストや学習に使える例です
Theme/Caption: テーマ
Theme/Prompt: 現在のテーマ:
TiddlerColour/Caption: Tiddler の色
@@ -234,5 +254,13 @@ Tools/Export/AllAsStaticHTML/Caption: すべての Tiddler を含む閲覧用 HT
Tools/Export/Heading: エクスポート
ViewTemplateBody/Caption: 表示テンプレートの本体
ViewTemplateBody/Hint: このルールカスケードは、デフォルトのビューテンプレートが Tiddler の本体を表示するためのテンプレートを動的に選択するために使用されます。
ViewTemplateSubtitle/Caption: 表示テンプレートのサブタイトル
ViewTemplateSubtitle/Hint: このルールカスケードは、デフォルトのビューテンプレートがTiddlerのサブタイトルを表示するためのテンプレートを動的に選択するために使用されます。
ViewTemplateTags/Caption: 表示テンプレートのタグ
ViewTemplateTags/Hint: このルールカスケードは、デフォルトのビューテンプレートがTiddlerのタグエリアを表示するためのテンプレートを動的に選択するために使用されます。
ViewTemplateTitle/Caption: 表示テンプレートのタイトル
ViewTemplateTitle/Hint: このルールカスケードは、デフォルトのビューテンプレートが Tiddler のタイトルを表示するためのテンプレートを動的に選択するために使用されます。
WikiInformation/Caption: Wikiの情報
WikiInformation/Drag/Caption: このツールを別のウィキにコピーするには、このリンクをドラッグします
WikiInformation/Hint: このページは、~TiddlyWikiの設定に関する概要情報をまとめたものです。フォーラムで助けを求める際など、ユーザーが~TiddlyWikiの設定に関する重要な情報を他のユーザーと簡単に共有できるように設計されています。プライベート情報や個人情報は含まれておらず、明示的にコピーペーストしない限り、他の場所に共有されることはありません

View File

@@ -1,21 +1,30 @@
title: $:/language/Docs/ModuleTypes/
allfilteroperator: ''all'' フィルターオペレータのサブオペレータ。
animation: アニメーション。通常は RevealWidget で使用されるモジュール。
authenticator: 組み込みHTTP サーバーによるリクエスト認証方法を定義します。
bitmapeditoroperation: ビットマップ エディターのツールバーの操作。
command: Node.js で実行できるコマンド。
config: `$tw.config` に格納されるデータ。
filteroperator: 個々のフィルタ操作用メソッドモジュール。
global: `$tw` に格納されるグローバルデータ。
info: [[$:/temp/info-plugin]] 疑似プラグインを介してシステム情報を公開します。
isfilteroperator: フィルタ ''is'' メソッドのオペランドモジュール。
library: JavaScript汎用モジュール用の汎用モジュールタイプ。
macro: JavaScript マクロの定義モジュール。
parser: 各種 ContentType のパーサモジュール。
route: 組み込みHTTPサーバーでURLの個々のパターンをどのように処理するかを定義します。
saver: ファイル保存メソッドモジュール。ブラウザによる差異を吸収する。
startup: 初回実行ファンクションモジュール。
storyview: リストウィジェットのアニメーションや振る舞いをカスタマイズするモジュール。
texteditoroperation: テキストエディターのツールバーの操作。
tiddlerdeserializer: Tiddler を他の ContentType に変換するモジュール。
tiddlerfield: 個々の Tiddler フィールドの振る舞いを定義するモジュール。
tiddlermethod: `$tw.Tiddler` の prototype にメソッドを追加するモジュール。
upgrader: アップグレードやインポート中に Tiddler のアップグレード処理を追加するモジュール。
utils: `$tw.utils` にメソッドを追加するモジュール。
utils-browser: `$tw.utils` にブラウザ固有のメソッドを追加するモジュール。
utils-node: `$tw.utils` に Node.js 特有のメソッドを追加するモジュール。
widget: DOM の描画や操作をひとまとめにしたウィジェットモジュール。
wikimethod: `$tw.Wiki` にメソッドを追加するモジュール。

View File

@@ -6,6 +6,9 @@ alert-highlight: アラートのハイライト
alert-muted-foreground: 抑えたアラートの前景
background: 標準の背景
blockquote-bar: 引用線
button-background: ボタンのデフォルト背景
button-border: ボタンのデフォルト枠線
button-foreground: ボタンのデフォルト前景
code-background: コードの背景
code-border: コードの枠線
code-foreground: コードの前景
@@ -26,6 +29,8 @@ external-link-foreground: 外部リンクの前景
external-link-foreground-hover: 外部リンクの前景(ホバー)
external-link-foreground-visited: 外部リンクの前景(既訪)
foreground: 標準の前景
menubar-background: メニューバーの背景
menubar-foreground: メニューバーの前景
message-background: メッセージボックスの背景
message-border: メッセージボックスの枠線
message-foreground: メッセージボックスの前景
@@ -42,6 +47,8 @@ page-background: ページの背景
pre-background: 整形済みコードの背景
pre-border: 整形済みコードの枠線
primary: 標準の前景
select-tag-background: `<select>` 要素の背景
select-tag-foreground: `<select>`要素のテキスト
sidebar-button-foreground: サイドバーボタンの前景
sidebar-controls-foreground: サイドバーコントロールの前景
sidebar-controls-foreground-hover: サイドバーコントロールの前景(ホバー)
@@ -58,6 +65,11 @@ sidebar-tab-foreground: サイドバータブの前景
sidebar-tab-foreground-selected: サイドバータブの前景(選択済)
sidebar-tiddler-link-foreground: サイドバーtiddlerリンクの前景
sidebar-tiddler-link-foreground-hover: サイドバーtiddlerリンクの前景ホバー
site-title-foreground: サイトタイトルの前景
stability-deprecated: 安定度 "非推奨"のバッジ
stability-experimental: 安定度 "実験的"のバッジ
stability-legacy: 安定度 "レガシー"のバッジ
stability-stable: 安定度 "安定版"のバッジ
static-alert-foreground: 固定アラート前景
tab-background: タブの背景
tab-background-selected: タブの背景(選択済)
@@ -71,6 +83,9 @@ table-footer-background: テーブルフッタの背景
table-header-background: テーブルヘッダの背景
tag-background: タグの背景
tag-foreground: タグの前景
testcase-accent-level-1: ネストなしのテストケースアクセントカラー
testcase-accent-level-2: 2段階ネストありのテストケースアクセントカラー
testcase-accent-level-3: 3段階ネストありのテストケースアクセントカラー
tiddler-background: Tiddler の背景
tiddler-border: Tiddler の前景
tiddler-controls-foreground: Tiddler 部品の前景

View File

@@ -26,6 +26,8 @@ Tags/ClearInput/Caption: 入力をクリア
Tags/ClearInput/Hint: タグ入力をクリア
Tags/Dropdown/Caption: タグ一覧
Tags/Dropdown/Hint: タグ一覧を表示
Tags/EmptyMessage: タグが見つかりません
Tags/EmptyMessage/System: システムタグが見つかりません
Title/BadCharacterWarning: 警告: Tiddler のタイトルに <<bad-chars>> という文字の使用は避けてください
Title/Exists/Prompt: 対象の Tiddler がすでに存在します
Title/References/Prompt: この Tiddler の次のリファレンスは、自動的には更新されません:

View File

@@ -1,3 +1,6 @@
title: $:/language/Exporters/
CsvFile: CSV ファイル
JsonFile: JSON ファイル
StaticRiver: 静的 HTML ファイルとして構成される一連の Tiddler
TidFile: ".tid" ファイル

View File

@@ -2,11 +2,14 @@ title: $:/language/Docs/Fields/
_canonical_uri: 外部画像 Tiddler の URI
_is_skinny: 存在する場合 Tiddler テキストフィールドがサーバーから読み込まれなければなりません
author: プラグインの作者の名前
bag: Tiddler の由来となった bag の名前
caption: タブやボタンに表示されるテキスト
code-body: ''はい'' に設定すると、表示テンプレートは、コードとして Tiddler を表示します
class: Tiddlerをレンダリングする際に適用されるCSSクラスです。モーダルにも使用されます
code-body: ''yes'' に設定すると、表示テンプレートは、コードとして Tiddler を表示します
color: Tiddler に使用される CSS カラーの値
component: [[アラート Tiddler|AlertMechanism]] の原因となったコンポーネントの名前
core-version: プラグインの場合、互換性のあるTiddlyWikiのバージョンを示します
created: Tiddler が作成された日付
creator: Tiddler の作成者名
current-tiddler: [[履歴一覧|HistoryMechanism]] のトップにある Tiddler をキャッシュするために使用されます
@@ -15,25 +18,28 @@ description: プラグインなどの説明文
draft.of: それがドラフト Tiddler であるときのタイトル
draft.title: ドラフト Tiddler が正式版になったときに使用される予定のタイトル
footer: ウィザードのフッタ部テキスト
hide-body: ''はい'' に設定すると表示テンプレートは、Tiddler の本文を非表示にします
hide-body: ''yes'' に設定すると表示テンプレートは、Tiddler の本文を非表示にします
icon: 紐付けられているアイコン Tiddler のタイトル
library: "はい" の場合、その Tiddler は JavaScript ライブラリとして保存する必要があります
library: ''yes'' の場合、その Tiddler は JavaScript ライブラリとして保存する必要があります
list: その Tiddler に紐付く Tiddler 名の順序付きリスト
list-after: この項目が設定された Tiddler は、順序付きリストでこのフィールドに記載の名前の Tiddler の後ろに並びます
list-before: この項目が設定された Tiddler は、順序付きリストでこのフィールドに記載の名前の Tiddler の前に並びます。ただし空文字列が指定されていた場合は順序付きリストの先頭になります
modified: その Tiddler の最終更新日時
modifier: その Tiddler を最後に更新したユーザー名
module-type: JavaScript Tiddlerの場合、モジュールの種類を指定します
name: 人が読める形のプラグイン Tiddler 名
parent-plugin: プラグインの場合、どのプラグインのサブプラグインであるかを特定
plugin-priority: プラグインの優先度を示す数値
plugin-type: プラグインの種別
released: TiddlyWiki のリリース日付
revision: サーバー上の Tiddler のリビジョン
source: その Tiddler のソース URL
stability: プラグインの開発状況: 非推奨、実験的、安定版、またはレガシー
subtitle: ウィザードのサブタイトル
tags: その Tiddler に付けられたタグのリスト
text: Tiddler の本文
throttle.refresh: 存在する場合、この Tiddler の更新を抑制します
title: Tiddler の一意となる名称
toc-link: 目次一覧で ''いいえ'' に設定されている場合、Tiddler のリンクを抑制します
toc-link: 目次一覧で ''no'' に設定されている場合、Tiddler のリンクを抑制します
type: その Tiddler の種別
version: プラグインのバージョン情報

View File

@@ -0,0 +1,18 @@
title: $:/language/Help/commands
description: フィルターから返されたコマンドを順に実行
フィルターから返されたコマンドトークンを順に実行します
```
--commands <filter>
```
```
--commands "[enlist:raw{$:/build-commands-as-text}]"
```
```
--commands "[{$:/build-commands-as-json}jsonindexes[]] :map[{$:/build-commands-as-json}jsonget<currentTiddler>]"
```

View File

@@ -0,0 +1,8 @@
title: $:/language/Help/deletetiddlers
description: Tiddlerのグループを削除
フィルターによって識別されたTiddlerのグループを削除します。
```
--deletetiddlers <filter>
```

View File

@@ -0,0 +1,38 @@
title: $:/language/Help/fetch
description: URLのWikiからTiddler一式を取得
HTTP/HTTPS経由で1つ以上のファイルを取得し、フィルターに一致するTiddler一式をインポートします。オプションで、受信したタイトルを変換できます。
```
--fetch file <url> <import-filter> <transform-filter>
--fetch files <url-filter> <import-filter> <transform-filter>
--fetch raw-file <url> <transform-filter>
--fetch raw-files <url-filter> <transform-filter>
```
"file"および"files"バリエーションは、指定されたファイルを取得し、その中のTiddler一式をインポートしようとしますファイルをブラウザウィンドウにドラッグした場合と同じ処理です。"raw-file"および"raw-files"バリエーションは、指定されたファイルを取得し、インポートロジックを適用せずに、生のファイルデータをTiddlerに保存します。
"file"および"raw-file"バリエーションでは、1 つのファイルのみが取得され、最初のパラメータは読み込むファイルのURLになります。
"files"および"raw-files"バリエーションでは、複数のファイルが取得され、最初のパラメータは読み込む対象のファイルのURLリストを生成するフィルターです。例えば、"remote-server"タグが付けられ、"url"フィールドを持つTiddlerのセットが指定された場合、フィルター`[tag[remote-server]get[url]]`は、有効なすべてのURLを取得します。
"file"および"files"バリエーションの場合、`<import-filter>` パラメータはインポートするTiddlerを決定するフィルターを指定します。指定されていない場合は、デフォルトで`[all[tiddlers]]`になります。
すべてのバリエーションにおいて、`<transform-filter>` パラメータはインポートされたTiddlerのタイトルを変換するオプションフィルターを指定します。例えば、`[addprefix[$:/myimports/]]`は、各タイトルに`$:/myimports/` プレフィックスを追加します。
`--fetch` コマンドの前に`--verbose`を付けると、インポートの進行状況が出力されます。
TiddlyWikiは、すでにロードされているプラグインの古いバージョンを取得しないことに注意してください。
次の例では、https://tiddlywiki.com からシステム以外のすべてのTiddlerを取得し、JSON ファイルに保存します:
```
tiddlywiki --verbose --fetch file "https://tiddlywiki.com/" "[!is[system]]" "" --rendertiddler "$:/core/templates/exporters/JsonFile" output.json text/plain "" exportFilter "[!is[system]]"
```
以下の例では、tiddlywiki.com から"favicon"ファイルを取得し、"output.ico"というファイルに保存します。中間のTiddler "Icon Tiddler"は"--fetch"コマンドで引用符で囲まれていますが、これはデフォルトのタイトルを置き換えるための変換フィルタとして使用されているためです。一方、"-- savetiddler"コマンドでは、タイトルとして直接使用されているため引用符は付いていません。
```
tiddlywiki --verbose --fetch raw-file "https://tiddlywiki.com/favicon.ico" "[[Icon Tiddler]]" --savetiddler "Icon Tiddler" output.ico
```

View File

@@ -0,0 +1,24 @@
title: $:/language/Help/import
description: ファイルからTiddlerをインポート
TiddlyWiki (`.html`)、 `.tiddler`、`.tid`、`.json` またはその他のローカルファイルからTiddler一式をインポートします。ファイル拡張子からデシリアライザーを推測する`load` コマンドとは異なり、デシリアライザーは明示的に指定する必要があります。
```
--import <filepath> <deserializer> [<title>] [<encoding>]
```
Coreに含まれるデシリアライザーは以下です:
* application/javascript
* application/json
* application/x-tiddler
* application/x-tiddler-html-div
* application/x-tiddlers
* text/html
* text/plain
インポートされたTiddlerのタイトルは、デフォルトでファイル名になります。
エンコードのデフォルトは"utf8"ですが、バイナリファイルをインポートする場合は"base64"にすることができます。
TiddlyWiki は、すでにロードされているプラ​​グインの古いバージョンをインポートしないことに注意してください。

View File

@@ -0,0 +1,34 @@
title: $:/language/Help/listen
description: TiddlyWikiへのHTTPサーバーインターフェースを提供
HTTP経由でWikiを提供します。
listenコマンドは[[名前付きコマンドパラメータ|NamedCommandParameters]]を使用します:
```
--listen [<name>=<value>]...
```
すべてのパラメータはオプションで、安全なデフォルトが設定されており、任意の順序で指定できます。認識されるパラメータは以下のとおりです:
* ''host'' - サービスを提供するオプションのホスト名 (デフォルトは"127.0.0.1"または"localhost")
* ''path-prefix'' - パスのオプションのプレフィックス
* ''port'' - listenするポート番号。数値以外の値は、システム環境変数として解釈され、ポート番号を抽出します (デフォルトは"8080")
* ''credentials'' - 資格情報CSVファイルのパス名 (Wikiフォルダからの相対パス)
* ''anon-username'' - 匿名ユーザーが編集する際に署名するユーザー名
* ''username'' - 基本認証用のオプションのユーザー名
* ''password'' - 基本認証用のオプションのパスワード
* ''authenticated-user-header'' - 信頼された認証で使用されるリクエストヘッダーのオプションの名前
* ''readers'' - このWikiから読み取りを許可されているプリンシパルのコンマ区切りリスト
* ''writers'' - このWikiへの書き込みを許可されているプリンシパルのコンマ区切りリスト
* ''csrf-disable'' - CSRFチェックを無効にするには"yes"に設定 (デフォルトは "no")
* ''root-tiddler'' -ルートで提供するTiddler (デフォルトは"$:/core/save/all")
* ''root-render-type'' - ルートTiddlerをレンダリングするコンテンツタイプ (デフォルトは "text/plain")
* ''root-serve-type'' - ルートTiddlerが提供されるコンテンツタイプ (デフォルトは "text/html")
* ''tls-cert'' - pathname of TLS certificate file (relative to wiki folder)
* ''tls-key'' - TLS鍵ファイルのパス名 (Wikiフォルダからの相対パス)
* ''debug-level'' - オプションのデバッグレベル。リクエストの詳細を表示するには"debug"に設定 (デフォルトは"none")
* ''gzip'' - 一部の HTTP エンドポイント用にgzip圧縮を有効にするには"yes"に設定 (デフォルトは"no")
* ''use-browser-cache'' - 帯域幅の節約のためにブラウザが応答をキャッシュできるようにするには"yes"に設定 (デフォルトは"no")
インスタンスをローカルネットワークに公開する方法、およびセキュリティ上の懸念事項については、TiddlyWiki.comのWebServer Tiddler を参照してください。

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