Compare commits

...

87 Commits

Author SHA1 Message Date
Xavier Cazin 6f5e370aa8
Merge df4dfc5a9e into a081e58273 2024-04-25 23:36:14 +08:00
Matt Lauber a081e58273
HTTP Client: Return success calls for all 2XX response codes (#8150)
APIs especially use 2XX response codes outside of 200, 201, 204 for responding to responses.  Treat all "Successful" response codes (i.e. anything between 200-299) as successes, and pass the responseText.
2024-04-16 16:24:53 +01:00
Joshua Fontany 5f74f4c2fa
Fix bug 7878: Save command (#8140)
* first pass at fixing bug 7878, needs testing

* clarify default behaviour in comment

* fix property typo, tested and works as intended

* remove debugger
2024-04-11 21:54:46 +01:00
Joshua Fontany 9167b190d2
Fix bug 8138: server cache-control (#8141)
* cache-control no-store by default

* clarify comment spec reference

* comment typo

* fix else formatting

* Update server.js

allow route definitions to set their own cache-control
2024-04-11 19:23:32 +01:00
Cameron Fischer df8731f760
Made library boot module requirements consistent (#8083) 2024-04-10 10:52:22 +01:00
Rob Hoelz e9aa3c6c93
Add $timestamp argument for <$action-deletefield> widget (#8115)
* Start on some tests for <$action-deletefield />

* Only update modified field if we actually delete a field

…in the <$action-deletefield /> widget.

Fixes a bug where <$action-deletefield foo /> would update the modified field
if the "foo" field wasn't present on a tiddler.

* action-deletefield: Test when modified does and doesn't exist

* Add $timestamp argument to action-deletefield

To make it more consistent with other tiddler-manipulating action widgets

* Add docs for action-deletefield $timestamp
2024-04-04 16:03:15 +01:00
Jeremy Ruston 105e8195d5 Merge branch 'tiddlywiki-com' 2024-04-03 21:51:13 +01:00
Simon Huber eeb4e7a7f7
Add a "Refresh Browser" keyboard shortcut (#8121)
* Create a `refresh` keyboard shortcut

This creates a `refresh` keyboard shortcut that refreshes the page.
In TiddlyDesktop <kbd>ctrl-R</kbd> doesn't work

* Update refresh.tid

* Update shortcuts-not-mac.multids

* Update shortcuts-mac.multids

* Update ShortcutInfo.multids
2024-04-03 09:58:56 +01:00
Simon Huber 7ce85a2ddb
Update reset.tid to use modern-normalize 2.0.0 (#8120)
This PR updates the vanilla/reset stylesheet to use the newer `modern-normalize 2.0.0`
2024-04-02 17:35:10 +01:00
Crystal Person 804f227815
Signing CLA (#8126) 2024-03-31 17:08:09 +01:00
Rob Hoelz 9939759690
Report throttled refreshes (#8116)
Fixes GH #6054
2024-03-29 14:47:22 +00:00
Mario Pietsch b595651fe1
Fix hide-show button code needs to be transcluded mode=block (#8082) 2024-03-28 21:50:22 +00:00
Mario Pietsch 9cd6affcae
Minor changes to Widgets tiddler (#8107) 2024-03-28 19:29:57 +00:00
Mario Pietsch e43cd2d989
Use v5.3.x syntax for $:/core/ui/PageTemplate/pagecontrols (#8088) 2024-03-28 19:29:16 +00:00
Mario Pietsch f1e707bff4
Refactor GitHub-fork-ribbon plugin for better compatibility (#8075) 2024-03-28 19:27:58 +00:00
Mario Pietsch 2d92a6fd78
Tag picker rewritten using new v5.3.x syntax (#7978)
* tag-picker add Examples

* tag-picker - use new v5.3.x wikitext syntax

* tag-picker - more inline docs

* tag-picker - fix add button

* rename local functions: tag, userInput to _tf.getTag and _tf.getUersName to make the code and variable scopes more understandable

* tag-picker - move local variables definitions into one place: tag-picker macro

* tag-picker - replace reveal-widget with conditional IF syntax

* tag-picker - remove logs and test tag-picker - actions parameer -> OK

* tag-picker - add tag-picker Macro docs

* tag-picker docs - change \define -> \procedure

* tag-picker -- fix problem with focus loss if elements selected by mouse click

* tag-picker -- add tf. prefix only to new function definition names for backwards compatibility.

* tag-picker -- update example docs

* re-add tags: $:/tags/Macro
2024-03-28 19:09:31 +00:00
Mario Pietsch 2e0e541ebf
Add tc-tag-missing or tc-tag-exists to tag pills including docs (#7951)
* add tc-tag-missing or tc-tag-exists to tag pills including docs

* changes as requested

* macros not needed anymore - so remove

* fix the tag Macro docs
2024-03-28 19:07:54 +00:00
Mario Pietsch b4d7e34a5a
Add unusedtitle macro tests - should have full code covery (#7939)
* add unusedtitle macro tests - should have full code covery

* remove numbering from tests
2024-03-28 18:39:57 +00:00
Mario Pietsch b6eab1afd6
Add theme font size settings to Open in New Window CSS (#7945)
* add theme font size settings to Open in New Window CSS

* add DOCTYPE html to New Window startup template

* fix merge typo

* fix merge typo one more time
2024-03-28 18:36:33 +00:00
Télumire 32cbd53423
Set a proper doctype for the open window template (#8095) 2024-03-27 18:20:35 +00:00
Jeremy Ruston 90a6f31db2 Merge branch 'tiddlywiki-com' 2024-03-27 10:10:26 +00:00
Jeremy Ruston d37d6595b5 Docs: Add link to Basic Auth example 2024-03-27 10:09:46 +00:00
Jeremy Ruston e02cafb938 Add docs about using Basic Authentication in HTTP requests 2024-03-27 08:35:56 +00:00
Jeremy Ruston 801ed0ea11 Fix cycle operator crashing if step size is larger than the number of operands
See https://talk.tiddlywiki.org/t/bug-report-javascript-error-at-tw-com-within-cycle-operator-try-it/9430/1
2024-03-26 16:04:13 +00:00
Mario Pietsch 31ec1bdd50
Add tag parameter to reveal-widget to fix regression (#8084) 2024-03-18 09:08:11 +00:00
Jeremy Ruston 62a5fc075b Merge branch 'tiddlywiki-com' 2024-03-16 22:05:51 +00:00
Mario Pietsch 0b6db6e860
Fix indentation for tiddlers that set tv-config-toolbar-class (#8079)
human readable in preparation to add data-title=<<listItem>>
for better UX defining a "read only" theme

Changes to be committed:
	modified:   core/ui/EditTemplate/controls.tid
	modified:   core/ui/PageControls.tid
	modified:   core/ui/PageControls/more-page-actions.tid
	modified:   core/ui/ViewTemplate/title.tid
	modified:   core/ui/ViewToolbar/more-tiddler-actions.tid
	modified:   plugins/tiddlywiki/menubar/items/pagecontrols.tid
2024-03-16 19:03:36 +00:00
poc2go 09f04cb5a6
Signing the CLA (#8077) 2024-03-16 17:33:13 +00:00
Mario Pietsch 511d480a60
Fix wikitext-macros example block mode (#8071) 2024-03-15 18:08:37 +00:00
Mario Pietsch 3342cfc886
Docs: fix doubled list in: Deprecated - What does it mean (#8060) 2024-03-13 22:08:11 +00:00
Mario Pietsch ec0b264426
Docs: add Procedures railroad syntax description (#8061) 2024-03-13 22:07:39 +00:00
Mario Pietsch 8f741e8e67
Docs: deprecate Macro call railroad syntax (#8062) 2024-03-13 22:06:23 +00:00
Mario Pietsch 32bf9fd7a1
Docs - wikitext-macros new v5.3.x syntaxWikitext macros (#8059)
* docs - wikitext-macros new v5.3.x syntax

* fix flexcard macro wrong link
2024-03-13 22:02:56 +00:00
Jeremy Ruston 3657e59a08 Merge branch 'tiddlywiki-com' 2024-03-13 18:03:23 +00:00
Mateusz Wilczek 21a5841aab
Add links to and instructions about Saq's PR Maker in docs (#8068) 2024-03-13 12:17:14 +00:00
Mateusz Wilczek edfd27fa45
Improve filter run prefix docs (#8067) 2024-03-12 20:54:45 +00:00
Jeremy Ruston 0e7d566df7 Add link to demo of TiddlyWiki as a library in other Node.js apps 2024-03-12 17:16:51 +00:00
Mario Pietsch 8481b7d137
Dev edition: change layout to fluid-fixed (#8063) 2024-03-12 08:56:12 +00:00
Mario Pietsch 0fbfdce4b6
Add $:/StoryList to gitignore for tiddlywiki-com branch (#8065) 2024-03-12 08:54:09 +00:00
Jeremy Ruston 9079186b18 Merge branch 'tiddlywiki-com' 2024-03-11 12:15:06 +00:00
Jeremy Ruston e67eaca030 Revert "Docs - wikitext-macros new v5.3.x syntax (#8033)"
This reverts commit 0fb10da8b3.
2024-03-11 12:13:25 +00:00
Jeremy Ruston 1222bed0de Merge branch 'tiddlywiki-com' 2024-03-10 15:11:03 +00:00
Mario Pietsch 78a09fcf56
Docs - download empty button new syntax - v5.3.x (#8034)
* docs - download empty button new syntax - want to keep stuff like this for the time beeing

* use \procedure instead of \define for consistency
2024-03-10 15:07:56 +00:00
Mario Pietsch 0f395ce81d
Add code-body field to doc-styles tiddler (#8054) 2024-03-10 15:07:28 +00:00
Mario Pietsch b28f420430
Some more tv-macros changed to new syntax. Plus adjusted doc tiddlers (#8056) 2024-03-10 15:06:04 +00:00
Mario Pietsch 0b7914785c
Minor adjustments to existing doc tiddlers without changing modified date (#8057) 2024-03-10 15:05:26 +00:00
Jeremy Ruston 967e2b7fef Import variables should not parse with whitespace trim
Fixes #7909
2024-03-10 15:03:52 +00:00
Mario Pietsch 8d36ecd6bc
Add list-links to $:/deprecated tag (#8053) 2024-03-10 14:30:21 +00:00
Mario Pietsch c2b436371b
Docs: tiddler-info-source - change sources tab to new syntax and add link to pr-creator (#8029)
* tiddler-info-source - change sources tab to new syntax and add link to pr-creator

* remove class from plain text elements as requested
2024-03-10 11:08:00 +00:00
Mario Pietsch 24e474bd72
Doc-macros, styles and documentation overview tiddler (#8037) 2024-03-10 10:41:09 +00:00
Mario Pietsch a75d4ca003
Docs - operator macros, templates and filter-run template (#8035) 2024-03-10 10:39:16 +00:00
Mario Pietsch 0fb10da8b3
Docs - wikitext-macros new v5.3.x syntax (#8033) 2024-03-10 10:37:26 +00:00
Mario Pietsch 0202d7b463
Docs - make .from-version and .deprecated-since macros more readable (#8032) 2024-03-10 10:36:49 +00:00
Mario Pietsch b22570a91f
Doc-macros - variable-macros new v5.3.x syntax (#8031)
* doc-macros - variable-macros new v5.3.x syntax

* change modified back to old value
2024-03-10 10:35:31 +00:00
oeyoews 00bd6f8ee8
Remove unnecessary prefix field for highlight plugin (#8048) 2024-03-09 15:45:38 +00:00
Jeremy Ruston 43a2399698 Merge branch 'tiddlywiki-com' 2024-03-09 14:49:55 +00:00
Télumire 35d1609a2b
Add a warning for potential image map scaling issues + responsive alternative with SVG (#8044)
* Add a warning for potential image map scaling issues + alternative with SVG

* Update ImageWidget.tid

fix phrasing
2024-03-09 14:39:15 +00:00
Jeremy Ruston a90b1dbb49 Docs for bags and recipes
Prompted by https://talk.tiddlywiki.org/t/whats-a-bag-and-whats-a-tiddlywebadaptor/9278
2024-03-09 14:24:42 +00:00
Jeremy Ruston 72c4b92a4c Move some docs tiddlers to the correct directories 2024-03-09 14:23:45 +00:00
Simon Huber bf9eafbad9
Update draggable.js - fix the call to updateDomNodeClasses (#8045)
* Update draggable.js - rename updateDomNodeClasses to assignDomNodeClasses

If I'm not wrong then the "updateDomNodeClasses" is unused and the "assignDomNodeClasses" is missing

This renames "updateDomNodeClasses" to "assignDomNodeClasses"

* Use "updateDomNodeClasses"
2024-03-09 10:00:27 +00:00
Mario Pietsch 28791287b2
Add sha256() function to $tw.utils (#8043) 2024-03-08 17:34:30 +00:00
Mario Pietsch 9082f36008
Docs: Add example for sha256 operator (#8042) 2024-03-08 17:29:17 +00:00
Jeremy Ruston e64aa6c8f9 Remove accidentally committed dependencies
Fixes #8040
2024-03-07 08:24:51 +00:00
lin onetwo 6f9cabd352
DevDocs: about modern frameworks in TiddlyWiki (#8027)
* docs: abount modern frameworks

(cherry picked from commit 783547bac2d1bfaa20def3eeda0dc10b6b465d8d)

* docs: modified time

(cherry picked from commit c8db907fe273a414768f5292f61986800e092dfe)
2024-03-06 17:35:42 +00:00
Jeremy Ruston 69e828fc30 Fix csvtiddlers macro crash with missing tiddlers
Fixes #8039
2024-03-06 08:36:37 +00:00
Jeremy Ruston 7d25b13970 Merge branch 'tiddlywiki-com' 2024-03-04 14:13:41 +00:00
lin onetwo bede60d362
Feat: New icon for default layout (#8020)
* feat: icon for default layout

* feat: new icon for default layout

* Update default-layout.tid

* Update default-layout.tid

* Update LayoutSwitcher.tid

* Update PageTemplate.tid
2024-03-04 11:38:29 +00:00
TonyM f02fafe365
Update RefreshThrottling.tid (#8024)
Change word "preciously" to "previously" as I believe was intend.
2024-03-02 20:03:59 +00:00
Mario Pietsch 4fba206606
move tip to the end of the tiddler so it does not distract reading (#8019)
* move tip to the end of the tiddler so it does not distract reading

* reset modified
2024-02-29 19:26:19 +00:00
Jeremy Ruston 070327cb57 Include $:/tags/Macro on core macros for backwards compatibility
This avoids breaking existing code that expects to be able to import the core macros with just $:/tags/Macro

@pmario - I suggest that future updates use the same approach

Thanks to @ericshulman for reporting the problem
2024-02-29 12:39:41 +00:00
Jeremy Ruston 755a09be10 Tour plugin: Fix selector for "Recent" tab button 2024-02-29 09:43:38 +00:00
Bram Chen 9d874befa4
Update chinese language files (#8016)
* Add chinese captions for new emergency tiddlers download button
2024-02-28 18:05:22 +00:00
Jeremy Ruston f1effdd2cd Merge branch 'tiddlywiki-com' 2024-02-28 18:04:35 +00:00
Jeremy Ruston 5b2d35e8d1 Revert "Update backtranscludes.tid (#8010)"
This reverts commit 32de6eca22.
2024-02-28 18:04:16 +00:00
Jeremy Ruston a75fd2a64a Remove forced error in accidentally left in #7966
Thanks @pmario
2024-02-28 12:01:42 +00:00
catter-fly 4ae6f1ffd4
Adjusting saving w/r/t FireFox (#7669) 2024-02-28 11:38:00 +00:00
lin onetwo 32de6eca22
Update backtranscludes.tid (#8010)
* Update backtranscludes.tid

(cherry picked from commit dbce31764937e90ec0d678a29e426b22eacb122b)

* from-version 5.3.4
2024-02-26 14:33:17 +00:00
Xavier Cazin df4dfc5a9e Allow ")" to be part of pragmas default values
by editing matchRegExp in wiki pragma rules for
macro, parameters, function, procedure and widget definitions
2023-10-01 19:06:09 +02:00
Xavier Cazin 116e6d55a2 Merge branch 'master' of github.com:Jermolene/TiddlyWiki5 2023-10-01 18:54:58 +02:00
Xavier Cazin 1e0345c351 Merge remote-tracking branch 'upstream/master' 2023-06-25 15:45:21 +02:00
Xavier Cazin 151e605586 Better fr-FR description of the subtitle and footer core fields 2023-06-25 10:47:38 +02:00
Xavier Cazin c3ff22447b fr-FR addition of the --commands help file 2023-06-25 10:43:08 +02:00
Xavier Cazin ccdae14380 fr-FR translation of Layout Switcher strings 2023-06-25 10:35:47 +02:00
Xavier Cazin 69cfdf3e2f fr-FR additions and corrections of core field descriptions 2023-06-25 10:29:03 +02:00
Xavier Cazin 6090bd0324 fr-FR translation of the error string related to text nodes in Story View interaction 2023-06-25 10:17:01 +02:00
Xavier Cazin f9860d51c0 fr-FR translation of error strings related to the deserialise operator 2023-06-25 09:54:18 +02:00
Xavier Cazin df6468e387 fr-FR translation for network activity button 2023-06-25 09:42:44 +02:00
126 changed files with 2159 additions and 2639 deletions

View File

@ -0,0 +1,7 @@
title: $:/core/images/default-layout
tags: $:/tags/Image
\parameters (size:"22pt")
<svg width=<<size>> height=<<size>> class="tc-image-default-layout tc-image-button" viewBox="0 0 128 128">
<path d="M71.93 72A8.07 8.07 0 0 1 80 80.07v7.86A8.071 8.071 0 0 1 71.93 96H8.07A8.067 8.067 0 0 1 0 87.93v-7.86A8.072 8.072 0 0 1 8.07 72h63.86Zm0 32a8.07 8.07 0 0 1 8.07 8.07v7.86a8.071 8.071 0 0 1-8.07 8.07H8.07A8.067 8.067 0 0 1 0 119.93v-7.86A8.072 8.072 0 0 1 8.07 104h63.86Zm0-104A8.068 8.068 0 0 1 80 8.07v47.86A8.073 8.073 0 0 1 71.93 64H8.07A8.07 8.07 0 0 1 0 55.93V8.07A8.072 8.072 0 0 1 8.07 0h63.86Zm48 0c2.14 0 4.193.85 5.706 2.364A8.067 8.067 0 0 1 128 8.07v111.86c0 2.14-.85 4.193-2.364 5.706A8.067 8.067 0 0 1 119.93 128H96.07c-2.14 0-4.193-.85-5.706-2.364A8.067 8.067 0 0 1 88 119.93V8.07c0-2.14.85-4.193 2.364-5.706A8.067 8.067 0 0 1 96.07 0h23.86ZM116 24h-16a3.995 3.995 0 0 0-2.828 1.172 3.995 3.995 0 0 0 0 5.656A3.995 3.995 0 0 0 100 32h16a3.995 3.995 0 0 0 2.828-1.172 3.995 3.995 0 0 0 0-5.656A3.995 3.995 0 0 0 116 24Z"/>
</svg>

View File

@ -43,7 +43,9 @@ Saves individual tiddlers in their raw text or binary format to the specified fi
directory: path.resolve(self.commander.outputPath),
pathFilters: [filenameFilter],
wiki: wiki,
fileInfo: {}
fileInfo: {
overwrite: true
}
});
if(self.commander.verbose) {
console.log("Saving \"" + title + "\" to \"" + fileInfo.filepath + "\"");

View File

@ -14,12 +14,9 @@ Filter operators for cryptography, using the Stanford JavaScript library
exports.sha256 = function(source,operator,options) {
var results = [],
length = parseInt(operator.operand,10) || 20,
sha256 = function(text) {
return $tw.sjcl.codec.hex.fromBits($tw.sjcl.hash.sha256.hash(text)).substr(0,length);
};
length = parseInt(operator.operand,10) || 20;
source(function(tiddler,title) {
results.push(sha256(title));
results.push($tw.utils.sha256(title,{length: length}));
});
return results;
};

View File

@ -202,7 +202,7 @@ Extended filter operators to manipulate the current list.
}
if(resultsIndex !== -1) {
i = i + step;
nextOperandIndex = (i < opLength ? i : i - opLength);
nextOperandIndex = (i < opLength ? i : i % opLength);
if(operands.length > 1) {
results.splice(resultsIndex,1,operands[nextOperandIndex]);
} else {

View File

@ -35,9 +35,11 @@ exports.run = function(filter,format) {
// Collect all the fields
for(t=0;t<tiddlers.length; t++) {
tiddler = this.wiki.getTiddler(tiddlers[t]);
for(f in tiddler.fields) {
if(fields.indexOf(f) === -1) {
fields.push(f);
if(tiddler) {
for(f in tiddler.fields) {
if(fields.indexOf(f) === -1) {
fields.push(f);
}
}
}
}
@ -60,8 +62,10 @@ exports.run = function(filter,format) {
for(var t=0;t<tiddlers.length; t++) {
row = [];
tiddler = this.wiki.getTiddler(tiddlers[t]);
for(f=0; f<fields.length; f++) {
row.push(quoteAndEscape(tiddler ? tiddler.getFieldString(fields[f]) || "" : ""));
if(tiddler) {
for(f=0; f<fields.length; f++) {
row.push(quoteAndEscape(tiddler ? tiddler.getFieldString(fields[f]) || "" : ""));
}
}
output.push(row.join(","));
}

View File

@ -35,7 +35,7 @@ Instantiate parse rule
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /\\(function|procedure|widget)\s+([^(\s]+)\((\s*([^)]*))?\)(\s*\r?\n)?/mg;
this.matchRegExp = /\\(function|procedure|widget)\s+([^(\s]+)\((\s*(.*))\)(\s*\r?\n)?/mg;
};
/*
@ -94,4 +94,4 @@ exports.parse = function() {
};
})();

View File

@ -27,7 +27,7 @@ Instantiate parse rule
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /\\define\s+([^(\s]+)\(\s*([^)]*)\)(\s*\r?\n)?/mg;
this.matchRegExp = /\\define\s+([^(\s]+)\(\s*(.*)\)(\s*\r?\n)?/mg;
};
/*

View File

@ -26,7 +26,7 @@ Instantiate parse rule
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /\\parameters\s*\(([^)]*)\)(\s*\r?\n)?/mg;
this.matchRegExp = /\\parameters\s*\((.*)\)(\s*\r?\n)?/mg;
};
/*

View File

@ -140,6 +140,11 @@ function sendResponse(request,response,statusCode,headers,data,encoding) {
return;
}
}
} else {
// RFC 7231, 6.1. Overview of Status Codes:
// Browser clients may cache 200, 203, 204, 206, 300, 301,
// 404, 405, 410, 414, and 501 unless given explicit cache controls
headers["Cache-Control"] = headers["Cache-Control"] || "no-store";
}
/*
If the gzip=yes is set, check if the user agent permits compression. If so,

View File

@ -81,6 +81,8 @@ exports.startup = function() {
deferredChanges = Object.create(null);
$tw.hooks.invokeHook("th-page-refreshed");
}
var throttledRefresh = $tw.perf.report("throttledRefresh",refresh);
// Add the change event handler
$tw.wiki.addEventListener("change",$tw.perf.report("mainRefresh",function(changes) {
// Check if only tiddlers that are throttled have changed
@ -101,7 +103,7 @@ exports.startup = function() {
if(isNaN(timeout)) {
timeout = THROTTLE_REFRESH_TIMEOUT;
}
timerId = setTimeout(refresh,timeout);
timerId = setTimeout(throttledRefresh,timeout);
$tw.utils.extend(deferredChanges,changes);
} else {
$tw.utils.extend(deferredChanges,changes);

View File

@ -56,7 +56,7 @@ exports.startup = function() {
return;
}
// Initialise the document
srcDocument.write("<html><head></head><body class='tc-body tc-single-tiddler-window'></body></html>");
srcDocument.write("<!DOCTYPE html><head></head><body class='tc-body tc-single-tiddler-window'></body></html>");
srcDocument.close();
srcDocument.title = windowTitle;
srcWindow.addEventListener("beforeunload",function(event) {

View File

@ -283,7 +283,7 @@ exports.httpRequest = function(options) {
// Set up the state change handler
request.onreadystatechange = function() {
if(this.readyState === 4) {
if(this.status === 200 || this.status === 201 || this.status === 204) {
if(this.status >= 200 && this.status < 300) {
// Success!
options.callback(null,this[returnProp],this);
return;

View File

@ -316,11 +316,13 @@ Options include:
pathFilters: optional array of filters to be used to generate the base path
wiki: optional wiki for evaluating the pathFilters
fileInfo: an existing fileInfo object to check against
fileInfo.overwrite: if true, turns off filename clash numbers (defaults to false)
*/
exports.generateTiddlerFilepath = function(title,options) {
var directory = options.directory || "",
extension = options.extension || "",
originalpath = (options.fileInfo && options.fileInfo.originalpath) ? options.fileInfo.originalpath : "",
overwrite = options.fileInfo && options.fileInfo.overwrite || false,
filepath;
// Check if any of the pathFilters applies
if(options.pathFilters && options.wiki) {
@ -381,19 +383,20 @@ exports.generateTiddlerFilepath = function(title,options) {
filepath += char.charCodeAt(0).toString();
});
}
// Add a uniquifier if the file already exists
var fullPath, oldPath = (options.fileInfo) ? options.fileInfo.filepath : undefined,
// Add a uniquifier if the file already exists (default)
var fullPath = path.resolve(directory, filepath + extension);
if (!overwrite) {
var oldPath = (options.fileInfo) ? options.fileInfo.filepath : undefined,
count = 0;
do {
fullPath = path.resolve(directory,filepath + (count ? "_" + count : "") + extension);
if(oldPath && oldPath == fullPath) {
break;
}
count++;
} while(fs.existsSync(fullPath));
do {
fullPath = path.resolve(directory,filepath + (count ? "_" + count : "") + extension);
if(oldPath && oldPath == fullPath) break;
count++;
} while(fs.existsSync(fullPath));
}
// If the last write failed with an error, or if path does not start with:
// the resolved options.directory, the resolved wikiPath directory, the wikiTiddlersPath directory,
// or the 'originalpath' directory, then $tw.utils.encodeURIComponentExtended() and resolve to tiddler directory.
// or the 'originalpath' directory, then $tw.utils.encodeURIComponentExtended() and resolve to options.directory.
var writePath = $tw.hooks.invokeHook("th-make-tiddler-path",fullPath,fullPath),
encode = (options.fileInfo || {writeError: false}).writeError == true;
if(!encode) {

View File

@ -819,6 +819,15 @@ exports.hashString = function(str) {
},0);
};
/*
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 || {}
return sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(str)).substr(0,options.length || 64);
}
/*
Base64 utility functions that work in either browser or Node.js
*/
@ -922,7 +931,7 @@ IE does not have sign function
*/
exports.sign = Math.sign || function(x) {
x = +x; // convert to a number
if (x === 0 || isNaN(x)) {
if(x === 0 || isNaN(x)) {
return x;
}
return x > 0 ? 1 : -1;
@ -935,7 +944,7 @@ exports.strEndsWith = function(str,ending,position) {
if(str.endsWith) {
return str.endsWith(ending,position);
} else {
if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > str.length) {
if(typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > str.length) {
position = str.length;
}
position -= ending.length;

View File

@ -37,6 +37,7 @@ Compute the internal state of the widget
DeleteFieldWidget.prototype.execute = function() {
this.actionTiddler = this.getAttribute("$tiddler",this.getVariable("currentTiddler"));
this.actionField = this.getAttribute("$field",null);
this.actionTimestamp = this.getAttribute("$timestamp","yes") === "yes";
};
/*
@ -69,11 +70,15 @@ DeleteFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {
$tw.utils.each(this.attributes,function(attribute,name) {
if(name.charAt(0) !== "$" && name !== "title") {
removeFields[name] = undefined;
hasChanged = true;
if(name in tiddler.fields) {
hasChanged = true;
}
}
});
if(hasChanged) {
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),tiddler,removeFields,this.wiki.getModificationFields()));
var creationFields = this.actionTimestamp ? this.wiki.getCreationFields() : {};
var modificationFields = this.actionTimestamp ? this.wiki.getModificationFields() : {};
this.wiki.addTiddler(new $tw.Tiddler(creationFields,tiddler,removeFields,modificationFields));
}
}
return true; // Action was invoked

View File

@ -119,7 +119,7 @@ DraggableWidget.prototype.refresh = function(changedTiddlers) {
return true;
} else {
if(changedAttributes["class"]) {
this.assignDomNodeClasses();
this.updateDomNodeClasses();
}
this.assignAttributes(this.domNodes[0],{
changedAttributes: changedAttributes,
@ -132,4 +132,4 @@ DraggableWidget.prototype.refresh = function(changedTiddlers) {
exports.draggable = DraggableWidget;
})();
})();

View File

@ -49,7 +49,7 @@ ImportVariablesWidget.prototype.execute = function(tiddlerList) {
this.tiddlerList = tiddlerList || this.wiki.filterTiddlers(this.filter,this);
// Accumulate the <$set> widgets from each tiddler
$tw.utils.each(this.tiddlerList,function(title) {
var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true, configTrimWhiteSpace:true});
var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true, configTrimWhiteSpace:false});
if(parser) {
var parseTreeNode = parser.tree[0];
while(parseTreeNode && ["setvariable","set","parameters"].indexOf(parseTreeNode.type) !== -1) {

View File

@ -155,8 +155,6 @@ LinkWidget.prototype.renderLink = function(parent,nextSibling) {
};
LinkWidget.prototype.handleClickEvent = function(event) {
// Force an error to try out the Red Screen Of Embarrassment
var something = Everything;
// Send the click on its way as a navigate event
var bounds = this.domNodes[0].getBoundingClientRect();
this.dispatchEvent({

View File

@ -3,7 +3,7 @@ title: $:/core/save/all-external-js
\whitespace trim
\import [subfilter{$:/core/config/GlobalImportFilter}]
\define saveTiddlerFilter()
[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/boot/boot.css]] -[is[system]type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
\end
<!-- Important: core library is provided by serving URI encoded $:/core/templates/tiddlywiki5.js -->

View File

@ -3,7 +3,7 @@ title: $:/core/save/offline-external-js
\whitespace trim
\import [subfilter{$:/core/config/GlobalImportFilter}]
\define saveTiddlerFilter()
[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/plugins/tiddlywiki/filesystem]] -[[$:/plugins/tiddlywiki/tiddlyweb]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/plugins/tiddlywiki/filesystem]] -[[$:/plugins/tiddlywiki/tiddlyweb]] -[[$:/boot/boot.css]] -[is[system]type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
\end
\define defaultCoreURL() tiddlywikicore-$(version)$.js
<$let coreURL={{{ [[coreURL]is[variable]then<coreURL>else<defaultCoreURL>] }}}>

View File

@ -2,6 +2,6 @@ title: $:/core/save/all
\import [subfilter{$:/core/config/GlobalImportFilter}]
\define saveTiddlerFilter()
[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/boot/boot.css]] -[is[system]type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
\end
{{$:/core/templates/tiddlywiki5.html}}

View File

@ -1,6 +1,6 @@
title: $:/core/save/empty
\define saveTiddlerFilter()
[is[system]] -[prefix[$:/state/popup/]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]
[is[system]] -[prefix[$:/state/popup/]] -[[$:/boot/boot.css]] -[is[system]type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]
\end
{{$:/core/templates/tiddlywiki5.html}}

View File

@ -1,7 +1,7 @@
title: $:/core/save/lazy-all
\define saveTiddlerFilter()
[is[system]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] [is[tiddler]type[application/javascript]] +[sort[title]]
[is[system]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[is[system]type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] [is[tiddler]type[application/javascript]] +[sort[title]]
\end
\define skinnySaveTiddlerFilter()
[!is[system]] -[type[application/javascript]]

View File

@ -1,7 +1,7 @@
title: $:/core/save/lazy-images
\define saveTiddlerFilter()
[is[tiddler]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] -[!is[system]is[image]] +[sort[title]]
[is[tiddler]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[is[system]type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] -[!is[system]is[image]] +[sort[title]]
\end
\define skinnySaveTiddlerFilter()
[!is[system]is[image]]

View File

@ -1,12 +1,18 @@
title: $:/core/ui/EditTemplate/controls
tags: $:/tags/EditTemplate
\define config-title()
$:/config/EditToolbarButtons/Visibility/$(listItem)$
\end
\define config-title() $:/config/EditToolbarButtons/Visibility/$(listItem)$
\whitespace trim
<div class="tc-tiddler-title tc-tiddler-edit-title">
<$view field="title"/>
<span class="tc-tiddler-controls tc-titlebar"><$list filter="[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]" variable="listItem"><$let tv-config-toolbar-class={{{ [enlist<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]] +[join[ ]]}}}><$reveal type="nomatch" state=<<config-title>> text="hide"><$transclude tiddler=<<listItem>>/></$reveal></$let></$list></span>
<div style="clear: both;"></div>
<$view field="title"/>
<span class="tc-tiddler-controls tc-titlebar">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]" variable="listItem">
<$let tv-config-toolbar-class={{{ [enlist<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]] +[join[ ]] }}}>
<$reveal type="nomatch" state=<<config-title>> text="hide">
<$transclude $tiddler=<<listItem>>/>
</$reveal>
</$let>
</$list>
</span>
<div style="clear: both;"></div>
</div>

View File

@ -0,0 +1,5 @@
title: $:/core/ui/KeyboardShortcuts/refresh
tags: $:/tags/KeyboardShortcut
key: ((refresh))
<$action-sendmessage $message="tm-browser-refresh"/>

View File

@ -1,17 +1,14 @@
title: $:/core/ui/PageTemplate/pagecontrols
\whitespace trim
\define config-title()
$:/config/PageControlButtons/Visibility/$(listItem)$
\end
\function config-title() [[$:/config/PageControlButtons/Visibility/$(listItem)$]substitute[]]
<div class="tc-page-controls">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]" variable="listItem">
<$set name="hidden" value=<<config-title>>>
<$list filter="[<hidden>!text[hide]]" storyview="pop" variable="ignore">
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">
<$transclude tiddler=<<listItem>> mode="inline"/>
</$set>
</$list>
</$set>
</$list>
</div>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]" variable="listItem">
<$list filter="[<config-title>!text[hide]]" storyview="pop" variable="ignore">
<$let tv-config-toolbar-class={{{ [enlist<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]] +[join[ ]] }}}>
<$transclude $tiddler=<<listItem>> $mode="inline"/>
</$let>
</$list>
</$list>
</div>

View File

@ -4,48 +4,41 @@ caption: {{$:/core/images/down-arrow}} {{$:/language/Buttons/More/Caption}}
description: {{$:/language/Buttons/More/Hint}}
\whitespace trim
\define config-title()
$:/config/PageControlButtons/Visibility/$(listItem)$
\end
<$button popup=<<qualify "$:/state/popup/more">> tooltip={{$:/language/Buttons/More/Hint}} aria-label={{$:/language/Buttons/More/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/down-arrow}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/More/Caption}}/>
</span>
</$list>
</$button><$reveal state=<<qualify "$:/state/popup/more">> type="popup" position="below" animate="yes">
<div class="tc-drop-down">
<$set name="tv-config-toolbar-icons" value="yes">
<$set name="tv-config-toolbar-text" value="yes">
<$set name="tv-config-toolbar-class" value="tc-btn-invisible">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]] -[[$:/core/ui/Buttons/more-page-actions]]" variable="listItem">
<$reveal type="match" state=<<config-title>> text="hide">
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">
<$transclude tiddler=<<listItem>> mode="inline"/>
</$set>
</$reveal>
</$list>
</$set>
</$set>
</$set>
</div>
\define config-title() $:/config/PageControlButtons/Visibility/$(listItem)$
<$button popup=<<qualify "$:/state/popup/more">>
tooltip={{$:/language/Buttons/More/Hint}}
aria-label={{$:/language/Buttons/More/Caption}}
class=<<tv-config-toolbar-class>>
selectedClass="tc-selected"
>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/down-arrow}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/More/Caption}}/>
</span>
</$list>
</$button>
<$reveal state=<<qualify "$:/state/popup/more">> type="popup" position="below" animate="yes">
<div class="tc-drop-down">
<$set name="tv-config-toolbar-icons" value="yes">
<$set name="tv-config-toolbar-text" value="yes">
<$set name="tv-config-toolbar-class" value="tc-btn-invisible">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]] -[[$:/core/ui/Buttons/more-page-actions]]"
variable="listItem"
>
<$reveal type="match" state=<<config-title>> text="hide">
<$set name="tv-config-toolbar-class"
filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]"
>
<$transclude tiddler=<<listItem>> mode="inline"/>
</$set>
</$reveal>
</$list>
</$set>
</$set>
</$set>
</div>
</$reveal>

View File

@ -1,7 +1,7 @@
title: $:/core/ui/PageTemplate
name: {{$:/language/PageTemplate/Name}}
description: {{$:/language/PageTemplate/Description}}
icon: $:/core/images/layout-button
icon: $:/core/images/default-layout
code-body: yes
\whitespace trim

View File

@ -2,31 +2,38 @@ title: $:/core/ui/ViewTemplate/title
tags: $:/tags/ViewTemplate
\whitespace trim
\define title-styles()
fill:$(foregroundColor)$;
\end
\define title-styles() fill:$(foregroundColor)$;
<div class="tc-tiddler-title">
<div class="tc-titlebar">
<span class="tc-tiddler-controls">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] :filter[lookup[$:/config/ViewToolbarButtons/Visibility/]!match[hide]]" storyview="pop" variable="listItem"><$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]"><$transclude tiddler=<<listItem>>/></$set></$list>
</span>
<$set name="tv-wikilinks" value={{$:/config/Tiddlers/TitleLinks}}>
<$link>
<$list filter="[<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] +[!is[blank]]" variable="ignore">
<$let foregroundColor={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}>
<span class="tc-tiddler-title-icon" style=<<title-styles>>>
{{||$:/core/ui/TiddlerIcon}}
</span>
</$let>
</$list>
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateTitleFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/title/default]] }}} />
</$link>
</$set>
</div>
<$reveal type="nomatch" text="" default="" state=<<tiddlerInfoState>> class="tc-tiddler-info tc-popup-handle" animate="yes" retain="yes">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TiddlerInfoSegment]!has[draft.of]] [[$:/core/ui/TiddlerInfo]]" variable="listItem"><$transclude tiddler=<<listItem>> mode="block"/></$list>
</$reveal>
<div class="tc-titlebar">
<span class="tc-tiddler-controls">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] :filter[lookup[$:/config/ViewToolbarButtons/Visibility/]!match[hide]]"
storyview="pop"
variable="listItem"
>
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">
<$transclude tiddler=<<listItem>>/>
</$set>
</$list>
</span>
<$set name="tv-wikilinks" value={{$:/config/Tiddlers/TitleLinks}}>
<$link>
<$list filter="[<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] +[!is[blank]]"
variable="ignore"
>
<$let foregroundColor={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}>
<span class="tc-tiddler-title-icon" style=<<title-styles>>>
{{||$:/core/ui/TiddlerIcon}}
</span>
</$let>
</$list>
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateTitleFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/title/default]] }}} />
</$link>
</$set>
</div>
<$reveal tag="div" type="nomatch" text="" default="" state=<<tiddlerInfoState>> class="tc-tiddler-info tc-popup-handle" animate="yes" retain="yes">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TiddlerInfoSegment]!has[draft.of]] [[$:/core/ui/TiddlerInfo]]" variable="listItem">
<$transclude tiddler=<<listItem>> mode="block"/>
</$list>
</$reveal>
</div>

View File

@ -4,49 +4,41 @@ caption: {{$:/core/images/down-arrow}} {{$:/language/Buttons/More/Caption}}
description: {{$:/language/Buttons/More/Hint}}
\whitespace trim
\define config-title()
$:/config/ViewToolbarButtons/Visibility/$(listItem)$
\end
<$button popup=<<qualify "$:/state/popup/more">> tooltip={{$:/language/Buttons/More/Hint}} aria-label={{$:/language/Buttons/More/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/down-arrow}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/More/Caption}}/>
</span>
</$list>
\define config-title() $:/config/ViewToolbarButtons/Visibility/$(listItem)$
<$button popup=<<qualify "$:/state/popup/more">>
tooltip={{$:/language/Buttons/More/Hint}}
aria-label={{$:/language/Buttons/More/Caption}}
class=<<tv-config-toolbar-class>>
selectedClass="tc-selected"
>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/down-arrow}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/More/Caption}}/>
</span>
</$list>
</$button>
<$reveal state=<<qualify "$:/state/popup/more">> type="popup" position="belowleft" animate="yes">
<div class="tc-drop-down">
<$set name="tv-config-toolbar-icons" value="yes">
<$set name="tv-config-toolbar-text" value="yes">
<$set name="tv-config-toolbar-class" value="tc-btn-invisible">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] -[[$:/core/ui/Buttons/more-tiddler-actions]]" variable="listItem">
<$reveal type="match" state=<<config-title>> text="hide">
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">
<$transclude tiddler=<<listItem>> mode="inline"/>
</$set>
</$reveal>
</$list>
</$set>
</$set>
</$set>
</div>
<div class="tc-drop-down">
<$set name="tv-config-toolbar-icons" value="yes">
<$set name="tv-config-toolbar-text" value="yes">
<$set name="tv-config-toolbar-class" value="tc-btn-invisible">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] -[[$:/core/ui/Buttons/more-tiddler-actions]]"
variable="listItem"
>
<$reveal type="match" state=<<config-title>> text="hide">
<$set name="tv-config-toolbar-class"
filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]"
>
<$transclude tiddler=<<listItem>> mode="inline"/>
</$set>
</$reveal>
</$list>
</$set>
</$set>
</$set>
</div>
</$reveal>

View File

@ -35,6 +35,7 @@ new-tiddler: {{$:/language/Buttons/NewTiddler/Hint}}
picture: {{$:/language/Buttons/Picture/Hint}}
preview: {{$:/language/Buttons/Preview/Hint}}
quote: {{$:/language/Buttons/Quote/Hint}}
refresh: {{$:/language/Buttons/Refresh/Hint}}
save-tiddler: {{$:/language/Buttons/Save/Hint}}
save-wiki: {{$:/language/Buttons/SaveWiki/Hint}}
sidebar-search: {{$:/language/Buttons/SidebarSearch/Hint}}

View File

@ -6,4 +6,5 @@ underline: meta-U
new-image: ctrl-I
new-journal: ctrl-J
new-tiddler: ctrl-N
refresh: meta-R
save-wiki: meta-S

View File

@ -6,3 +6,4 @@ underline: ctrl-U
new-image: alt-I
new-journal: alt-J
new-tiddler: alt-N
refresh: ctrl-R

View File

@ -1,5 +1,5 @@
title: $:/core/macros/CSS
tags: $:/tags/Global
tags: $:/tags/Macro $:/tags/Global
\procedure colour(name)
\whitespace trim

View File

@ -1,5 +1,5 @@
title: $:/core/macros/copy-to-clipboard
tags: $:/tags/Global
tags: $:/tags/Macro $:/tags/Global
\whitespace trim

View File

@ -1,5 +1,5 @@
title: $:/core/macros/diff
tags: $:/tags/Global
tags: $:/tags/Macro $:/tags/Global
\whitespace trim

View File

@ -1,167 +1,182 @@
title: $:/core/macros/tag-picker
tags: $:/tags/Global
first-search-filter: [tags[]!is[system]search:title<userInput>sort[]]
second-search-filter: [tags[]is[system]search:title<userInput>sort[]]
tags: tags: $:/tags/Macro $:/tags/Global
first-search-filter: [subfilter<tagListFilter>!is[system]search:title<userInput>sort[]]
second-search-filter: [subfilter<tagListFilter>is[system]search:title<userInput>sort[]]
\procedure get-tagpicker-focus-selector()
\function currentTiddlerCSSEscaped() [<saveTiddler>escapecss[]]
[data-tiddler-title=`$(currentTiddlerCSSEscaped)$`] .tc-add-tag-name input
<!-- first-search-filter and second-search-filter fields are not used here in the code, but they are defined as parameters for keyboard-driven-input macro -->
\whitespace trim
<!-- tf.tagpicker-dropdown-id is needed if several tap-pickers are shown in one tiddler -->
\function tf.tagpicker-dropdown-id()
[<qualify $:/state/popup/tags-auto-complete>]
[[$(saveTiddler)$-[$(tagField)$-$(tagListFilter)$]substitute[]sha256[]] +[join[/]]
\end
\procedure delete-tag-state-tiddlers() <$action-deletetiddler $filter="[<newTagNameTiddler>] [<storeTitle>] [<tagSelectionState>]"/>
\function tf.tagpicker-dropdown-class() [<tf.tagpicker-dropdown-id>sha256[]addprefix[tc-]]
\function tf.get-tagpicker-focus-selector() [<tf.tagpicker-dropdown-class>addprefix[.]] .tc-popup-handle +[join[ ]]
<!-- clean up temporary tiddlers, so the next "pick" starts with a clean input -->
<!-- This could probably be optimized / removed if we would use different temp-tiddlers
(future improvement because keeping track is comlex for humans)
-->
\procedure delete-tag-state-tiddlers()
<$action-deletetiddler $filter="[<newTagNameTiddler>] [<storeTitle>] [<tagSelectionState>]"/>
\end
<!-- trigger __toggle tag__ by keyboard -->
\procedure add-tag-actions()
\whitespace trim
<$let tag=<<tag>>>
<$action-listops $tiddler=<<saveTiddler>> $field=<<tagField>> $subfilter='+[toggle<tag>trim[]]'/>
<$list
filter="[<tag>] :intersection[<saveTiddler>get<tagField>enlist-input[]]"
variable="ignore"
emptyMessage="<<actions>>"
/>
</$let>
<<delete-tag-state-tiddlers>>
<$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
\end
\procedure clear-tags-actions-inner()
\whitespace trim
<$list
filter="[<storeTitle>has[text]] ~[<newTagNameTiddler>has[text]]"
variable="ignore"
emptyMessage="<<cancel-delete-tiddler-actions 'cancel'>>"
>
<$let tag=<<_tf.getTag>> >
<$action-listops $tiddler=<<saveTiddler>> $field=<<tagField>> $subfilter='+[toggle<tag>trim[]]'/>
<% if [<tag>] :intersection[<saveTiddler>get<tagField>enlist-input[]] %>
<!-- tag has been removed - do nothing -->
<% else %>
<<actions>>
<% endif %>
<<delete-tag-state-tiddlers>>
</$list>
<$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
</$let>
\end
<!-- <$action-log /> -->
<!-- ESC key removes the text from the input
The second ESC tries to close the "draft tiddler"
-->
\procedure clear-tags-actions-inner()
<% if [<storeTitle>has[text]] ~[<newTagNameTiddler>has[text]] %>
<<delete-tag-state-tiddlers>>
<% else %>
<<cancel-delete-tiddler-actions "cancel">>
<% endif %>
\end
<!-- triggered by keyboard only -->
\procedure clear-tags-actions()
\whitespace trim
<$let userInput=<<userInput>>>
<$list
filter="[<newTagNameTiddler>get[text]!match<userInput>]"
emptyMessage="<<clear-tags-actions-inner>>"
>
<$let userInput=<<_tf.getUserInput>> >
<!-- this list __cannot__ be transformed to conditional IF. The list variable is used! -->
<$list filter="[<newTagNameTiddler>get[text]!match<userInput>]" >
<$list-empty>
<<clear-tags-actions-inner>>
</$list-empty>
<$action-setfield $tiddler=<<newTagNameTiddler>> text=<<userInput>>/>
<$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
</$list>
</$let>
\end
<!-- similar to add-tag-actions __but__ add-only -->
\procedure add-button-actions()
<$action-listops $tiddler=<<saveTiddler>> $field=<<tagField>> $subfilter="[<tag>trim[]]"/>
<<actions>>
<<delete-tag-state-tiddlers>>
<$action-sendmessage $message="tm-focus-selector" $param=<<get-tagpicker-focus-selector>>/>
<$action-sendmessage $message="tm-focus-selector" $param=<<tf.get-tagpicker-focus-selector>>/>
\end
<!-- <$action-log /> -->
\procedure list-tags(filter, suffix)
\whitespace trim
<$list
filter="[<userInput>minlength{$:/config/Tags/MinLength}limit[1]]"
emptyMessage="<div class='tc-search-results'>{{$:/language/Search/Search/TooShort}}</div>" variable="listItem"
>
<$list filter=<<filter>> variable="tag">
<$let
button-classes=`tc-btn-invisible ${ [<tag>addsuffix<suffix>] -[<tagSelectionState>get[text]] :then[[]] ~tc-tag-button-selected }$`
currentTiddler=<<tag>>
>
{{||$:/core/ui/TagPickerTagTemplate}}
</$let>
<!-- create dropdown list -->
\procedure tag-picker-listTags(filter, suffix)
<$let userInput=<<_tf.getUserInput>> >
<$list filter="[<userInput>minlength{$:/config/Tags/MinLength}limit[1]]"
emptyMessage="<div class='tc-search-results'>{{$:/language/Search/Search/TooShort}}</div>" variable="listItem"
>
<$list filter=<<filter>> variable="tag">
<!-- The buttonClasses filter is used to define tc-tag-button-selected state -->
<!-- tf.get-tagpicker-focus-selector has to be resolved for $:/core/ui/TagPickerTagTemplate,
othwerwise qualify in tf.tagpicker-dropdown-id causes problems -->
<$let currentTiddler=<<tag>>
button-classes=`tc-btn-invisible ${[<tag>addsuffix<suffix>] -[<tagSelectionState>get[text]] :then[[]] ~tc-tag-button-selected }$`
get-tagpicker-focus-selector=`${[<tf.get-tagpicker-focus-selector>]}$`
>
{{||$:/core/ui/TagPickerTagTemplate}}
</$let>
</$list>
</$list>
</$list>
</$let>
\end
<!-- tag-picker-inner is the main function -->
\procedure tag-picker-inner()
\whitespace trim
<div class={{{ [[tc-edit-add-tag]] [<tf.tagpicker-dropdown-class>] +[join[ ]] }}}>
<div class="tc-edit-add-tag-ui">
<span class="tc-add-tag-name tc-small-gap-right">
<$macrocall $name="keyboard-driven-input"
tiddler=<<newTagNameTiddler>>
storeTitle=<<storeTitle>>
refreshTitle=<<refreshTitle>>
selectionStateTitle=<<tagSelectionState>>
inputAcceptActions=<<add-tag-actions>>
inputCancelActions=<<clear-tags-actions>>
tag="input"
placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}}
focusPopup=<<tf.tagpicker-dropdown-id>>
class="tc-edit-texteditor tc-popup-handle"
tabindex=<<tabIndex>>
focus={{{ [{$:/config/AutoFocus}match[tags]then[true]] ~[[false]] }}}
filterMinLength={{$:/config/Tags/MinLength}}
cancelPopups=<<cancelPopups>>
configTiddlerFilter="[[$:/core/macros/tag-picker]]"
/>
</span>
<$button popup=<<tf.tagpicker-dropdown-id>> class="tc-btn-invisible tc-btn-dropdown"
tooltip={{$:/language/EditTemplate/Tags/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Tags/Dropdown/Caption}}
>
{{$:/core/images/down-arrow}}
</$button>
<% if [<storeTitle>has[text]] %>
<$button actions=<<delete-tag-state-tiddlers>> class="tc-btn-invisible tc-small-gap tc-btn-dropdown"
tooltip={{$:/language/EditTemplate/Tags/ClearInput/Hint}} aria-label={{$:/language/EditTemplate/Tags/ClearInput/Caption}}
>
{{$:/core/images/close-button}}
</$button>
<% endif %>
<span class="tc-add-tag-button tc-small-gap-left">
<$let tag=<<_tf.getTag>>>
<$button set=<<newTagNameTiddler>> actions=<<add-button-actions>> >
{{$:/language/EditTemplate/Tags/Add/Button}}
</$button>
</$let>
</span>
</div>
<div class="tc-block-dropdown-wrapper">
<% if [<tf.tagpicker-dropdown-id>has[text]] %>
<div class="tc-block-dropdown tc-block-tags-dropdown">
<$macrocall $name="tag-picker-listTags" filter=<<nonSystemTagsFilter>> suffix="-primaryList" />
<hr>
<$macrocall $name="tag-picker-listTags" filter=<<systemTagsFilter>> suffix="-secondaryList" />
</div>
<% endif %>
</div>
</div>
\end
<!-- prepare all variables for tag-picker keyboard handling -->
\procedure tag-picker(actions, tagField:"tags", tiddler, tagListFilter:"[tags[]]")
\function _tf.getUserInput() [<storeTitle>get[text]]
\function _tf.getTag() [<newTagNameTiddler>get[text]]
<!-- keep those variables because they may "blead" into macros using old syntax -->
<$let
newTagNameInputTiddlerQualified=<<qualify "$:/temp/NewTagName/input">>
newTagNameSelectionTiddlerQualified=<<qualify "$:/temp/NewTagName/selected-item">>
fallbackTarget={{{ [<palette>getindex[tag-background]] }}}
palette={{$:/palette}}
colourA={{{ [<palette>getindex[foreground]] }}}
colourB={{{ [<palette>getindex[background]] }}}
fallbackTarget={{{ [<palette>getindex[tag-background]] }}}
storeTitle={{{ [<newTagNameInputTiddler>!match[]] ~[<newTagNameInputTiddlerQualified>] }}}
saveTiddler={{{ [<tiddler>is[blank]then<currentTiddler>else<tiddler>] }}}
newTagNameTiddler={{{ [[$:/temp/NewTagName]] [<tagField>!match[tags]] +[join[/]] [<qualify>] +[join[]] }}}
storeTitle={{{ [[$:/temp/NewTagName/input]] [<tagField>!match[tags]] +[join[/]] [<qualify>] +[join[]] }}}
newTagNameSelectionTiddlerQualified=<<qualify "$:/temp/NewTagName/selected-item">>
tagSelectionState={{{ [<newTagNameSelectionTiddler>!match[]] ~[<newTagNameSelectionTiddlerQualified>] }}}
tagAutoComplete=<<qualify "$:/state/popup/tags-auto-complete">>
refreshTitle=<<qualify "$:/temp/NewTagName/refresh">>
nonSystemTagsFilter="[tags[]!is[system]search:title<userInput>sort[]]"
systemTagsFilter="[tags[]is[system]search:title<userInput>sort[]]"
>
<div class="tc-edit-add-tag">
<div>
<span class="tc-add-tag-name tc-small-gap-right">
<$transclude
$variable="keyboard-driven-input"
tiddler=<<newTagNameTiddler>>
storeTitle=<<storeTitle>>
refreshTitle=<<refreshTitle>>
selectionStateTitle=<<tagSelectionState>>
inputAcceptActions=<<add-tag-actions>>
inputCancelActions=<<clear-tags-actions>>
tag="input"
placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}}
focusPopup=<<tagAutoComplete>>
class="tc-edit-texteditor tc-popup-handle"
tabindex=<<tabIndex>>
focus={{{ [{$:/config/AutoFocus}match[tags]then[true]] ~[[false]] }}}
filterMinLength={{$:/config/Tags/MinLength}}
cancelPopups=<<cancelPopups>>
configTiddlerFilter="[[$:/core/macros/tag-picker]]"
/>
</span>
<$button popup=<<tagAutoComplete>>
class="tc-btn-invisible tc-btn-dropdown"
tooltip={{$:/language/EditTemplate/Tags/Dropdown/Hint}}
aria-label={{$:/language/EditTemplate/Tags/Dropdown/Caption}}
>
{{$:/core/images/down-arrow}}
</$button>
<$reveal state=<<storeTitle>> type="nomatch" text="">
<$button actions=<<delete-tag-state-tiddlers>>
class="tc-btn-invisible tc-small-gap tc-btn-dropdown"
tooltip={{$:/language/EditTemplate/Tags/ClearInput/Hint}}
aria-label={{$:/language/EditTemplate/Tags/ClearInput/Caption}}
>
{{$:/core/images/close-button}}
</$button>
</$reveal>
<span class="tc-add-tag-button tc-small-gap-left">
<$let tag=<<tag>>>
<$button set=<<newTagNameTiddler>> setTo=""
actions=<<add-button-actions>>
>
{{$:/language/EditTemplate/Tags/Add/Button}}
</$button>
</$let>
</span>
</div>
<div class="tc-block-dropdown-wrapper">
<$reveal state=<<tagAutoComplete>> type="nomatch" text="">
<div class="tc-block-dropdown tc-block-tags-dropdown">
<$let userInput=<<userInput>>>
<$transclude $variable="list-tags" filter=<<nonSystemTagsFilter>> suffix="-primaryList" />
<hr>
<$transclude $variable="list-tags" filter=<<systemTagsFilter>> suffix="-secondaryList" />
</$let>
</div>
</$reveal>
</div>
</div>
</$let>
\end
refreshTitle=<<qualify "$:/temp/NewTagName/refresh">>
\procedure tag-picker(actions, tagField:"tags")
\function userInput() [<storeTitle>get[text]]
\function tag() [<newTagNameTiddler>get[text]]
\whitespace trim
<$let
saveTiddler=<<currentTiddler>>
palette={{$:/palette}}
qualified=<<qualify "$:/temp/NewTagName">>
newTagNameTiddler={{{ [<newTagNameTiddler>!match[]] ~[<qualified>] }}}
nonSystemTagsFilter="[subfilter<tagListFilter>!is[system]search:title<userInput>sort[]]"
systemTagsFilter="[subfilter<tagListFilter>is[system]search:title<userInput>sort[]]"
cancelPopups="yes"
>
<$transclude $variable="tag-picker-inner" />
<$macrocall $name="tag-picker-inner"/>
</$let>
\end
\end

View File

@ -21,7 +21,9 @@ color:$(foregroundColor)$;
>
<<__actions__>>
<$transclude tiddler=<<__icon__>>/>
<$view tiddler=<<__tag__>> field="title" format="text" />
<span class={{{ [<__tag__>is[missing]then[tc-tag-missing]else[tc-tag-exists]] }}}>
<$view tiddler=<<__tag__>> field="title" format="text" />
</span>
</$element-tag$>
</$let>
\end

View File

@ -16,6 +16,7 @@ Welcome to the developer documentation for TiddlyWiki (https://tiddlywiki.com/).
** [[Adding Babel Polyfill to TiddlyWiki]]
** [[TiddlyWiki Drag and Drop Interoperability]]
** [[Javascript Widget Tutorial]]
** [[Using TiddlyWiki as a library in another Node.js application]]
* The original developer documentation from https://tiddlywiki.com:
** [[TiddlyWiki for Developers]]
** [[TiddlyWiki Coding Style Guidelines]]

View File

@ -1,5 +1,5 @@
created: 20190202035524804
modified: 20221029161501848
modified: 20240302110658300
tags:
title: Javascript Widget Tutorial
type: text/vnd.tiddlywiki
@ -9,21 +9,23 @@ This tutorial provides step-by-step, interactive examples of how to write code f
Intended audience:
# Those who know tiddlywiki well and know programming and javascript and want to write their own widget. I don't make any effort to explain javascript here. For that you will need other resources.
# Those who know tiddlywiki well and know programming and javascript and want to write their own widget.
# Those who know tiddlywiki well and don't know javascript, but want to understand more about how tiddlywiki works. You should be able to skim through and interact with the demos and learn something.
!The tutorial
*[[Undefined widget tutorial]]
*[[Do nothing widget tutorial]]
*[[Hello World widget tutorial]]
*[[Widget refresh tutorial part I]]
*[[Widget refresh tutorial part II]]
*[[Widget refresh tutorial part III]]
*[[Widget attributes tutorial part I]]
*[[Widget attributes tutorial part II]]
*[[Child widgets tutorial]]
We don't make any effort to explain javascript here. For that you will need other resources, like [[MDN|https://developer.mozilla.org/en-US/docs/Web/JavaScript]].
! Notes
!! The tutorial
* [[Undefined widget tutorial]]
* [[Do nothing widget tutorial]]
* [[Hello World widget tutorial]]
* [[Widget refresh tutorial part I]]
* [[Widget refresh tutorial part II]]
* [[Widget refresh tutorial part III]]
* [[Widget attributes tutorial part I]]
* [[Widget attributes tutorial part II]]
* [[Child widgets tutorial]]
!! Notes
tiddlywiki doesn't support dynamically reloading javascript. If you change a javascript tiddler, then you need to save and reload the wiki before the changes will take affect.
@ -31,7 +33,11 @@ To avoid the need for such reloads, the excellent [[innerwiki plugin|https://tid
Without the need for reloads, a tiddlywiki instance with the [[innerwiki plugin|https://tiddlywiki.com/prerelease/plugins/tiddlywiki/innerwiki/]] installed works great as a playground for interacting with tiddlywiki javascript.
! Other documentation on writing TW widgets
!! Other documentation on writing TW widgets
*WidgetModules
*[[Widgets]]
* WidgetModules
* [[Widgets]]
!! Full API doc
[[Github Pages of TW5-Typed|https://tiddly-gittly.github.io/TW5-Typed/api/classes/modules_widgets.widget]]

View File

@ -1,5 +1,5 @@
modified: 20160305222940000
created: 20160111034749658
modified: 20240302110735646
title: Using ES2016 for Writing Plugins
type: text/vnd.tiddlywiki
@ -7,7 +7,15 @@ With the advent of ES2015 (also known as ES6) and the availability of [[Babel.js
Please understand how the PluginMechanism works since this is all about writing a plugin using Babel to compile the output that will be included in the final TiddlyWiki (for example [[TiddlyWiki on Node.js]]).
!! Installing and Configuring Babel
!! Use a framework
It is recommended to use develop toolkit managed by community. For example,
# [[Modern.TiddlyDev|https://tiddly-gittly.github.io/Modern.TiddlyDev/]]
They are known as "~JavaScript Meta-Framework". With them, you can start developing in a few minutes, without hours of configuration and debugging the build steps.
!! Installing and Configuring Babel by yourself
You can install Babel using
@ -33,7 +41,9 @@ Inside your plugin project edit the file `.babelrc` and enter the following:
<<.tip "I found it easier to manage my plugins as if they were ''npm'' modules complete with a `package.json` that compiles the output via `npm run build`. See [[npm-scripts documentation|https://docs.npmjs.com/misc/scripts]] for details.">>
!! Compiling the Output
Another benefit of using such a "Meta-Framework" is that you can easily maintain your configuration, you will find it difficult to upgrade those config files after several months.
!!! Compiling the Output
Pick a folder to store the ES2015 JavaScript and a folder to output the TiddlyWiki ready JavaScript. In this example I will use `src` and `lib` respectively. With Babel installed and working I can compile all the JavaScript in the `src` folder to the `lib` folder by running this command:
@ -43,7 +53,7 @@ $ babel src -d lib
<<.warning "Babel will //not// copy over non-JavaScript files. It is up to the developer to include all the supporting files themselves. Babel only converts the ~JavaScript files (ending in `.js`) from the `src` folder to the `lib` folder.">>
!! Imports and Exports
!!! Imports and Exports
In a plugin written pre-ES2015 one would `require` a module through TiddlyWiki like so:
@ -71,7 +81,7 @@ export { MyWidget as mywidget };
It is important to understand that in ES2016 the ''default'' export is not supported in TiddlyWiki. This is mostly because the core code expects specific properties to be attached to the `exports` variable. Bable's `export` conversion plays well with this //except// with the default export.
!! Classes
!!! Classes
In the example of a widget ES2016 plays well with class inheritance. To contrast the typical Widget definition would look something like this:
@ -104,7 +114,7 @@ class NameWidget extends Widget {
}
```
!!! Non Class Modules
!!!! Non Class Modules
For non class modules you can use the `export` keyword. Here is a simple [[Startup Module|ModuleType]]:
@ -122,11 +132,11 @@ export const params = {};
export function run() {…}
```
!! Polyfills
!!! Polyfills
ES2015 comes with some features that are part of the JavaScript core objects. These are not supported by all browsers. To use these features in [[most browsers|BrowserCompatibility]] you will need a <<.def "polyfill">>. Babel has a polyfill package that you can include. See [[Adding Babel Polyfill to TiddlyWiki]] for how to accomplish this.
!! Example
!!! Example
Here is an example ES2015 plugin/widget that will show the time and update it:

View File

@ -0,0 +1,5 @@
title: Using TiddlyWiki as a library in another Node.js application
Node.js applications can include TiddlyWiki as a library so that they can use wikitext rendering.
See the demo at https://github.com/Jermolene/TiddlyWiki5DemoApp

View File

@ -0,0 +1,6 @@
created: 20240311150859344
modified: 20240311150859344
title: $:/themes/tiddlywiki/vanilla/options/sidebarlayout
type: text/vnd.tiddlywiki
fluid-fixed

View File

@ -12,6 +12,7 @@ title: Output
+
title: Definitions
\whitespace trim
<$set name="one" value="elephant">
<$set name="two" value="giraffe">
</$set>

View File

@ -14,6 +14,7 @@ title: Output
+
title: Definitions
\whitespace trim
\define name() Bugs Bunny
\procedure address()
Bunny Hill

View File

@ -0,0 +1,27 @@
title: Macros/unusedtitle/basic-draft-exists
description: test <<unusedtitle>> with basic macro parameters but they are empty
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Draft of 'test'
draft.of: test
draft.title: test
+
title: Draft of 'asdf 0'
draft.of: asdf 0
draft.title: asdf 0
+
title: Output
<!-- hanled in wiki.js -->
<<unusedtitle baseName:"test">>
<!-- handled in unusedtitle.js -->
<<unusedtitle baseName:"asdf" separator:" " template:"$basename$$separator$$count:1$">>
+
title: ExpectedResult
<p>test 1</p><p>asdf 1</p>

View File

@ -0,0 +1,23 @@
title: Macros/unusedtitle/basic-params-empty-tiddler-exists
description: test <<unusedtitle>> with basic macro parameters but they are empty
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: New Tiddler
+
title: Output
<!-- hanled in wiki.js -->
<<unusedtitle separator:"">>
<!-- handled in unusedtitle.js -->
<<unusedtitle baseName:"">>
<!-- handled in wiki.js -->
<<unusedtitle template:"">>
+
title: ExpectedResult
<p>New Tiddler 1</p><p>New Tiddler 1</p><p>New Tiddler 1</p>

View File

@ -0,0 +1,20 @@
title: Macros/unusedtitle/basic-params-empty
description: test <<unusedtitle>> with basic macro parameters but they are empty
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
<!-- hanled in wiki.js -->
<<unusedtitle separator:"">>
<!-- handled in unusedtitle.js -->
<<unusedtitle baseName:"">>
<!-- handled in wiki.js -->
<<unusedtitle template:"">>
+
title: ExpectedResult
<p>New Tiddler</p><p>New Tiddler</p><p>New Tiddler</p>

View File

@ -0,0 +1,28 @@
title: Macros/unusedtitle/basic-params-tiddlers-exist
description: test <<unusedtitle>> with basic macro parameters, where new-name tiddlers already exist
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: New Tiddler
+
title: anotherBase
+
title: About
+
title: Output
<<unusedtitle>>
<<unusedtitle separator:"-">>
<<unusedtitle baseName:"anotherBase">>
<<unusedtitle baseName:"About" separator:"-">>
+
title: ExpectedResult
<p>New Tiddler 1</p><p>New Tiddler-1</p><p>anotherBase 1</p><p>About-1</p>

View File

@ -0,0 +1,20 @@
title: Macros/unusedtitle/basic-params
description: test <<unusedtitle>> with basic macro parameters
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
<<unusedtitle>>
<!-- EDGECASE: separator is ignored if tiddler title does not exist -->
<<unusedtitle separator:"-">>
<<unusedtitle baseName:"anotherBase">>
<<unusedtitle baseName:"About" separator:"-">>
+
title: ExpectedResult
<p>New Tiddler</p><p>New Tiddler</p><p>anotherBase</p><p>About</p>

View File

@ -0,0 +1,50 @@
title: Macros/unusedtitle/template-empty-params-tiddler-exist
description: test <<unusedtitle>> with templates where parameters are empty
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: New Tiddler
+
title: xxx
+
title: 00-New Tiddler
+
title: 0000 asdf
+
title: 0001 asdf
+
title: 0000 abc
+
title: Output
<!-- empty template - no template handling at all -->
<<unusedtitle template:"">>
<!--
uses basename AND separator if tiddler exists
because it uses default naming build rules - no template handling
-->
<<unusedtitle template:"" separator:"-y-" baseName:"xxx">>
<<unusedtitle baseName:"" template:"$count:2$-$basename$">>
<!--
EDGECASE: if separator is empty it will be initialized with a single space " "
to have the same rules for templates and default title creation
-->
<<unusedtitle baseName:"asdf" separator:"" template:"$count:4$$separator$$basename$">>
<!-- separator = " " -->
<<unusedtitle baseName:"abc" separator:" " template:"$count:4$$separator$$basename$">>
+
title: ExpectedResult
<p>New Tiddler 1</p><p>xxx-y-1</p><p>01-New Tiddler</p><p>0002 asdf</p><p>0001 abc</p>

View File

@ -0,0 +1,24 @@
title: Macros/unusedtitle/template-empty-params
description: test <<unusedtitle>> with templates where parameters are empty
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
<!-- empty template -->
<<unusedtitle template:"">>
<!--
uses basename but ignores separator,
because it uses default naming build rules -- no template handling is active
-->
<<unusedtitle template:"" separator:"-x-" baseName:"xxx">>
<<unusedtitle baseName:"" template:"$count:2$-$basename$">>
<<unusedtitle baseName:"asdf" separator:"" template:"$count:4$$separator$$basename$">>
+
title: ExpectedResult
<p>New Tiddler</p><p>xxx</p><p>00-New Tiddler</p><p>0000 asdf</p>

View File

@ -0,0 +1,28 @@
title: Macros/unusedtitle/template
description: test <<unusedtitle>> with templates
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
<!-- empty template - standard rules are used -->
<<unusedtitle template:"">>
<<unusedtitle template:"count-missing">>
<<unusedtitle template:"$count:2$-new">>
<!-- template is handled using $tw.utils.formatTitleString -->
<<unusedtitle baseName:"base" template:"$count:2$-$basename$">>
<<unusedtitle baseName:"" template:"$count:2$-$basename$">>
<!-- UPPERCASES are intentional in template strings. They should be case-insensistive -->
<<unusedtitle baseName:"asdf" separator:"-" template:"$coUNT:2$$sepaRATor$$baseName$">>
<<unusedtitle baseName:"asdf" separator:"" template:"$count:2$$separator$$basename$">>
+
title: ExpectedResult
<p>New Tiddler</p><p>count-missing</p><p>00-new</p><p>00-base</p><p>00-New Tiddler</p><p>00-asdf</p><p>00 asdf</p>

View File

@ -0,0 +1,25 @@
title: Transclude/Procedures/Whitespace2
description: Procedures should inherit whitespace settings from definition site
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\procedure testproc()
This is a sentence
\end
\define testmacro()
This is a sentence
\end
This is a sentence
[<<testproc>>]
[<<testmacro>>]
+
title: ExpectedResult
<p>This is a sentence
[This is a sentence ]
[This is a sentence ]
</p>

View File

@ -0,0 +1,30 @@
title: Transclude/Procedures/Whitespace3
description: Procedures should inherit whitespace settings from definition site
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\import Definitions
This is a sentence
[<<testproc>>]
[<<testmacro>>]
+
title: Definitions
\procedure testproc()
This is a sentence
\end
\define testmacro()
This is a sentence
\end
+
title: ExpectedResult
<p>This is a sentence
[This is a sentence ]
[This is a sentence ]
</p>

View File

@ -0,0 +1,176 @@
/*\
title: test-action-deletefield.js
type: application/javascript
tags: [[$:/tags/test-spec]]
Tests <$action-deletefield />.
\*/
(function(){
/* jslint node: true, browser: true */
/* eslint-env node, browser, jasmine */
/* eslint no-mixed-spaces-and-tabs: ["error", "smart-tabs"]*/
/* global $tw, require */
"use strict";
describe("<$action-deletefield /> tests", function() {
const TEST_TIDDLER_TITLE = "TargetTiddler";
const TEST_TIDDLER_MODIFIED = "20240313114828368";
function setupWiki(condition, targetField, wikiOptions) {
// Create a wiki
var wiki = new $tw.Wiki({});
var tiddlers = [{
title: "Root",
text: "Some dummy content"
}];
var tiddler;
if(condition.targetTiddlerExists) {
var fields = {
title: TEST_TIDDLER_TITLE,
};
if(condition.modifiedFieldExists) {
fields.modified = TEST_TIDDLER_MODIFIED;
}
if(condition.targetFieldExists) {
fields[targetField] = "some text";
}
var tiddler = new $tw.Tiddler(fields);
tiddlers.push(tiddler);
}
wiki.addTiddlers(tiddlers);
wiki.addIndexersToWiki();
var widgetNode = wiki.makeTranscludeWidget("Root",{document: $tw.fakeDocument, parseAsInline: true});
var container = $tw.fakeDocument.createElement("div");
widgetNode.render(container,null);
return {
wiki: wiki,
widgetNode: widgetNode,
contaienr: container,
tiddler: tiddler,
};
}
function generateTestConditions() {
var conditions = [];
$tw.utils.each([true, false], function(tiddlerArgumentIsPresent) {
$tw.utils.each([true, false], function(targetTiddlerExists) {
$tw.utils.each([true, false], function(targetFieldExists) {
$tw.utils.each([true, false], function(fieldArgumentIsUsed) {
$tw.utils.each([true, false], function(modifiedFieldExists) {
$tw.utils.each(["", "yes", "no"], function(timestampArgument) {
conditions.push({
tiddlerArgumentIsPresent: tiddlerArgumentIsPresent,
targetTiddlerExists: targetTiddlerExists,
targetFieldExists: targetFieldExists,
fieldArgumentIsUsed: fieldArgumentIsUsed,
modifiedFieldExists: modifiedFieldExists,
timestampArgument: timestampArgument,
});
});
});
});
});
});
});
return conditions;
}
function generateActionWikitext(condition, targetField) {
var actionPieces = [
"<$action-deletefield",
(condition.tiddlerArgumentIsPresent ? "$tiddler='" + TEST_TIDDLER_TITLE + "'" : ""),
(condition.fieldArgumentIsUsed ? "$field='" + targetField + "'" : targetField),
(condition.timestampArgument !== "" ? "$timestamp='" + condition.timestampArgument + "'" : ""),
"/>",
];
return actionPieces.join(" ");
}
function generateTestContext(action, tiddler) {
var expectationContext = "action: " + action + "\ntiddler:\n\n";
if(tiddler) {
expectationContext += tiddler.getFieldStringBlock({exclude: ["text"]});
if(tiddler.text) {
expectationContext += "\n\n" + tiddler.text;
}
expectationContext += "\n\n";
} else {
expectationContext += "null";
}
return expectationContext;
}
it("should correctly delete fields", function() {
var fields = ['caption', 'description', 'text'];
var conditions = generateTestConditions();
$tw.utils.each(conditions, function(condition) {
$tw.utils.each(fields, function(field) {
var info = setupWiki(condition, field);
var originalTiddler = info.tiddler;
var invokeActions = function(actions) {
info.widgetNode.invokeActionString(actions,info.widgetNode,null,{
currentTiddler: TEST_TIDDLER_TITLE,
});
};
var action = generateActionWikitext(condition,field);
invokeActions(action);
var testContext = generateTestContext(action,originalTiddler);
var tiddler = info.wiki.getTiddler(TEST_TIDDLER_TITLE);
if(originalTiddler) {
// assert that the tiddler doesn't have the target field anymore
expect(tiddler.hasField(field)).withContext(testContext).toBeFalsy();
var targetFieldWasPresent = originalTiddler.hasField(field);
var updateTimestamps = condition.timestampArgument !== "no";
// "created" should exist if it did beforehand, or if the tiddler changed and we asked the widget to update timestamps
var createdFieldShouldExist = originalTiddler.hasField("created") || (targetFieldWasPresent && updateTimestamps);
// "created" should change only if it didn't exist beforehand and the tiddler changed and we asked the widget to update timestamps
var createdFieldShouldChange = !originalTiddler.hasField("created") && (targetFieldWasPresent && updateTimestamps);
// "modified" should exist if it did beforehand, or if the tiddler changed and we asked the widget to update timestamps
var modifiedFieldShouldExist = originalTiddler.hasField("modified") || (targetFieldWasPresent && updateTimestamps);
// "modified" should change if the tiddler changed and we asked the widget to update timestamps
var modifiedFieldShouldChange = targetFieldWasPresent && updateTimestamps;
expect(tiddler.hasField("created")).withContext(testContext).toBe(createdFieldShouldExist);
expect(tiddler.hasField("modified")).withContext(testContext).toBe(modifiedFieldShouldExist);
if(createdFieldShouldChange) {
expect(tiddler.fields.created).withContext(testContext).not.toEqual(originalTiddler.fields.created);
} else {
expect(tiddler.fields.created).withContext(testContext).toEqual(originalTiddler.fields.created);
}
if(modifiedFieldShouldChange) {
expect(tiddler.fields.modified).withContext(testContext).not.toEqual(originalTiddler.fields.modified);
} else {
expect(tiddler.fields.modified).withContext(testContext).toEqual(originalTiddler.fields.modified);
}
} else {
// assert that the tiddler didn't get created if it didn't exist already
expect(tiddler).withContext(testContext).toBeUndefined();
}
});
});
});
});
})();

View File

@ -0,0 +1,12 @@
created: 20240313100515958
modified: 20240313103959789
tags: Editions
title: TiddlyWiki Docs PR Maker
''~TiddlyWiki Docs PR Maker'' is a special edition of tiddlywiki.com designed to help you contribute to and improve the documentation made by [[@saqimtiaz|https://github.com/saqimtiaz/]].
https://saqimtiaz.github.io/tw5-docs-pr-maker/
All changes made to the documentation can be very easily submitted to GitHub -- the pull request will be automatically made, hence the "PR Maker" name of the edition.
You will need to create a free ~GitHub account and sign the [[Contributor License Agreement]] before using the Docs PR Maker. You can find more details about contributing to the documentation [[here|Improving TiddlyWiki Documentation]].

View File

@ -1,5 +1,5 @@
created: 20140820151051019
modified: 20190115165616599
modified: 20240313114828368
tags: Community
title: Improving TiddlyWiki Documentation
type: text/vnd.tiddlywiki
@ -8,9 +8,29 @@ Anyone can submit improvements to the TiddlyWiki documentation that appears on h
<<.warning """If you already know GitHub, note that documentation updates must be directed to the `tiddlywiki-com` branch""">>
! Before you start editing
# Read and observe the [[Documentation Style Guide]]
# Create an account on https://github.com if you don't already have one
# If you haven't done so already, sign the [[Contributor License Agreement]] as described in [[Signing the Contributor License Agreement]]
! Editing and submitting your edits
You can choose to edit the documentation using the [[TiddlyWiki Docs PR Maker]] or directly in ~GitHub. The first method is especially recommended for users not familiar with ~GitHub.
!! Using [[Docs PR Maker|TiddlyWiki Docs PR Maker]] edition
# Go to https://saqimtiaz.github.io/tw5-docs-pr-maker/ or click the link displayed in the ribbon underneath the title when editing a tiddler on tiddlywiki.com
# Go through the quick introduction where you will need to provide your ~GitHub username and a ~GitHub access token (you will be guided in creating one)
# Edit or create tiddlers to update the documentation, the wiki will keep track of all changes
# Click the "Submit updates" button and check if all the tiddlers that you edited are included in the submission; if not, drag them into the box
# Provide a concise title and description of your changes (see the rules about titling pull requests in [[contribution guidelines|Contributing]])
# Submit your changes:
** "Save as draft" will create a //draft// pull request, this is useful if you don't want the changes to be merged //yet//, because you want to work on it later or discuss it first
** "Submit documentation update" will create a pull request, which will be immediately available for review and merging
!! Using ~GitHub
# On https://tiddlywiki.com, click "edit" on the tiddler you want to improve
# You should see a pink banner with the text: //Can you help us improve this documentation? Find out how to edit this tiddler on ~GitHub//
# Click on the external link ...''this tiddler on ~GitHub''

View File

@ -0,0 +1,42 @@
created: 20240309135835396
modified: 20240309142156125
tags: Concepts
title: Bags and Recipes
type: text/vnd.tiddlywiki
The bags and recipes model is a reference architecture for how tiddlers can be shared between multiple wikis. It was first introduced by TiddlyWeb in 2008.
The principles of bags and recipes can be simply stated:
# Tiddlers are stored in named "bags"
# Bags have access controls that determines which users can read or write to them
# Recipes are named lists of bags, ordered from lowest priority to highest
# The tiddlers within a recipe are accumulated in turn from each bag in the recipe in order of increasing priority. Thus, if there are multiple tiddlers with the same title in different bags then the one from the highest priority bag will be used as the recipe tiddler
# Wikis are composed by splicing the tiddlers from the corresponding recipe into the standard TW5 HTML template
A very simple example of the recipe/bag model might be for a single user who maintains the following bags:
* ''recipes'' - tiddlers related to cooking recipes
* ''work'' - tiddlers related to work
* ''app'' - common tiddlers for customising TiddlyWiki
Those bags would be used with the following recipes:
* ''recipes'' --> recipes, app - wiki for working with recipes, with common custom components
* ''work'' --> work, app - wiki for working with work, with common custom components
* ''app'' --> app - wiki for maintaining custom components
All of this will work dynamically, so changes to the app bag will instantly ripple into the affected hosted wikis.
A more complex example might be for a teacher working with a group of students:
* ''student-{name}'' bag for each students work
* ''teacher-course'' bag for the coursework, editable by the teacher
* ''teacher-tools'' bag for custom tools used by the teacher
Those bags would be exposed through the following hosted wikis:
* ''student-{name}'' hosted wiki for each students work, including the coursework material
* ''teacher-course'' hosted wiki for the coursework, editable by the teacher
* ''teacher'' hosted wiki for the teacher, bringing together all the bags, giving them an overview of all the students work

View File

@ -2,8 +2,9 @@ created: 201308300841
modified: 20170127221451610
tags: Definitions
title: TiddlyWeb
type: text/vnd.tiddlywiki
TiddlyWeb is a reference implementation for an interface to put [[Tiddlers]] on the web.
TiddlyWeb is a reference implementation for an interface to put [[Tiddlers]] on the web using the [[Bags and Recipes]] model.
It was created by a team led by Chris Dent at [[Osmosoft]] under [[BT]] from 2008 to 2012.
@ -16,5 +17,3 @@ Other implementations of the API include:
* [[TiddlyWiki App Engine Server|https://github.com/rsc/tiddly]], a 300-line Go implementation from Russ Cox
* [[TiddlyWiki 5 server module|https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/commands/server.js]], the bare-bones subset of the API implemented in TiddlyWiki version 5 for Node.js
* [[tiddly-wiki-server|https://github.com/nathanielknight/tiddly-wiki-server]], an implementation based on Rust and SQLite
As of early 2017, none is currently as complete as TiddlyWeb itself.

View File

@ -0,0 +1,9 @@
created: 20240309100338678
modified: 20240309135821423
tags: Definitions
title: TiddlyWebAdaptor
type: text/vnd.tiddlywiki
TiddlyWebAdaptor is a component of [[TiddlyWiki on Node.js]]. It provides the means to synchronise changes to tiddlers from the browser to a server, and from the server to the browser. It can be found in the plugin [[$:/plugins/tiddlywiki/tiddlyweb]].
TiddlyWebAdaptor was designed to be compatible both with TiddlyWeb and with TiddlyWiki's own built-in server mechanism. The [[Bags and Recipes]] model is fully supported by [[TiddlyWeb]], but TiddlyWiki's built-in server only supports a simplified model with a single bag and a single recipe.

View File

@ -0,0 +1,9 @@
created: 20240308122813807
modified: 20240308122916812
tags: [[Operator Examples]] [[sha256 Operator]]
title: sha256 Operator (Examples)
type: text/vnd.tiddlywiki
<<.operator-example 1 "[[test]sha256[]]">>
<<.operator-example 2 "[[test]sha256[64]]">>

View File

@ -1,6 +1,6 @@
created: 20210618133745003
from-version: 5.2.0
modified: 20230710073315595
modified: 20240312202834547
rp-input: the filter output of all previous runs so far
rp-output: the input titles as modified by the result of this filter run
rp-purpose: modify input titles by the result of evaluating this filter run for each item
@ -12,7 +12,7 @@ type: text/vnd.tiddlywiki
<$railroad text="""
\start none
\end none
( ":map" | - )
( ":map" (: ":flat" | - ) | - )
[[run|"Filter Run"]]
"""/>

View File

@ -1,6 +1,6 @@
created: 20210428083929749
from-version: 5.2.0
modified: 20230322140722470
modified: 20240312203002082
rp-input: the filter output of all previous runs so far
rp-output: output titles replace the output of previous filter runs
rp-purpose: sort the input titles by the result of evaluating this filter run for each item
@ -12,9 +12,9 @@ type: text/vnd.tiddlywiki
<$railroad text="""
\start none
\end none
( ":sort" )
( ( ":sort" )
( : ":string" | ":alphanumeric" | ":number" | ":integer" | ":version" | ":date" )
( : ":casesensitive" /"required for string and alphanumeric"/ | ":caseinsensitive" /"required for string and alphanumeric"/ | ":reverse" /"optional"/ | - )
( : ":casesensitive" /"required for string and alphanumeric"/ | ":caseinsensitive" /"required for string and alphanumeric"/ | ":reverse" /"optional"/ | - ) | - )
[[run|"Filter Run"]]
"""/>

View File

@ -1,10 +1,11 @@
caption: Firefox
created: 20140811170425199
modified: 20211114031651878
modified: 20230803213024843
tags: GettingStarted
title: GettingStarted - Firefox
type: text/vnd.tiddlywiki
Firefox provides the best user experience for using TiddlyWiki with the TiddlyFox browser extension.
Firefox provides the best user experience for using TiddlyWiki with the following browser extensions:
<<list-links filter:"[tag[Firefox]delivery[Browser Extension]] -[[Saving with TiddlyFox]]">>
{{Saving with TiddlyFox}}
{{Saving with FireFox}}

View File

@ -4,10 +4,16 @@ tags: Learning
title: Concatenating text and variables using macro substitution
type: text/vnd.tiddlywiki
!! Important
<<.from-version "5.3.0">> It is recommended to use [[substituted attributes|Substituted Attribute Values]] or the [[substitute filter operator|substitute Operator]] to concatenate text and variables.
It's a frequent use case in ~TiddlyWiki that you will want to put the results of variables together with various bits of strings of text. This process in some programming languages is often referred to as "concatenating" text.
---
!! What is Wrong
You might, for instance want to set up a template for your customer database, where links will automatically refer to additional contact information about your customer. Inside your tiddler, you might try something like this:
<<.bad-example "`[[Additional Info|<<currentTiddler>>-Contact]]`">>

View File

@ -1,6 +1,6 @@
caption: tag
created: 20141206130540337
modified: 20230725201240201
modified: 20240228131301798
tags: Macros [[Core Macros]]
title: tag Macro
type: text/vnd.tiddlywiki
@ -11,7 +11,35 @@ The <<.def tag>> [[macro|Macros]] generates a tag pill for a specified tag. Clic
!! Parameters
;tag
; tag
: The title of the tag, defaulting to the [[current tiddler|Current Tiddler]]
!! CSS classes
<<.from-version "v5.3.4">>
; `tc-tag-missing`
: This class is defined if a tag does ''not exist'' as a tiddler.
; `tc-tag-exists`
: This class is defined if a tag does exist as a tiddler
!!! Defining the class
To define the `tc-tag-missing` class a stylesheet tiddler needs to be created. The default font-style for missing tiddler links is //italic//, so it's used for the example code below. Eg:
''title:'' `myTagsStylesheet`<br>
''tag:'' `$:/tags/Stylesheet`
<<copy-to-clipboard-above-right src:"""
.tc-tag-missing {
font-style: italic;
}
""">>
```
.tc-tag-missing {
font-style: italic;
}
```
<<.macro-examples "tag">>

View File

@ -1,5 +1,5 @@
created: 20150221211317000
modified: 20230725203751870
modified: 20240228131331605
tags: [[tag Macro]] [[Macro Examples]]
title: tag Macro (Examples)
type: text/vnd.tiddlywiki
@ -7,22 +7,26 @@ type: text/vnd.tiddlywiki
<$macrocall $name=".example" n="1" eg="""<<tag>>"""/>
<$macrocall $name=".example" n="2" eg="""<<tag Concepts>>"""/>
The Following tag can be shown with a font-style: //italic// if the corresponding stylesheet exists. See: [[tag Macro]]
<$macrocall $name=".example" n="3" eg="""<<tag "Does not exist">>"""/>
If a [[list widget|ListWidget]] generates multiple tag macros for the same tag, clicking any of them opens dropdowns on all of them, as in the example below. This is usually unwanted.
<$macrocall $name=".example" n="3" eg="""<$list filter="[tag[HelloThere]]">
<$macrocall $name=".example" n="4" eg="""<$list filter="[tag[HelloThere]]">
* <$link/> is tagged with: <$list filter="[<currentTiddler>tags[]]"> <<tag>> </$list>
</$list>"""/>
Adding the `counter="transclusion"` attribute to the list widget that generates multiple identical tag macros causes each of them to be identified as a unique one. Clicking on any of them opens only a single dropdown.
<$macrocall $name=".example" n="4" eg="""<$list filter="[tag[HelloThere]]" counter="transclusion">
<$macrocall $name=".example" n="5" eg="""<$list filter="[tag[HelloThere]]" counter="transclusion">
* <$link/> is tagged with: <$list filter="[<currentTiddler>tags[]]"> <<tag>> </$list>
</$list>"""/>
A slightly more performant option is to use the `variable="transclusion"` attribute in the list widget. In this case, the variable `<<transclusion>>` has to be used inside the list widget instead of the `<<currentTiddler>>` .
<$macrocall $name=".example" n="5" eg="""<$list filter="[tag[HelloThere]]" variable="transclusion">
<$macrocall $name=".example" n="6" eg="""<$list filter="[tag[HelloThere]]" variable="transclusion">
* <$link to=<<transclusion>>/> is tagged with: <$list filter="[<transclusion>tags[]]"> <<tag>> </$list>

View File

@ -1,6 +1,7 @@
code-body: yes
created: 20150221145803000
modified: 20240310124126491
title: $:/editions/tw5.com/macro-examples/tags-of-current-tiddler
type: text/vnd.tiddlywiki
\define tags-of-current-tiddler() {{!!tags}}
\procedure tags-of-current-tiddler() {{!!tags}}

View File

@ -1,6 +1,7 @@
code-body: yes
created: 20150228123855000
modified: 20150228123921000
modified: 20240310133309881
title: $:/editions/tw5.com/macro-examples/tv-get-export-image-link
type: text/vnd.tiddlywiki
\define tv-get-export-image-link(src) https://www.tiddlywiki.com/$src$
\function tv-get-export-image-link(src) [[https://www.tiddlywiki.com/$(src)$]substitute[]]

View File

@ -1,8 +1,9 @@
code-body: yes
created: 20150228120252000
modified: 20240310124217005
title: $:/editions/tw5.com/macro-examples/tv-wikilink-tooltip
type: text/vnd.tiddlywiki
\define tv-wikilink-tooltip()
\procedure tv-wikilink-tooltip()
<$transclude field="tooltip">(<$transclude field="caption"/>)</$transclude>
\end

View File

@ -1,9 +1,13 @@
created: 20150221105732000
modified: 20150221222352000
tags: [[Macro Syntax]]
tags: [[Macro Syntax]] $:/deprecated
title: Macro Call Syntax
type: text/vnd.tiddlywiki
<<.deprecated-since "5.3.0" "Procedure Call Syntax">>
----------
<<.preamble """What follows is a formal presentation of the syntax of the WikiText syntax for macro calls, using [[railroad diagrams|Railroad Diagrams]]. A [[simpler overview|Macro Calls in WikiText]] is also available.""">>
<$railroad text="""

View File

@ -1,9 +1,13 @@
created: 20150220200255000
modified: 20150221222349000
tags: [[Macro Syntax]]
tags: [[Macro Syntax]] $:/deprecated
title: Macro Definition Syntax
type: text/vnd.tiddlywiki
<<.deprecated-since "5.3.0" "Procedure Definition Syntax">>
----------
<<.preamble """What follows is a formal presentation of the syntax of the `\define` pragma, using [[railroad diagrams|Railroad Diagrams]]. A [[simpler overview|Macro Definitions in WikiText]] is also available.""">>
<$railroad text="""

View File

@ -0,0 +1,33 @@
created: 20240310165023000
modified: 20240310172648116
tags: [[Procedure Syntax]]
title: Procedure Call Syntax
type: text/vnd.tiddlywiki
<<.preamble """What follows is a formal presentation of the syntax of the WikiText syntax for procedure calls, using [[railroad diagrams|Railroad Diagrams]].""">>
!! procedure-name
<$railroad text="""
"<<" [[ procedure-name |Procedures]] [: [[whitespace|"Filter Whitespace"]] [:{param-value}] ]">>"
"""/>
* The [[procedure's|Procedures]] <<.place procedure-name>> is a sequence of non-whitespace characters other than `(` or `>`.
* <<.place whitespace>> denotes a sequence of [[whitespace characters|Filter Whitespace]].
!!! param-value
Each ''individual'' <<.place param-value>> has the following syntax:
<$railroad text="""
\start none
\end none
[: param-name [:[[whitespace|"Filter Whitespace"]]] ":" [:[[whitespace|"Filter Whitespace"]]] ] value [: [[whitespace|"Filter Whitespace"]] ]
"""/>
* The <<.place param-name>> is a sequence of letters (`A`--`Z`, `a`--`z`), digits (`0`--`9`), hyphens (`-`) and underscores (`_`).
* The <<.place value>> is specified as follows:
<$railroad text={{$:/editions/tw5.com/railroad/macro-parameter-value}}/>

View File

@ -0,0 +1,93 @@
created: 20240310165023000
modified: 20240310175033730
tags: [[Procedure Syntax]]
title: Procedure Definition Syntax
type: text/vnd.tiddlywiki
<<.preamble """What follows is a formal presentation of the syntax of the [[Pragma: \procedure]], using [[railroad diagrams|Railroad Diagrams]]. """>>
! \procedure
There are 2 types of procedure definitions
* Single line definitions
* Multi line definitions
!! Single Line
Single line definitions should only be used for very short bodies, where the procedure name, params and the body fit into 1 line terminated with a line-feed.
<$railroad text="""
"\procedure"
[[<"space">|"Filter Whitespace"]]
"procedure-name"
<"(params)">
[:[[<"space">|"Filter Whitespace"]]]
"body"
"lf"
"""/>
!! Multi Line
The majority of procedure definitions will have a body, that spans over several lines of wikitext. Those procedure definitions are terminated using the "\end" pragma
<$railroad text="""
"\procedure"
[[<"space">|"Filter Whitespace"]]
"procedure-name"
<"(params)">
[:[[<"space">|"Filter Whitespace"]]]
body
"\end"
"""/>
The [[procedure-name|Procedures]] is a sequence of non-whitespace characters other than `(` or `>`.
* <<.place procedure-name>> is a sequence of letters (`A`--`Z`, `a`--`z`), digits (`0`--`9`), hyphens (`-`) and underscores (`_`)
* <<.place body>> is wikitext including [[nested procedures|Pragma: \procedure]]
* <<.place space>> denotes a sequence of [[whitespace characters|Filter Whitespace]]
!! params
The parameter declaration list <<.place (params)>> has the following syntax:
<$railroad text="""
\start none
\end none
"(" [:"sep"] [:{ parameter "sep" }] ")"
"""/>
* <<.place sep>> is any sequence of characters that does not match a <<.place param-name>>. <br>Among other things, this includes commas, spaces and linefeeds.
Each ''individual'' <<.place parameter>> has the following syntax:
<$railroad text="""
\start none
\end none
"param-name" [: [:[[<"space">|"Filter Whitespace"]]] ":" [:[[<"space">|"Filter Whitespace"]]] default ]
"""/>
* <<.place param-name>> is a sequence of letters (`A`--`Z`, `a`--`z`), digits (`0`--`9`), hyphens (`-`) and underscores (`_`).
* <<.place default>> is an optional value of a parameter is specified as follows:
<$railroad text={{$:/editions/tw5.com/railroad/macro-parameter-value}}/>
!! body
The <<.place body>> of the definition has the following syntax:
<$railroad text="""
\start none
\end none
{[[<"wikitext">|WikiText]] "lf"}
"""/>
* <<.place wikitext>> is any sequence of characters that doesn't terminate the macro definition.
** If [[nested procedures|Pragma: \procedure]] are used they need to be at the start of the wikitext. There are the same rules as if the wikitext would be in a tiddler.
** Pragmas need to be before standard wikitext.
* <<.place lf>> denotes a linefeed.

View File

@ -0,0 +1,11 @@
created: 20240310165023000
modified: 20240310173318213
tags: Procedures
title: Procedure Syntax
type: text/vnd.tiddlywiki
Plain text description can be found at [[Procedures]]
<<list-links filter:"[tag[Procedure Syntax]]">>
<<.tip "The railroad boxes in the linked tiddlers can be used to navigate.">>

View File

@ -1,6 +1,6 @@
caption: tag-picker
created: 20161128191316701
modified: 20161128191435641
modified: 20230616114543787
tags: Macros [[Core Macros]]
title: tag-picker Macro
type: text/vnd.tiddlywiki
@ -9,9 +9,17 @@ The <<.def tag-picker>> [[macro|Macros]] generates a combination of a text box a
!! Parameters
;actions
: Action widgets to be triggered when the pill is clicked. Within the text, the variable ''tag'' contains the title of the selected tag.
;tagField
: <<.from-version 5.1.23>> The ''field'' that gets updated with the selected tag. Defaults to ''tags''.
; actions
: Action widgets to be triggered when the pill is clicked. Within the text, the variable <<.var tag>> contains the title of the selected tag.
; tagField
: <<.from-version 5.1.23>> The specified ''field'' that gets updated with the selected tag. Defaults to `tags`.
; tiddler
: <<.from-version 5.3.4>> Defines the target tiddler, which should be manipulated. Defaults to: <<.var currentTiddler>>.
; tagListFilter
: <<.from-version 5.3.4>> This parameter defaults to: `[tags[]]` which creates a list of all existing tags. If the tag list should come from a different source the filter should look similar to eg: `[<listSource>get[field-name]enlist-input[]]`.
<<.macro-examples "tag-picker">>

View File

@ -12,6 +12,6 @@ The rules governing refresh throttling are:
** Has the field `draft.of`
** Has the field `throttle.refresh`
** Has a title prefixed with `$:/temp/volatile/`
* If the refresh cycle is to be throttled, a timer is set for the internal specified in [[$:/config/Drafts/TypingTimeout|Hidden Setting: Typing Refresh Delay]] (cancelling any preciously set timer)
* If the refresh cycle is to be throttled, a timer is set for the internal specified in [[$:/config/Drafts/TypingTimeout|Hidden Setting: Typing Refresh Delay]] (cancelling any previously set timer)
** When the timer fires, the refresh cycle is triggered, passing the aggregated titles of all the deferred refresh cycles

View File

@ -0,0 +1,34 @@
title: WidgetMessage: tm-http-request Example - Basic Authentication
tags: $:/tags/Global
!! HTTP Basic Authentication
[[HTTP Basic Authentication|https://en.wikipedia.org/wiki/Basic_access_authentication]] is a simple scheme for HTTP clients pass a username and password to an HTTP server.
The credentials are passed via the "Authorization" header as the string "Basic " (note the space) followed by the base64-encoded username and password joined with a colon.
Here is a simple, illustrative example:
```
\procedure get-tiddler-list-from-tiddlywiki-server(url,username,password)
\procedure completion-get-json()
\import [subfilter{$:/core/config/GlobalImportFilter}]
<$action-log msg="In completion-get-json"/>
<$action-log/>
\end completion-get-json
<$action-sendmessage
$message="tm-http-request"
url=<<url>>
method="GET"
header-Authorization={{{ [<username>addsuffix[:]addsuffix<password>encodebase64[]addprefix[Basic ]] }}}
oncompletion=<<completion-get-json>>
/>
\end get-tiddler-list-from-tiddlywiki-server
<$button>
<<get-tiddler-list-from-tiddlywiki-server url:"http://127.0.0.1:8080" username:"Joe" password:"Bloggs">>
Download
</$button>
```

View File

@ -1,5 +1,5 @@
title: WidgetMessage: tm-http-request Example - Random Dog
tags: $:/tags/Global
tags: $:/tags/Macro $:/tags/Global
\procedure download-dog(url)

View File

@ -1,5 +1,5 @@
title: WidgetMessage: tm-http-request Example - Zotero
tags: $:/tags/Global
tags: $:/tags/Macro $:/tags/Global
\procedure select-zotero-group()
Specify the Zotero group ID to import

View File

@ -51,3 +51,4 @@ Note that the state tiddler $:/state/http-requests contains a number representin
* [[Zotero's|https://www.zotero.org/]] API for retrieving reference items: [[WidgetMessage: tm-http-request Example - Zotero]]
* [[Random Dog's|https://random.dog/]] API for retrieving random pictures of dogs showing how to retrieve binary data: [[WidgetMessage: tm-http-request Example - Random Dog]]
* Example of using HTTP Basic Authentication: [[WidgetMessage: tm-http-request Example - Basic Authentication]]

View File

@ -1,5 +1,5 @@
created: 20221007124007426
modified: 20230419103154329
modified: 20240310173130052
tags: Concepts Reference
title: Procedures
type: text/vnd.tiddlywiki
@ -18,11 +18,13 @@ The name wrapped in double angled [[brackets|Brackets]] is used a shorthand way
```
<<my-procedure>>
<<my-procedure "The parameter">>
<<my-procedure parameter:"The parameter">>
```
The parameters that are specified in the procedure call are made available as variables.
<<.tip """If a procedure has more than 1 parameter, it is highly encouraged to use "named parameters", as shown in the second example above. Even if it is more to type, it will pay off in the long run.""">>
!! How Procedures Work
Procedures are implemented as a special kind of [[variable|Variables]]. The only thing that distinguishes them from ordinary variables is the way that the parameters are handled.
@ -32,4 +34,4 @@ Procedures are implemented as a special kind of [[variable|Variables]]. The only
* [[Procedure Definitions]] describes how to create procedures
* [[Procedure Calls]] describes how to use procedures
* [[Procedure Parameter Handling]] describes how procedure parameters work
* [[Procedure Syntax]] is a formal syntax description using railroad diagrams

View File

@ -0,0 +1,17 @@
caption: Saving with FireFox
created: 20230803205140949
modified: 20230803213246739
tags: Saving Firefox
title: Saving with FireFox
# Restart [[Firefox]]
# [[Download]] an empty TiddlyWiki by clicking this button:
#> {{$:/editions/tw5.com/snippets/download-empty-button}}
# Locate the file you just downloaded
#* You may rename it, but be sure to keep the `.html` or `.htm` extension
# Open the file in [[Firefox]]
# 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
#* Look for the yellow notification ''Saved wiki'' at the top right of the window
# Refresh the browser window to verify that your changes have been saved correctly

View File

@ -5,26 +5,9 @@ created: 20131221085742684
delivery: Browser Extension
description: Browser extension for older versions of Firefox
method: save
modified: 20200507105421421
modified: 20230806001436106
tags: Saving Firefox
title: Saving with TiddlyFox
type: text/vnd.tiddlywiki
If you're using [[Firefox for Android]], see the instructions for [[Saving with TiddlyFox on Android]].
# Ensure you have a version of Firefox before version 57. ~TiddlyFox will not work with Firefox 57 and on. For Firefox 57 and on, consider using the following instead: <<list-links filter:"[tag[Firefox]delivery[Browser Extension]] -[[Saving with TiddlyFox]]">>
# Install the latest release of the TiddlyFox extension from:
#* https://addons.mozilla.org/en-GB/firefox/addon/tiddlyfox/
# Restart [[Firefox]]
# [[Download]] an empty TiddlyWiki by clicking this button:
#> {{$:/editions/tw5.com/snippets/download-empty-button}}
# Locate the file you just downloaded
#* You may rename it, but be sure to keep the `.html` or `.htm` extension
# Open the file in [[Firefox]]
#* If you are using TiddlyFox v1.x.x, you will need to click ''OK'' in response to the prompt from TiddlyFox that asks whether to enable saving for this file
#* If you are using TiddlyFox v2.x.x you will need to click on the icon of a kitten standing on a blue globe to activate saving. There is no prompt in v2.0.1.
#** For TiddlyFox v2.0.1, you can not be using Private Browsing mode nor can you be using "Never Remember History".
# 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
#* Look for the yellow notification ''Saved wiki'' at the top right of the window
# Refresh the browser window to verify that your changes have been saved correctly
<<.deprecated-since "FireFox 57" "Saving with FireFox">>

View File

@ -1,174 +1,199 @@
created: 20150110182600000
modified: 20230325161424684
modified: 20240224170607731
tags: [[Improving TiddlyWiki Documentation]]
title: Documentation Macros
type: text/vnd.tiddlywiki
The following macros are used throughout ~TiddlyWiki's documentation. Their names start with a dot to keep them out of the way of names that a user might try experimenting with.
!General
! General
|!Macro |!Used for |!Example |
|.def |the defining instance of a term |<<.def widget>> |
|.em |minor emphasis within a sentence |<<.em not>> |
|.place |a placeholder for the user to fill in |<<.place tagname>> |
|.strong |major emphasis within a tiddler |<<.strong Important!>> |
|.word |a mention of an ordinary word or phrase |<<.word "hello world">> |
|.icon |an icon, sized to match the surrounding text |<<.icon "$:/core/images/globe">> |
|Macro |Used for |Example |Rendered|h
|.def |the defining instance of a term |`<<.def widget>>` |<<.def widget>> |
|.em |minor emphasis within a sentence |`<<.em not>>` |<<.em not>> |
|.place |a placeholder for the user to fill in |`<<.place tagname>>` |<<.place tagname>> |
|.strong |major emphasis within a tiddler |`<<.strong Important!>>` |<<.strong Important!>> |
|.word |a mention of an ordinary word or phrase |`<<.word "hello world">>` |<<.word "hello world">> |
|.icon |an icon, sized to match the surrounding text |`<<.icon "$:/core/images/globe">>` |<<.icon "$:/core/images/globe">> |
!Advice
! Textboxes
|!Macro |!Used for |!Example |
|^.tip |^hints and tips |<<.tip "Turn your screen on, otherwise<br>you won't be able to see much.">> |
|^.warning |^warning advice |<<.warning "Make a backup of your file<br>before you upgrade.">> |
!! Textbox Parameters
!Blocks
|!Macro |!Used for |
|.preamble |an introductory sentence that stands apart from the rest of the tiddler |
; text
: Text to be shown in the box
!Tiddlers and fields
; title
: A title shown as an HTML STRONG element
|!Macro |!Used for |!Example |
|.tid |a tiddler title |<<.tid Example>> |
|.tag |a tag |<<.tag Example>> |
|.field |a field name |<<.field example>> |
|.value |a field value |<<.value "example value">> |
|.op |a filter operator |<<.op backlinks>> |
|.var |a variable or macro name |<<.var currentTiddler>> |
|.wid |a widget name |<<.wid list>> |
|.attr |an attribute name |<<.attr filter>> |
|.param |a macro parameter name |<<.param text>> |
|.tiddler-fields |a list of tiddler fields |<<.tiddler-fields "Monday">> |
; icon
: Core icons can be found at [[Icon Gallery]]
; class
: An optional custom class can be added to the text block. It will overwrite the defaults. To keep the defaults, ''add them'' to the custom class settings.
: ''.note''-macro defaults to `doc-note`
: ''.tip''-macro defaults to `doc-tip`
: ''.warning''-macro defaults to `doc-warning`
!! Textbox Examples
|Macro |Used for |Example |Renderd |h
|^.infoBox |^Text-box with an icon |`<<.infoBox text:"A generic ...">>` |<<.infoBox "A generic text box, with an optional title and a custom icon">> |
|^.note|^Infos with a title |`<<.note text:"Some text ...">>` |<<.note "Some text in a box with a title by default">> |
|^.tip |^hints and tips |`<<.tip text:"Eg: Turn ...">>` |<<.tip "Eg: Turn your screen on, otherwise<br>you won't be able to see much.">> |
|^.warning |^warning advice |`<<.warning text:"Eg: Make a backup ...">>` |<<.warning "Eg: Make a backup of your file<br>before you upgrade.">> |
!Links
|!Macro |!Used for |!Example |
|.link |a link containing WikiText |<<.link "^^an^^ ~~example~~" Example>> |
|.clink |a code link |<<.clink `<$list>` ListWidget>> |
|.dlink |a link on a defining instance of a term |<<.dlink widget Widgets>> |
|.dlink-ex |an external link on a defining instance of a term |<<.dlink-ex Example "http://example.com/">> |
|.flink |a link to a field |<<.flink ListField>> |
|.mlink |a link to a macro |<<.mlink qualify>> |
|.mlink2 |a link to a macro, with specified target |<<.mlink2 foo "Examples of Macros">> |
|.olink |a link to an operator |<<.olink prefix>> |
|.olink2 |a link to an operator, with specified target |<<.olink2 foo prefix>> |
|.vlink |a link to a variable |<<.vlink currentTiddler>> |
|.vlink2 |a link to a variable, with specified target |<<.vlink2 foo "Examples of Variables">> |
|.wlink |a link to a widget |<<.wlink ButtonWidget>> |
|.wlink2 |a link to a widget, with specified text |<<.wlink2 foo ButtonWidget>> |
! Blocks
!Tabs
|!Macro |!Used for |!Example |
|Macro |Example |Used for |h
|.preamble |`<<.preamble "your text comes here">>` |<<.preamble "an introductory sentence that stands apart from the rest of the tiddler">> |
! Tiddlers and Fields
|Macro |Used for |Example |Rendered |h
|.tid |a tiddler title |`<<.tid Example>>` |<<.tid Example>> |
|.tag |a tag |`<<.tag Example>>` |<<.tag Example>> |
|.field |a field name |`<<.field example>>` |<<.field example>> |
|.value |a field value |`<<.value "example value">>` |<<.value "example value">> |
|.op |a filter operator |`<<.op backlinks>>` |<<.op backlinks>> |
|.var |a variable or macro name |`<<.var currentTiddler>>` |<<.var currentTiddler>> |
|.wid |a widget name |`<<.wid list>>` |<<.wid list>> |
|.attr |an attribute name |`<<.attr filter>>` |<<.attr filter>> |
|.param |a macro parameter name |`<<.param text>>` |<<.param text>> |
|.tiddler-fields |a list of tiddler fields |`<<.tiddler-fields "Monday">>` |<<.tiddler-fields "Monday">> |
! Links
|!Macro |Used for |Example |Renderd |h
|.link |link containing WikiText |`<<.link "^^an^^ ~~example~~" Example>>` |<<.link "^^an^^ ~~example~~" Example>> |
|.clink |code link |``<<.clink `<$list>` ListWidget>>`` |<<.clink `<$list>` ListWidget>> |
|.dlink |definition link for a instance of a term |`<<.dlink widget Widgets>>` |<<.dlink widget Widgets>> |
|.dlink-ex |external link to a defining instance of a term |`<<.dlink-ex Example "http://example.com/">>` |<<.dlink-ex Example "http://example.com/">> |
|.flink |field link |`<<.flink ListField>>` |<<.flink ListField>> |
|.mlink |macro link |`<<.mlink qualify>>` |<<.mlink qualify>> |
|.mlink2 |macro link with a specified target |`<<.mlink2 foo "Examples of Macros">>` |<<.mlink2 foo "Examples of Macros">> |
|.olink |operator link |`<<.olink prefix>>` |<<.olink prefix>> |
|.olink2 |operator link with specified target |`<<.olink2 foo prefix>>` |<<.olink2 foo prefix>> |
|.vlink |variable link |`<<.vlink currentTiddler>>` |<<.vlink currentTiddler>> |
|.vlink2 |variable link with specified target |`<<.vlink2 foo "Examples of Variables">>` |<<.vlink2 foo "Examples of Variables">> |
|.wlink |widget link |`<<.wlink ButtonWidget>>` |<<.wlink ButtonWidget>> |
|.wlink2 |widget link with specified text |`<<.wlink2 foo ButtonWidget>>` |<<.wlink2 foo ButtonWidget>> |
! Keyboard Shortcuts
|Macro |Used for |Example |Rendered |h
|.key |a key on the keyboard |`<<.key Escape>>` |<<.key Escape>> |
|.keys |a key combination |`<<.keys Ctrl+Enter>>` |<<.keys Ctrl+Enter>> |
! Doc-Tabs
See: [[CheckboxWidget]]
|Macro |Used for |Example |h
|.doc-tabs |showing a tab set in a documentation tiddler | -- |
|.doc-tab-link |button to activate a tab | -- |
|.widget-attr-link |button with a widget attribute name to activate a tab | -- |
! Sidebar Tabs
!User interface
|Macro |Used for |Example |Rendered |h
|.sidebar-tab |the name of a sidebar tab |`<<.sidebar-tab More>>` |<<.sidebar-tab More>> |
|.more-tab |the name of a subtab of the More tab |`<<.more-tab Shadows>>` |<<.more-tab Shadows>> |
|.info-tab |the name of a tiddler info tab |`<<.info-tab Fields>>` |<<.info-tab Fields>> |
|.controlpanel-tab |the name of a Control Panel tab |`<<.controlpanel-tab Settings>>` |<<.controlpanel-tab Settings>> |
|.advancedsearch-tab |the name of an Advanced Search tab |`<<.advancedsearch-tab Filter>>` |<<.advancedsearch-tab Filter>> |
|.toc-tab |name of the tw5.com TOC tab |`<<.toc-tab>>` |<<.toc-tab>> |
|.example-tab |an example tab name |`<<.example-tab "Notes">>` |<<.example-tab "Notes">> |
|!Macro |!Used for |!Example |
|.key |a key on the keyboard |<<.key Escape>> |
|.keycombo |a key combination |<<.keycombo Ctrl Enter>> |
!! Parameters for .sidebar-tab
!Tabs
|Open |`<<.sidebar-tab Open>>` |<<.sidebar-tab Open>> |
|Recent |`<<.sidebar-tab Recent>>` |<<.sidebar-tab Recent>> |
|Tools |`<<.sidebar-tab Tools>>` |<<.sidebar-tab Tools>> |
|More |`<<.sidebar-tab More>>` |<<.sidebar-tab More>> |
|!Macro |!Used for |!Example |
|.sidebar-tab |the name of a sidebar tab |<<.sidebar-tab More>> |
|.more-tab |the name of a subtab of the More tab |<<.more-tab Shadows>> |
|.info-tab |the name of a tiddler info tab |<<.info-tab Fields>> |
|.controlpanel-tab |the name of a Control Panel tab |<<.controlpanel-tab Settings>> |
|.advancedsearch-tab |the name of an Advanced Search tab |<<.advancedsearch-tab Filter>> |
|.toc-tab |name of the tw5.com TOC tab |<<.toc-tab>> |
|.example-tab |an example tab name |<<.example-tab "Notes">> |
!! Parameters for .more-tab
!!Parameters for .sidebar-tab
|All |`<<.more-tab All>>` |<<.more-tab All>> |
|Recent |`<<.more-tab Recent>>` |<<.more-tab Recent>> |
|Tags |`<<.more-tab Tags>>` |<<.more-tab Tags>> |
|Missing |`<<.more-tab Missing>>` |<<.more-tab Missing>> |
|Drafts |`<<.more-tab Drafts>>` |<<.more-tab Drafts>> |
|Orphans |`<<.more-tab Orphans>>` |<<.more-tab Orphans>> |
|Types |`<<.more-tab Types>>` |<<.more-tab Types>> |
|System |`<<.more-tab System>>` |<<.more-tab System>> |
|Shadows |`<<.more-tab Shadows>>` |<<.more-tab Shadows>> |
|Open |<<.sidebar-tab Open>> |
|Recent |<<.sidebar-tab Recent>> |
|Tools |<<.sidebar-tab Tools>> |
|More |<<.sidebar-tab More>> |
!! Parameters for .info-tab
!!Parameters for .more-tab
|Tools |`<<.info-tab Tools>>` |<<.info-tab Tools>> |
|References |`<<.info-tab References>>` |<<.info-tab References>> |
|Tagging |`<<.info-tab Tagging>>` |<<.info-tab Tagging>> |
|List |`<<.info-tab List>>` |<<.info-tab List>> |
|Listed |`<<.info-tab Listed>>` |<<.info-tab Listed>> |
|Fields |`<<.info-tab Fields>>` |<<.info-tab Fields>> |
|Advanced |`<<.info-tab Advanced>>` |<<.info-tab Advanced>> |
|All |<<.more-tab All>> |
|Recent |<<.more-tab Recent>> |
|Tags |<<.more-tab Tags>> |
|Missing |<<.more-tab Missing>> |
|Drafts |<<.more-tab Drafts>> |
|Orphans |<<.more-tab Orphans>> |
|Types |<<.more-tab Types>> |
|System |<<.more-tab System>> |
|Shadows |<<.more-tab Shadows>> |
!! Parameters for .controlpanel-tab
!!Parameters for .info-tab
|Info |`<<.controlpanel-tab Info>>` |<<.controlpanel-tab Info>> |
|Appearance |`<<.controlpanel-tab Appearance>>` |<<.controlpanel-tab Appearance>> |
|Settings |`<<.controlpanel-tab Settings>>` |<<.controlpanel-tab Settings>> |
|Saving |`<<.controlpanel-tab Saving>>` |<<.controlpanel-tab Saving>> |
|Plugins |`<<.controlpanel-tab Plugins>>` |<<.controlpanel-tab Plugins>> |
|Tools |<<.info-tab Tools>> |
|References |<<.info-tab References>> |
|Tagging |<<.info-tab Tagging>> |
|List |<<.info-tab List>> |
|Listed |<<.info-tab Listed>> |
|Fields |<<.info-tab Fields>> |
|Advanced |<<.info-tab Advanced>> |
!! Parameters for .advancedsearch-tab
!!Parameters for .controlpanel-tab
|Standard |`<<.advancedsearch-tab Standard>>` |<<.advancedsearch-tab Standard>> |
|System |`<<.advancedsearch-tab System>>` |<<.advancedsearch-tab System>> |
|Shadows |`<<.advancedsearch-tab Shadows>>` |<<.advancedsearch-tab Shadows>> |
|Filter |`<<.advancedsearch-tab Filter>>` |<<.advancedsearch-tab Filter>> |
|Info |<<.controlpanel-tab Info>> |
|Appearance |<<.controlpanel-tab Appearance>> |
|Settings |<<.controlpanel-tab Settings>> |
|Saving |<<.controlpanel-tab Saving>> |
|Plugins |<<.controlpanel-tab Plugins>> |
! Buttons
!!Parameters for .advancedsearch-tab
|Macro |Used for |Example |Rendered |h
|.button |a standard button name and icon |`<<.button "new-tiddler">>` |<<.button "new-tiddler">> |
|Standard |<<.advancedsearch-tab Standard>> |
|System |<<.advancedsearch-tab System>> |
|Shadows |<<.advancedsearch-tab Shadows>> |
|Filter |<<.advancedsearch-tab Filter>> |
!! Parameters for .button
!Buttons
!!! Tiddler toolbar
|!Macro |!Used for |!Example |
|.button |a standard button name and icon |<<.button "new-tiddler">> |
|clone |`<<.button "clone">>` |<<.button "clone">> |
|close |`<<.button "close">>` |<<.button "close">> |
|close-others |`<<.button "close-others">>` |<<.button "close-others">> |
|edit |`<<.button "edit">>` |<<.button "edit">> |
|export-tiddler |`<<.button "export-tiddler">>` |<<.button "export-tiddler">> |
|info |`<<.button "info">>` |<<.button "info">> |
|more-tiddler-actions |`<<.button "more-tiddler-actions">>` |<<.button "more-tiddler-actions">> |
|new-here |`<<.button "new-here">>` |<<.button "new-here">> |
|new-journal-here |`<<.button "new-journal-here">>` |<<.button "new-journal-here">> |
|permalink |`<<.button "permalink">>` |<<.button "permalink">> |
!!Parameters for .button
!!! Edit-mode toolbar
!!!Tiddler toolbar
|cancel |`<<.button "cancel">>` |<<.button "cancel">> |
|delete |`<<.button "delete">>` |<<.button "delete">> |
|save |`<<.button "save">>` |<<.button "save">> |
|clone |<<.button "clone">> |
|close |<<.button "close">> |
|close-others |<<.button "close-others">> |
|edit |<<.button "edit">> |
|export-tiddler |<<.button "export-tiddler">> |
|info |<<.button "info">> |
|more-tiddler-actions |<<.button "more-tiddler-actions">> |
|new-here |<<.button "new-here">> |
|new-journal-here |<<.button "new-journal-here">> |
|permalink |<<.button "permalink">> |
!!! Page toolbar
!!!Edit-mode toolbar
|cancel |<<.button "cancel">> |
|delete |<<.button "delete">> |
|save |<<.button "save">> |
!!!Page toolbar
|advanced-search |<<.button "advanced-search">> |
|close-all |<<.button "close-all">> |
|control-panel |<<.button "control-panel">> |
|encryption |<<.button "encryption">> |
|export-page |<<.button "export-page">> |
|full-screen |<<.button "full-screen">> |
|home |<<.button "home">> |
|import |<<.button "import">> |
|language |<<.button "language">> |
|more-page-actions |<<.button "more-page-actions">> |
|new-journal |<<.button "new-journal">> |
|new-tiddler |<<.button "new-tiddler">> |
|permaview |<<.button "permaview">> |
|refresh |<<.button "refresh">> |
|save-wiki |<<.button "save-wiki">> |
|storyview |<<.button "storyview">> |
|tag-manager |<<.button "tag-manager">> |
|theme |<<.button "theme">> |
|advanced-search |`<<.button "advanced-search">>` |<<.button "advanced-search">> |
|close-all |`<<.button "close-all">>` |<<.button "close-all">> |
|control-panel |`<<.button "control-panel">>` |<<.button "control-panel">> |
|encryption |`<<.button "encryption">>` |<<.button "encryption">> |
|export-page |`<<.button "export-page">>` |<<.button "export-page">> |
|full-screen |`<<.button "full-screen">>` |<<.button "full-screen">> |
|home |`<<.button "home">>` |<<.button "home">> |
|import |`<<.button "import">>` |<<.button "import">> |
|language |`<<.button "language">>` |<<.button "language">> |
|more-page-actions |`<<.button "more-page-actions">>` |<<.button "more-page-actions">> |
|new-journal |`<<.button "new-journal">>` |<<.button "new-journal">> |
|new-tiddler |`<<.button "new-tiddler">>` |<<.button "new-tiddler">> |
|permaview |`<<.button "permaview">>` |<<.button "permaview">> |
|refresh |`<<.button "refresh">>` |<<.button "refresh">> |
|save-wiki |`<<.button "save-wiki">>` |<<.button "save-wiki">> |
|storyview |`<<.button "storyview">>` |<<.button "storyview">> |
|tag-manager |`<<.button "tag-manager">>` |<<.button "tag-manager">> |
|theme |`<<.button "theme">>` |<<.button "theme">> |

View File

@ -1,6 +1,8 @@
title: $:/ContributionBanner
tags: $:/tags/EditTemplate
created: 20240313115309914
list-after: $:/core/ui/EditTemplate/title
modified: 20240313115810689
tags: $:/tags/EditTemplate
title: $:/ContributionBanner
\define base-github()
https://github.com/Jermolene/TiddlyWiki5/edit/tiddlywiki-com/editions/tw5.com/tiddlers/
@ -10,7 +12,9 @@ https://github.com/Jermolene/TiddlyWiki5/edit/tiddlywiki-com/editions/tw5.com/ti
<$list filter="[[$:/config/OriginalTiddlerPaths]getindex<draft-of>]" variable="target" >
<div class="tc-improvement-banner">
{{$:/core/images/star-filled}} Can you help us improve this documentation? [[Find out how|Improving TiddlyWiki Documentation]] to
<a href={{{ [<target>addprefix<base-github>] }}} class="tc-tiddlylink-external" target="_blank" rel="noopener noreferrer">edit this tiddler on ~GitHub</a>
<a href={{{ [<draft-of>encodeuricomponent[]addprefix[https://saqimtiaz.github.io/tw5-docs-pr-maker/#]] }}} class="tc-tiddlylink-external" target="_blank" rel="noopener noreferrer">edit this tiddler in Docs PR Maker</a>
or
<a href={{{ [<target>addprefix<base-github>] }}} class="tc-tiddlylink-external" target="_blank" rel="noopener noreferrer">edit it directly on ~GitHub</a>
</div>
</$list>
</$set>

View File

@ -1,8 +1,12 @@
created: 20170126143833588
modified: 20220704174221300
modified: 20240310123352998
title: $:/deprecated
type: text/vnd.tiddlywiki
Deprecated features of TiddlyWiki are those that have been superseded by newer, improved ways of doing the same thing.
Deprecated features will still work, but are not recommended for new content.
''Tiddlers tagged'' $:/deprecated:
<<list-links filter:"[tag[$:/deprecated]]">>

View File

@ -7,6 +7,3 @@ type: text/vnd.tiddlywiki
Deprecated features are marked with a special warning button. See: [[How to apply custom styles by tag]] for an example.
''Tiddlers tagged `$:/deprecated`''
><<list-links "[tag[$:/deprecated]]">>

View File

@ -1,27 +1,47 @@
title: $:/editions/tw5.com/TiddlerInfo/Sources
tags: $:/tags/TiddlerInfo
caption: Sources
code-body: yes
created: 20240313090915565
modified: 20240313115026563
tags: $:/tags/TiddlerInfo
title: $:/editions/tw5.com/TiddlerInfo/Sources
\define static-link-base()
https://tiddlywiki.com/static/$(title)$.html
\function static-link-base() [[https://tiddlywiki.com/static/$(title)$.html]substitute[]]
\function github-link-base()
[[https://github.com/Jermolene/TiddlyWiki5/blob/tiddlywiki-com/editions/tw5.com/tiddlers/$(title)$]substitute[]]
\end
\define make-static-link()
\procedure make-static-link()
\whitespace trim
<$set name="title" filter="[<currentTiddler>encodeuricomponent[]encodeuricomponent[]]" select="0">
<a href=<<static-link-base>> class="tc-tiddlylink-external" target="_blank" rel="noopener noreferrer"><$text text=<<static-link-base>>/></a>
<a href=<<static-link-base>>
class="tc-tiddlylink-external"
target="_blank"
rel="noopener noreferrer"
>
<$text text=<<static-link-base>>/>
</a>
</$set>
\end
\define github-link-base()
https://github.com/Jermolene/TiddlyWiki5/blob/tiddlywiki-com/editions/tw5.com/tiddlers/$(title)$
\procedure make-github-link()
<$set name="title" value={{{ [[$:/config/OriginalTiddlerPaths]getindex<currentTiddler>] }}}>
<$set name="title" filter="[<title>encodeuricomponent[]]" select="0">
<a href=<<github-link-base>>
class="tc-tiddlylink-external"
target="_blank"
rel="noopener noreferrer"
>Link to "<$text text=<<currentTiddler>>/>" on github.com</a>
</$set>
</$set>
\end
\define make-github-link()
<$set name="title" value={{$:/config/OriginalTiddlerPaths##$(currentTiddler)$}}>
<$set name="title" filter="[<title>encodeuricomponent[]]" select="0">
<a href=<<github-link-base>> class="tc-tiddlylink-external" target="_blank" rel="noopener noreferrer"><$text text=<<github-link-base>>/></a>
</$set>
</$set>
\procedure make-pr-maker-link()
<a href={{{ [<currentTiddler>encodeuricomponent[]addprefix[https://saqimtiaz.github.io/tw5-docs-pr-maker/#]] }}}
class="tc-tiddlylink-external"
target="_blank"
rel="noopener noreferrer"
>Link to "<$text text=<<currentTiddler>>/>" in Docs PR Maker edition</a>
\end
<$list filter="[all[current]!is[system]!is[shadow]]">
@ -30,8 +50,9 @@ A static HTML representation of this tiddler is available at the URL:
* <<make-static-link>>
Help us to improve the documentation by sending a ~GitHub pull request for this tiddler:
Help us to [[improve the documentation|Improving TiddlyWiki Documentation]] by suggesting changes to this tiddler using the [[TiddlyWiki Docs PR Maker]] or directly on ~GitHub.
* <<make-pr-maker-link>>
* <<make-github-link>>
</$list>

View File

@ -1,81 +1,100 @@
code-body: yes
created: 20150117152607000
modified: 20230325141733992
modified: 20240317091700545
tags: $:/tags/Macro
title: $:/editions/tw5.com/doc-macros
type: text/vnd.tiddlywiki
\define .concat(1,2,3,4,5) $1$$2$$3$$4$$5$
\whitespace trim
\define .def(_) <dfn class="doc-def">$_$</dfn>
\define .em(_) <em class="doc-em">$_$</em>
\define .strong(_) <strong class="doc-strong">$_$</strong>
\define .place(_) <code class="doc-place">$_$</code>
\define .word(_) "$_$"
\function .concat(1,2,3,4,5) [[$(1)$$(2)$$(3)$$(4)$$(5)$]substitute[]]
\function .word(_) [["]] [<_>] =[["]] +[join[]]
\define .preamble(_) :.doc-preamble $_$
\define .note(_)
@@.doc-note
;Note
: $_$
@@
\procedure .def(_) <dfn class="doc-def"><<_>></dfn>
\procedure .em(_) <em class="doc-em"><<_>></em>
\procedure .strong(_) <strong class="doc-strong"><<_>></strong>
\procedure .place(_) <code class="doc-place"><<_>></code>
\procedure .preamble(_) <dl><dd class="doc-preamble"><<_>></dd></dl>
\procedure .tid(_) <code class="doc-tiddler"><<_>></code>
\procedure .tag(_) <code class="doc-tag"><<_>></code>
\procedure .field(_) <code class="doc-field"><<_>></code>
\procedure .value(_) <code class="doc-value"><<_>></code>
\procedure .op(_) <code class="doc-operator"><<_>></code>
\procedure .var(_) <code class="doc-var"><<_>></code>
\procedure .wid(_) <code class="doc-widget"><$macrocall $name=".concat" 1="$" 2=<<_>>/></code>
\procedure .attr(_) <code class="doc-attr"><<_>></code>
\procedure .param(_) <code class="doc-param"><<_>></code>
\procedure .tiddler-fields(tiddler)
<$tiddler tiddler=<<tiddler>>>
<div class="doc-tiddler-fields">
<h2>
<$link>
<span class="tc-tiddler-title-icon">{{||$:/core/ui/TiddlerIcon}}</span><$text text=<<currentTiddler>>/>
</$link>
</h2>
<table class="tc-view-field-table">
<tbody>
<$list filter="[all[current]fields[]sort[title]] -title" template="$:/core/ui/TiddlerFieldTemplate" variable="listItem"/>
</tbody>
</table>
</div>
</$tiddler>
\end
\define .tid(_) <code class="doc-tiddler">$_$</code>
\define .tag(_) <code class="doc-tag">$_$</code>
\define .field(_) <code class="doc-field">$_$</code>
\define .value(_) <code class="doc-value">$_$</code>
\define .op(_) <code class="doc-operator">$_$</code>
\define .var(_) <code class="doc-var">$_$</code>
\define .wid(_) <code class="doc-widget">$$_$</code>
\define .attr(_) <code class="doc-attr">$_$</code>
\define .param(_) <code class="doc-param">$_$</code>
\function .mtitle(_) [<_>] Macro +[join[ ]]
\function .otitle(_) [<_>] Operator +[join[ ]]
\function .vtitle(_) [<_>] Variable +[join[ ]]
\define .mtitle(_) $_$ Macro
\define .otitle(_) $_$ Operator
\define .vtitle(_) $_$ Variable
\procedure .link(_,to) <$link to=<<to>> ><<_>></$link>
\procedure .clink(_,to) <span class="doc-clink"><$link to=<<to>>><<_>></$link></span>
\define .link(_,to) <$link to="$to$">$_$</$link>
\define .clink(_,to) <span class="doc-clink"><<.link """$_$""" "$to$">></span>
\define .dlink(_,to) <$macrocall $name=".link" _=<<.def "$_$">> to="$to$">/>
\define .dlink-ex(_,to) <a href="$to$" class="tc-tiddlylink-external" target="_blank" rel="noopener noreferrer"><<.def "$_$">></a>
\define .flink(to) <$macrocall $name=".link" _=<<.field {{$to$!!caption}}>> to="$to$"/>
\define .mlink(_,to) <$macrocall $name=".link" _=<<.var "$_$">> to=<<.mtitle "$_$">>/>
\define .mlink2(_,to) <$macrocall $name=".link" _=<<.var "$_$">> to="$to$"/>
\define .olink(_) <$macrocall $name=".link" _=<<.op "$_$">> to=<<.otitle "$_$">>/>
\define .olink2(_,to) <$macrocall $name=".link" _=<<.op "$_$">> to=<<.otitle "$to$">>/>
\define .vlink(_,to) <$macrocall $name=".link" _=<<.var "$_$">> to=<<.vtitle "$_$">>/>
\define .vlink2(_,to) <$macrocall $name=".link" _=<<.var "$_$">> to="$to$"/>
\define .wlink(to) <$macrocall $name=".link" _=<<.wid {{$to$!!caption}}>> to="$to$"/>
\define .wlink2(_,to) <$macrocall $name=".link" _="$_$" to="$to$"/>
\procedure .dlink(_,to) <$link to=<<to>>><$macrocall $name=".def" _=<<_>>/></$link>
\define .key(_) <span class="doc-key">$_$</span>
\define .combokey(_) <$macrocall $name=".if" cond="$_$" then=<<.key '$_$'>>/>
\define .keycombo(1,2,3,4) <<.combokey "$1$">><<.if "$2$" +>><<.combokey "$2$">><<.if "$3$" +>><<.combokey "$3$">><<.if "$4$" +>><<.combokey "$4$">>
\procedure .dlink-ex(_,to) <a href=<<to>> class="tc-tiddlylink-external" target="_blank" rel="noopener noreferrer"><$macrocall $name=".def" _=<<_>>/></a>
\procedure .flink(to) <$macrocall $name=".link" _=`<<.field {{$(to)$!!caption}}>>` to=<<to>>/>
\define .tab(_) <span class="doc-tab">{{$_$!!caption}}</span>
\define .sidebar-tab(_) <<.tab "$:/core/ui/SideBar/$_$">>
\define .more-tab(_) <<.tab "$:/core/ui/MoreSideBar/$_$">>
\define .info-tab(_) <<.tab "$:/core/ui/TiddlerInfo/$_$">>
\define .controlpanel-tab(_) <<.tab "$:/core/ui/ControlPanel/$_$">>
\define .advancedsearch-tab(_) <<.tab "$:/core/ui/AdvancedSearch/$_$">>
\define .toc-tab() <<.tab "TableOfContents">>
\define .example-tab(_) <span class="doc-tab">$_$</span>
\procedure .mlink(_) <$link to={{{ [.mtitle<_>] }}}><$macrocall $name=".var" _=<<_>>/> </$link>
\procedure .mlink2(_,to) <$link to=<<to>>><$macrocall $name=".var" _=<<_>>/> </$link>
\define .doc-tabs()
\procedure .olink(_) <$link to={{{ [.otitle<_>] }}}><$macrocall $name=".op" _=<<_>>/> </$link>
\procedure .olink2(_,to) <$link to={{{ [.otitle<to>] }}}><$macrocall $name=".op" _=<<_>>/> </$link>
\procedure .vlink(_) <$link to={{{ [.vtitle<_>] }}}><$macrocall $name=".var" _=<<_>>/> </$link>
\procedure .vlink2(_,to) <$link to=<<to>>><$macrocall $name=".var" _=<<_>>/></$link>
\procedure .wlink(to) <$link to=<<to>> > <$macrocall $name=".wid" _={{{ [<to>get[caption]] }}}> </$link>
\procedure .wlink2(_,to) <$link to=<<to>> ><<_>></$link>
\procedure .key(_) <span class="doc-key"><<_>></span>
\procedure .keys(_) <span class="doc-key"><<_>></span>
\procedure .tab(_) <span class="doc-tab"><$transclude $tiddler=<<_>> $field=caption ><<_>></$transclude></span>
\procedure .sidebar-tab(_) <$macrocall $name=".tab" _=`$:/core/ui/SideBar/$(_)$`/>
\procedure .more-tab(_) <$macrocall $name=".tab" _=`$:/core/ui/MoreSideBar/$(_)$`/>
\procedure .info-tab(_) <$macrocall $name=".tab" _=`$:/core/ui/TiddlerInfo/$(_)$`/>
\procedure .controlpanel-tab(_) <$macrocall $name=".tab" _=`$:/core/ui/ControlPanel/$(_)$`/>
\procedure .advancedsearch-tab(_) <$macrocall $name=".tab" _=`$:/core/ui/AdvancedSearch/$(_)$`/>
\procedure .toc-tab() <$macrocall $name=".tab" _="TableOfContents"/>
\procedure .example-tab(_) <span class="doc-tab"><<_>></span>
\procedure .doc-tabs()
<$macrocall $name="tabs"
tabsList="[tag<currentTiddler>description[tab]]"
default={{{ [tag<currentTiddler>first[]] }}}
explicitState={{{ [<currentTiddler>addprefix[$:/state/tab/]] }}}
class={{{ [[doc-tabs]] [<currentTiddler>encodeuricomponent[]escapecss[]addprefix[doc-tabs-]] +[join[ ]] }}} />
tabsList="[tag<currentTiddler>description[tab]]"
default={{{ [tag<currentTiddler>first[]] }}}
explicitState={{{ [<currentTiddler>addprefix[$:/state/tab/]] }}}
class={{{ [[doc-tabs]] [<currentTiddler>encodeuricomponent[]escapecss[]addprefix[doc-tabs-]] +[join[ ]] }}} />
\end
\define .doc-tab-link(text, target, tooltip:"", class:"")
\procedure .doc-tab-link(text, target, tooltip:"", class:"")
<!-- figure out where the addressed doc-tabs are -->
<$tiddler tiddler={{{ [<currentTiddler>search:text[.doc-tabs]] :else[<currentTiddler>tags[]search:text[.doc-tabs]first[]] :else[<currentTiddler>] }}} >
<$button class={{{ [[tc-btn-invisible tc-tiddlylink]] [<__class__>] +[join[ ]] }}}
set={{{ [<currentTiddler>addprefix[$:/state/tab/]] }}}
setTo=<<__target__>>
tooltip=<<__tooltip__>>>
<<__text__>>
<$button class={{{ [[tc-btn-invisible tc-tiddlylink]] [<class>] +[join[ ]] }}}
set={{{ [<currentTiddler>addprefix[$:/state/tab/]] }}}
setTo=<<target>>
tooltip=<<tooltip>>>
<<text>>
<!-- if tiddler with tabs is open, scroll to tabs, otherwise open that tiddler (relevant from within tab subtiddlers) -->
<$list filter="[[$:/StoryList]contains<currentTiddler>]" variable="ignore" emptyMessage="<$action-navigate />">
<$action-sendmessage $message="tm-scroll" selector={{{ [<currentTiddler>encodeuricomponent[]addprefix[.doc-tabs-]] }}} />
@ -84,136 +103,128 @@ type: text/vnd.tiddlywiki
</$button>
</$tiddler>
\end
\define .widget-attr-link(text, target)
\procedure .widget-attr-link(text, target)
<$macrocall $name=".doc-tab-link"
text={{{ [[<code class="doc-attr">]] [<__text__>] [[</code>]] +[join[]] }}}
class="doc-tab-link"
target=<<__target__>>
tooltip={{{ [[Show more information about the ']] [<__text__>] [[' attribute]] +[join[]] }}} />
text={{{ [[<code class="doc-attr">]] [<text>] [[</code>]] +[join[]] }}}
class="doc-tab-link"
target=<<target>>
tooltip={{{ [[Show more information about the ']] [<text>] [[' attribute]] +[join[]] }}} />
\end
\define .button(_) <span class="doc-button">{{$:/core/ui/Buttons/$_$!!caption}}</span>
\procedure .button(_) <span class="doc-button"><$transclude $tiddler=`$:/core/ui/Buttons/$(_)$` $field="caption" ><<_>></$transclude></span>
\define .icon(_) <span class="doc-icon">{{$_$}}</span>
\procedure .icon(_) <span class="doc-icon"><$transclude $tiddler=<<_>>/></span>
\define .tip(_) <div class="doc-icon-block"><div class="doc-block-icon">{{$:/core/images/tip}}</div> $_$</div>
\define .warning(_) <div class="doc-icon-block"><div class="doc-block-icon">{{$:/core/images/warning}}</div> $_$</div>
\procedure .infoBox(text:"", title, icon:"$:/core/images/info-button", class, iconSize:"1.4rem")
\function _f.tipClass() [[doc-icon-block]] [<class>!is[blank]then<class>] +[join[ ]]
<div class=<<_f.tipClass>>>
<%if [<title>!is[blank]] %><div>''<<title>>''</div><% endif %>
<div class="doc-block-icon"><$transclude $tiddler=<<icon>> size=<<iconSize>>/></div>
<<text>>
</div>
\end
\define .state-prefix() $:/state/editions/tw5.com/
\procedure .note(_:"", title:"Note", icon:"$:/core/images/info-button", class:"doc-note", iconSize:"22pt")
<$macrocall $name=".infoBox" text=<<_>> title=<<title>> icon=<<icon>> class=<<class>> iconSize=<<iconSize>>/>
\end
\define .lorem()
\procedure .tip(_:"", title:"Tip" , icon:"$:/core/images/tip", class:"doc-tip", iconSize:"22pt")
<$macrocall $name=".infoBox" text=<<_>> title=<<title>> icon=<<icon>> class=<<class>> iconSize=<<iconSize>>/>
\end
\procedure .warning(_:"", title:"Warning", icon:"$:/core/images/warning", class:"doc-warning", iconSize:"22pt")
<$macrocall $name=".infoBox" text=<<_>> title=<<title>> icon=<<icon>> class=<<class>> iconSize=<<iconSize>>/>
\end
\procedure .state-prefix() $:/state/editions/tw5.com/
\procedure .lorem()
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end
\define .toc-lorem()
\procedure .toc-lorem()
This is an example tiddler. See [[Table-of-Contents Macros (Examples)]].
<<.lorem>>
\end
\define .example(n,eg,egvar:NO-SUCH-VAR)
\procedure .example(n,eg,egvar)
<$let eg={{{ [<egvar>!is[blank]getvariable[]] :else[<eg>] }}}>
<div class="doc-example">
<$reveal default="$egvar$" type="match" text="NO-SUCH-VAR">
<$macrocall $name="copy-to-clipboard-above-right" src="""$eg$"""/>
<$codeblock code="""$eg$"""/>
</$reveal>
<$reveal default="$egvar$" type="nomatch" text="NO-SUCH-VAR">
<!-- allow an example to contain """ -->
<$macrocall $name="copy-to-clipboard-above-right" src=<<$egvar$>>/>
<$codeblock code=<<$egvar$>>/>
</$reveal>
<$list filter="[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix[$n$]]" variable=".state">
<$reveal state=<<.state>> type="nomatch" text="show">
<dl>
<dd><$button set=<<.state>> setTo="show">Try it</$button></dd>
</dl>
</$reveal>
<$reveal state=<<.state>> type="match" text="show">
<dl>
<dd><$button set=<<.state>> setTo="">Hide</$button></dd>
</dl>
<blockquote class="doc-example-result">
<$reveal default="$egvar$" type="match" text="NO-SUCH-VAR">
$$$text/vnd.tiddlywiki
$eg$
$$$
</$reveal>
<$reveal default="$egvar$" type="nomatch" text="NO-SUCH-VAR">
<<$egvar$>>
</$reveal>
</blockquote>
</$reveal>
</$list>
<$macrocall $name="copy-to-clipboard-above-right" src=<<eg>>/>
<$codeblock code=<<eg>>/>
<$list filter=`[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix[$(n)$]]` variable=".state">
<$reveal state=<<.state>> type="nomatch" text="show">
<dl>
<dd><$button set=<<.state>> setTo="show">Try it</$button></dd>
</dl>
</$reveal>
<$reveal state=<<.state>> type="match" text="show">
<dl>
<dd><$button set=<<.state>> setTo="">Hide</$button></dd>
</dl>
<blockquote class="doc-example-result">
<$transclude $variable="eg" $mode="block"/>
</blockquote>
</$reveal>
</$list>
</div>
</$let>
\end
\define .bad-example(eg)
\procedure .bad-example(eg)
<table class="doc-bad-example">
<tbody>
<tr class="evenRow">
<td><span style="font-size:1.5em;">&#9888;</span> Warning:<br> Don't do it this way!</td>
<td>
$eg$
</td>
</tr>
</tbody>
<tbody>
<tr class="evenRow">
<td>
<span class="tc-small-gap-right" style="font-size:1.5em;">&#9888;</span>
Warning:<br> Don't do it this way!
</td>
<td>
<$transclude $variable="eg" $mode="block"/>
</td>
</tr>
</tbody>
</table>
\end
\define .link-badge(text,link,colour)
<a href=<<__link__>> class="doc-link-badge" style="background-color:$colour$;" target="_blank" rel="noopener noreferrer"><$text text=<<__text__>>/></a>
\procedure .link-badge(text,link,colour)
<a href=<<link>> class="doc-link-badge" style.background-color=<<colour>> target="_blank" rel="noopener noreferrer">
<$text text=<<text>>/>
</a>
\end
<!-- TODO use $:/palette colour settings -->
\procedure .link-badge-added(link,colour:#ffe246) <$macrocall $name=".link-badge" text="added" link=<<link>> colour=<<colour>>/>
\procedure .link-badge-addendum(link,colour:#fcc84a) <$macrocall $name=".link-badge" text="addendum" link=<<link>> colour=<<colour>>/>
\procedure .link-badge-extended(link,colour:#f9a344) <$macrocall $name=".link-badge" text="extended" link=<<link>> colour=<<colour>>/>
\procedure .link-badge-fixed(link,colour:#ffa86d) <$macrocall $name=".link-badge" text="fixed" link=<<link>> colour=<<colour>>/>
\procedure .link-badge-here(link,colour:#d88e63) <$macrocall $name=".link-badge" text="here" link=<<link>> colour=<<colour>>/>
\procedure .link-badge-hide(link,colour:#9d959f) <$macrocall $name=".link-badge" text="hide" link=<<link>> colour=<<colour>>/>
\procedure .link-badge-improved(link,colour:#7593c7) <$macrocall $name=".link-badge" text="improved" link=<<link>> colour=<<colour>>/>
\procedure .link-badge-modified(link,colour:#7f99c9) <$macrocall $name=".link-badge" text="modified" link=<<link>> colour=<<colour>>/>
\procedure .link-badge-removed(link,colour:#a9aabc) <$macrocall $name=".link-badge" text="removed" link=<<link>> colour=<<colour>>/>
\procedure .link-badge-renamed(link,colour:#b4b995) <$macrocall $name=".link-badge" text="renamed" link=<<link>> colour=<<colour>>/>
\procedure .link-badge-updated(link,colour:#91ba66) <$macrocall $name=".link-badge" text="updated" link=<<link>> colour=<<colour>>/>
\define .link-badge-added(link,colour:#ffe246) <<.link-badge "added" """$link$""" """$colour$""">>
\define .link-badge-addendum(link,colour:#fcc84a) <<.link-badge "addendum" """$link$""" """$colour$""">>
\define .link-badge-extended(link,colour:#f9a344) <<.link-badge "extended" """$link$""" """$colour$""">>
\define .link-badge-fixed(link,colour:#ffa86d) <<.link-badge "fixed" """$link$""" """$colour$""">>
\define .link-badge-here(link,colour:#d88e63) <<.link-badge "here" """$link$""" """$colour$""">>
\define .link-badge-hide(link,colour:#9d959f) <<.link-badge "hide" """$link$""" """$colour$""">>
\define .link-badge-improved(link,colour:#7593c7) <<.link-badge "improved" """$link$""" """$colour$""">>
\define .link-badge-modified(link,colour:#7f99c9) <<.link-badge "modified" """$link$""" """$colour$""">>
\define .link-badge-removed(link,colour:#a9aabc) <<.link-badge "removed" """$link$""" """$colour$""">>
\define .link-badge-renamed(link,colour:#b4b995) <<.link-badge "renamed" """$link$""" """$colour$""">>
\define .link-badge-updated(link,colour:#91ba66) <<.link-badge "updated" """$link$""" """$colour$""">>
\define .tiddler-fields(tiddler)
<$tiddler tiddler=<<__tiddler__>>>
<div class="doc-tiddler-fields">
<h2>
<$link>
<span class="tc-tiddler-title-icon">{{||$:/core/ui/TiddlerIcon}}</span><$text text=<<currentTiddler>>/>
</$link>
</h2>
<table class="tc-view-field-table">
<tbody>
<$list filter="[all[current]fields[]sort[title]] -title" template="$:/core/ui/TiddlerFieldTemplate" variable="listItem"/>
</tbody>
</table>
</div>
</$tiddler>
\procedure .banner-credits(credit,url)
<img src=<<url>> width="140" style="float:left;margin-right:0.5em;"/>
<<credit>>
<div style="clear:both;"/>
\end
\define .banner-credits(credit,url)
<img src=<<__url__>> width="140" style="float:left;margin-right:0.5em;"/>
$credit$
<div style="clear:both;">
</div>
\end
\define .contributors(usernames)
\procedure .contributors(usernames)
<ol class="doc-github-contributors">
<$list filter="[enlist<__usernames__>sort[]]" variable="username">
<li>
<a href={{{ [[https://github.com/]addsuffix<username>] }}} class="tc-tiddlylink-external" target="_blank" rel="noopener noreferrer"><img src={{{ [[https://github.com/]addsuffix<username>addsuffix[.png?size=64]] }}} width="64" height="64"/><span class="doc-github-contributor-username">@<$text text=<<username>>/></span></a>
</li>
</$list>
<$list filter="[enlist<usernames>sort[]]" variable="username">
<li>
<a href={{{ [[https://github.com/]addsuffix<username>] }}} class="tc-tiddlylink-external" target="_blank" rel="noopener noreferrer">
<img src={{{ [[https://github.com/]addsuffix<username>addsuffix[.png?size=64]] }}} width="64" height="64"/>
<span class="doc-github-contributor-username">
@<$text text=<<username>>/>
</span>
</a>
</li>
</$list>
</ol>
\end
<pre><$view field="text"/></pre>

View File

@ -1,3 +1,4 @@
code-body: yes
created: 20150117152612000
modified: 20240223123123497
tags: $:/tags/Stylesheet
@ -31,6 +32,7 @@ type: text/vnd.tiddlywiki
color: <<color very-muted-foreground>>;
font-style: normal;
font-weight: bold;
padding: 0;
}
.doc-button,
@ -85,7 +87,6 @@ td svg {
.doc-preamble {
border: 2px solid <<colour code-border>>;
color: <<colour very-muted-foreground>>;
font-size: 90%;
margin-left: 0;
padding: 0.5em 0.7em;
}
@ -112,7 +113,7 @@ td svg {
}
.doc-example input[type=search] {
width: 95%;
width: 95%;
}
.doc-example pre:first-child {
margin-top: 0;
@ -138,7 +139,7 @@ td svg {
}
.doc-bad-example code, .doc-bad-example pre, table.doc-bad-example {
background-color:#ffff80;
background-color:#ffff80;
}
.doc-table th, .doc-table tr {
@ -164,19 +165,37 @@ tr.doc-table-subheading {
}
.doc-icon-block {
border-left: 2px solid <<colour code-border>>;
margin-left: 3em;
border-left: 4px solid <<colour blockquote-bar>>;
margin: 15px 0 15px 3em;
padding-left: 0.6em;
position: relative;
}
.doc-block-icon {
position: absolute;
left: -3em;
top: 0.2em;
}
.doc-icon-block.doc-note {
border-left: 4px solid <<colour blockquote-bar>>;
background: <<colour blockquote-bar>>11;
}
.doc-icon-block.doc-tip {
border-left: 4px solid <<colour primary>>;
background: <<colour primary>>11;
}
.doc-icon-block.doc-warning {
border-left: 4px solid <<colour alert-highlight>>;
background: <<colour alert-highlight>>11;
}
.doc-block-icon .tc-image-tip {
fill: <<colour primary>>;
}
.doc-block-icon .tc-image-warning {
fill: <<colour alert-highlight>>;
}
@ -246,7 +265,6 @@ a.doc-deprecated-version.tc-tiddlylink {
height: 1em;
}
.doc-tiddler-fields table,
.doc-tiddler-fields h2 {
margin: 0.5em 0;
@ -299,13 +317,13 @@ ol.doc-github-contributors li {
color: #666;
}
.doc-tabs.tc-tab-buttons button {
font-size: 1rem;
padding: 0.5em;
font-size: 1rem;
padding: 0.5em;
}
.doc-tabs button .doc-attr {
background-color: unset;
color: #666;
background-color: unset;
color: #666;
}
.doc-tab-link .doc-attr {
color: unset;
color: unset;
}

View File

@ -1,10 +1,10 @@
title: $:/editions/tw5.com/download-empty
code-body: yes
\define saveTiddlerFilter()
\procedure saveTiddlerFilter()
[[$:/core]] [[$:/isEncrypted]] [[$:/themes/tiddlywiki/snowwhite]] [[$:/themes/tiddlywiki/vanilla]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]
\end
\define savingEmpty()
yes
\end
\procedure savingEmpty() yes
{{$:/core/templates/tiddlywiki5.html}}

View File

@ -1,27 +1,28 @@
code-body: yes
created: 20230316112235083
list-before: $:/core/ui/ViewTemplate/body
modified: 20230326145802667
modified: 20240229161432000
tags: $:/tags/ViewTemplate
title: $:/editions/tw5.com/filter-run-template
type: text/vnd.tiddlywiki
\define .op-place()
<$macrocall $name=".if"
cond="""$(op-name)$"""
then="<<.place '$(op-name)$'>> = "
else=""/>
\end
\define .op-row()
<$macrocall $name=".if"
cond="""$(op-body)$"""
then="""<tr><th align="left">$(op-head)$</th><td><<.op-place>>$(op-body)$</td></tr>"""
else=""/>
\end
\whitespace trim
\procedure .op-place()
<% if [<op-name>!is[blank]] %>
<$macrocall $name=".place" _=<<op-name>> /><span class="tc-tiny-gap">=</span>
<% endif %>
\end
\procedure .op-row()
<% if [<op-body>!is[blank]] %>
<tr>
<th align="left"><<op-head>></th>
<td><<.op-place>><<op-body>></td>
</tr>
<% endif %>
\end
<$list filter="[all[current]tag[Named Filter Run Prefix]]">
<$let op-head="" op-body="" op-name="">
<table class="doc-table">

View File

@ -1,52 +1,66 @@
created: 20150117152607000
modified: 20230617183916622
modified: 20240229132501000
tags: $:/tags/Macro
code-body: yes
title: $:/editions/tw5.com/operator-macros
\define .operator-examples(op,text:"Examples") <$link to="$op$ Operator (Examples)">$text$</$link>
\whitespace trim
\procedure .operator-examples(op,text:"Examples") <$link to=`$(op)$ Operator (Examples)`><<text>></$link>
\procedure .operator-example-tryit-actions() <$action-setfield $tiddler=<<.state>> text="show" filter=<<eg>>/>
\procedure .operator-example(n,eg,ie)
<div class="doc-example">
<$list filter="[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix<n>]" variable=".state">
<$reveal state=<<.state>> type="nomatch" text="show">
<code><$text text=<<eg>>/></code>
<$macrocall $name=".if" cond=<<ie>> then={{{[[<dd>&rarr; ]addsuffix<ie>addsuffix[</dd>]]}}}/>
<dl>
<dd><$button actions=<<.operator-example-tryit-actions>>>Try it</$button></dd>
</dl>
</$reveal>
<$reveal state=<<.state>> type="match" text="show">
<$edit-text tiddler=<<.state>> field="filter" tag="input" type=search focus="true"/>
<dl>
<dd>
<$button set=<<.state>> setTo="">Hide</$button>
<$reveal stateTitle=<<.state>> stateField="filter" type="nomatch" text=<<eg>>>
<$button actions=<<.operator-example-tryit-actions>>>Reset</$button>
</$reveal>
</dd>
</dl>
<blockquote class="doc-example-result">
<ul><$list filter={{{[<.state>get[filter]]}}} emptyMessage="(empty)">
<li><$link><$view field="title"/></$link></li>
</$list></ul>
</blockquote>
</$reveal>
</$list>
<$list filter="[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix<n>]" variable=".state">
<$reveal state=<<.state>> type="nomatch" text="show">
<code><$text text=<<eg>>/></code>
<% if [<ie>!is[blank]] %>
<dd>&rarr;&nbsp;<<ie>></dd>
<% endif %>
<dl>
<dd><$button actions=<<.operator-example-tryit-actions>>>Try it</$button></dd>
</dl>
</$reveal>
<$reveal state=<<.state>> type="match" text="show">
<$edit-text tiddler=<<.state>> field="filter" tag="input" type=search focus="true"/>
<dl>
<dd>
<$button set=<<.state>> setTo="">Hide</$button>
<$reveal stateTitle=<<.state>> stateField="filter" type="nomatch" text=<<eg>>>
<$button actions=<<.operator-example-tryit-actions>>>Reset</$button>
</$reveal>
</dd>
</dl>
<blockquote class="doc-example-result">
<ul>
<$list filter={{{[<.state>get[filter]]}}} emptyMessage="(empty)">
<li><$link><$view field="title"/></$link></li>
</$list>
</ul>
</blockquote>
</$reveal>
</$list>
</div>
\end
\define .inline-operator-example(eg)
<code><$text text=<<__eg__>>/></code> evaluates to <$list filter=<<__eg__>> emptyMessage="(empty)"> <code><$text text=<<currentTiddler>>/></code> </$list>
\procedure .inline-operator-example(eg)
<code>
<$text text=<<eg>>/>
</code>
<span class="tc-tiny-gap">evaluates to</span>
<$list filter=<<eg>> emptyMessage="(empty)">
<code class="tc-tiny-gap-left"><$text text=<<currentTiddler>>/></code>
</$list>
\end
\define .this-is-operator-example() This example tiddler is used to illustrate some of the [[Filter Operators]].
\define .using-days-of-week() These examples make use of the [[Days of the Week]] tiddler.
\define .s-matching-is-case-sensitive() In looking for matches for <<.place S>>, capital and lowercase letters are treated as different.
\define .node-only-operator()
\procedure .node-only-operator()
<$macrocall $name=".note" _="This operator is <<.em not>> available when ~TiddlyWiki is running in a web browser."/>
\end
<pre><$view field="text"/></pre>

View File

@ -1,26 +1,26 @@
created: 20150203173506000
modified: 20240229155612000
list-before: $:/core/ui/ViewTemplate/body
modified: 20230602181119360
tags: $:/tags/ViewTemplate
code-body: yes
title: $:/editions/tw5.com/operator-template
\define .op-place()
<$macrocall $name=".if"
cond="""$(op-name)$"""
then="<<.place '$(op-name)$'>> = "
else=""/>
\end
\define .op-row()
<$macrocall $name=".if"
cond="""$(op-body)$"""
then="""<tr><th align="left">$(op-head)$</th><td><<.op-place>>$(op-body)$</td></tr>"""
else=""/>
\end
\whitespace trim
\procedure .op-place()
<% if [<op-name>!is[blank]] %>
<$macrocall $name=".place" _=<<op-name>> /><span class="tc-tiny-gap">=</span>
<% endif %>
\end
\procedure .op-row()
<% if [<op-body>!is[blank]] %>
<tr>
<th align="left"><<op-head>></th><td><<.op-place>><<op-body>></td>
</tr>
<% endif %>
\end
<$list filter="[all[current]tag[Filter Operators]]">
<$let op-head="" op-body="" op-name="">
<table class="doc-table before-tiddler-body">

View File

@ -1,21 +1,26 @@
created: 20150228114241000
modified: 20220227210136243
tags: $:/tags/Macro
code-body: yes
title: $:/editions/tw5.com/variable-macros
\define .variable-examples(v,text:"Examples") <$link to="$v$ Variable (Examples)">$text$</$link>
\define .macro-examples(m,text:"Examples") <$link to="$m$ Macro (Examples)">$text$</$link>
\define .widget-examples(w,text:"Examples") <$link to="$w$ Widget (Examples)">$text$</$link>
\procedure .variable-examples(v,text:"Examples") <$link to=`$(v)$ Variable (Examples)`><<text>></$link>
\procedure .macro-examples(m,text:"Examples") <$link to=`$(m)$ Macro (Examples)`><<text>></$link>
\procedure .widget-examples(w,text:"Examples") <$link to=`$(w)$ Widget (Examples)`><<text>></$link>
\define .js-macro-link(_) [[$_$|https://tiddlywiki.com/dev/index.html#JavaScript%20Macros]]
\define .this-is-static-link-variable() <<.tip "This variable has no useful effect when ~TiddlyWiki is running in a browser, as the `href` attribute is ignored there -- links between tiddlers are performed by JavaScript instead. The variable comes into play when one is using the [[Node.js configuration|TiddlyWiki on Node.js]] to [[generate a static version|RenderTiddlersCommand]] of a wiki.">>
\define .this-is-toolbar-config-variable(configTiddler)
It can be set to <<.value yes>> or <<.value no>> prior to transcluding such a button.
The standard page template sets it to the value found in [[$configTiddler$]], with the result that this becomes the default for the whole page. The user can adjust this default by using a tickbox on the <<.controlpanel-tab Settings>> tab of the [[Control Panel|$:/ControlPanel]].
\procedure .js-macro-link(_)
<a href="https://tiddlywiki.com/dev/index.html#JavaScript%20Macros"
class="tc-tiddlylink-external"
target="_blank"
rel="noopener noreferrer"
><$text text=<<_>>/></a>
\end
<pre><$view field="text"/></pre>
\procedure .this-is-static-link-variable() <<.note "This variable has no useful effect when ~TiddlyWiki is running in a browser, as the `href` attribute is ignored there -- links between tiddlers are performed by JavaScript instead. The variable comes into play when one is using the [[Node.js configuration|TiddlyWiki on Node.js]] to [[generate a static version|RenderTiddlersCommand]] of a wiki.">>
\procedure .this-is-toolbar-config-variable(configTiddler)
\whitespace notrim
It can be set to <<.value yes>> or <<.value no>> prior to transcluding such a button.
The standard page template sets it to the value found in <$link to=<<configTiddler>>><<configTiddler>></$link>, with the result that this becomes the default for the whole page. The user can adjust this default by using a tickbox on the <<.controlpanel-tab Settings>> tab of the [[Control Panel|$:/ControlPanel]].
\end

View File

@ -1,21 +1,38 @@
code-body: yes
created: 20161008085627406
modified: 20231206135257498
modified: 20240229155633000
tags: $:/tags/Macro
title: $:/editions/tw5.com/version-macros
type: text/vnd.tiddlywiki
\procedure .from-version-reference() 5.3.0
\whitespace trim
\function tf.from-version-reference() 5.3.0
\procedure .from-version-template(class, text)
<$link to={{{ [<version>addprefix[Release ]] }}} class=<<class>> >@@.tc-tiny-gap-right {{$:/core/images/info-button}}@@<<text>><<version>></$link>
<$link to={{{ [<version>addprefix[Release ]] }}} class=<<class>> >
<span class="tc-tiny-gap-right">
{{$:/core/images/info-button}}
</span>
<<text>><<version>>
</$link>
\end
\procedure .from-version(version)
<$list filter="[<version>compare:version:gteq<.from-version-reference>]"><<.from-version-template "doc-from-version doc-from-version-new" "New in v">></$list>
<$list filter="[<version>compare:version:lt<.from-version-reference>]"><<.from-version-template "doc-from-version" "Introduced in v">></$list>
<% if [<version>compare:version:gteq<tf.from-version-reference>] %>
<<.from-version-template "doc-from-version doc-from-version-new" "New in v">>
<% else %>
<<.from-version-template "doc-from-version" "Introduced in v">>
<% endif %>
\end
\define .deprecated-since(version, superseded:"TODO-Link")
<$link to="Deprecated - What does it mean" class="doc-deprecated-version tc-btn-invisible">{{$:/core/images/warning}} Deprecated since: <$text text=<<__version__>>/></$link> (see <$link to=<<__superseded__>>><$text text=<<__superseded__>>/></$link>)
\procedure .deprecated-since(version, superseded:"TODO-Link")
<$link to="Deprecated - What does it mean" class="doc-deprecated-version tc-btn-invisible">
{{$:/core/images/warning}}
<span class="tc-tiny-gap">Deprecated since:</span>
<$text text=<<version>>/>
</$link>
<span class="tc-tiny-gap-left">
(see <$link class="tc-tiny-gap-left" to=<<superseded>>><$text text=<<superseded>>/></$link>)
</span>
\end

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