1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-29 21:09:56 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/webserver/Using the external JavaScript template.tid

101 lines
5.7 KiB
Plaintext
Raw Normal View History

created: 20180905075846391
modified: 20221207112242775
tags: [[WebServer Guides]]
title: Using the external JavaScript template
type: text/vnd.tiddlywiki
You can use a special template to externalise ~TiddlyWiki's core code into a separate file. This configuration allows the browser to cache the core for improved efficiency.
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
! Background
~TiddlyWiki in the single file configuration ordinarily packs everything into a single file: your data, and the ~JavaScript, CSS and HTML comprising ~TiddlyWiki itself. This lack of dependencies is usually very convenient: it means that it is impossible for the parts of a ~TiddlyWiki to become separated, and enormously improves the chances of it still functioning in the future.
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
However, there is some inefficiency in this arrangement because the core code is repeatedly loaded and saved every time the content of the wiki is saved. This inefficiency is partially ameliorated when working in the client server configuration because once the wiki is loaded by the browser the synchronisation process only transmits individual tiddlers back and forth to the server.
The remaining inefficiency when working in the client server configuration is that the single page wiki that is initially loaded will contain a copy of the entire core code of ~TiddlyWiki, making it impossible for the browser to cache it.
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
! Using the external ~JavaScript template with the client-server configuration
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
The mechanism is activated by setting the [[root-tiddler|WebServer Parameter: root-tiddler]] parameter to `$:/core/save/all-external-js`. This template externalises ~TiddlyWiki's core ~JavaScript into a separate file. For example, the following command will start your server with caching enabled. It will transfer the wiki with two GET requests, and the core can be cached by the browser.
```
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
tiddlywiki YOUR_WIKI_FOLDER --listen 'root-tiddler=$:/core/save/all-external-js' use-browser-cache=yes
```
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
<<.tip """You can activate your browser's ''Developer Tools: Network'' tab and reload the page to see how it works.""">>
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
<<.tip """On Windows, Command Prompt (CMD) users need to replace single quotes `'` with double quotation marks `"`.""">>
!! Initializing a new wiki
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
The provided edition `server-external-js` contains all the configuration necessary to use the external ~JavaScript template. Here is an example:
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
```
tiddlywiki ./myNewWiki --init server-external-js
tiddlywiki ./myNewWiki --build listen
```
The above commands perform the following:
* Create a new wiki with external JavaScript customization included.
* Start the server with external ~JavaScript enabled. The server listens on port 8080. Visit http://localhost:8080 in your browser.
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
To customize your `--build listen` command, see [[tiddlywiki.info Files]] and [[ListenCommand]].
! Using the external ~JavaScript template with the single file configuration
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
You can use the "external-js" template with your single file wiki, but this requires that you have ~TiddlyWiki's core ~JavaScript saved alongside your HTML file. You may prefer this configuration, for example, if you have several wikis on a ~WebDav server. (See: [[Saving via WebDAV]])
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
<<.warning "This functionality is intended for advanced users: there are many more ways for things to go wrong than with the standard single file configuration">>
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
!! Saving your snapshots
If you start your ~TiddlyWiki server in the "external-js" configuration, snapshots you save from the wiki will also have the external-js configuration.
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
You can click on the "cloud" button and choose <<.icon $:/core/images/download-button>> ''Save snapshot for offline use''. The html wiki you saved will have a reduced file size compared to a regular snapshot because the ~TiddlyWiki core code has been externalized. However, to be able to use this wiki, you ''must'' also have a copy of ~TiddlyWiki's core ~JavaScript in the same directory; see below for instructions for obtaining it
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
The "server-external-js" edition lets you save the snapshot from the command line:
```
tiddlywiki YOUR_WIKI_FOLDER --build index
```
The files `index.html` and `tiddlywikicore-5.x.x.js` will be saved in your wiki folder's `output` directory.
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
!! Obtaining the ~TiddlyWiki core in the browser
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
{{$:/core/ui/ExportTiddlyWikiCore}}
!! Obtaining the ~TiddlyWiki core with Node.js
You can also run the following command to obtain the core ~JavaScript. The file `tiddlywikicore-5.x.x.js` will be saved in the`output` directory of your wiki folder:
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
```
tiddlywiki YOUR_WIKI_FOLDER \
--render '$:/core/templates/tiddlywiki5.js' \
'[[tiddlywikicore-]addsuffix<version>addsuffix[.js]]' \
'text/plain'
```
The "server-external-js" edition has a shortcut for the BuildCommand to do the same thing:
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
```
tiddlywiki YOUR_WIKI_FOLDER --build tiddlywikicore
```
! Upgrading your standalone wiki
<<.warning "This procedure is experimental, please take care to backup your data">>
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
Before you proceed, backup your wiki first! Follow the steps below to upgrade a single-file wiki with the external ~JavaScript template:
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
# Proceed with the [[Upgrade Process for Standalone TiddlyWikis|Upgrading]]. Your wiki will be converted to a full standalone HTML.
# Open your upgraded wiki in the browser. If you'd like to revert to using the regular template, restore the original shadow tiddler `$:/config/SaveWikiButton/Template` by deleting any custom copy. Save your wiki and you are done.
# Otherwise, from your wiki, select the ''Tools'' tab from the sidebar and click on the <<.icon $:/core/images/star-filled>> ''export tiddlywiki core'' button to obtain the core from your wiki.
# Verify that `$:/config/SaveWikiButton/Template` still contains `$:/core/save/offline-external-js`. Modify if necessary.
Fix faulty external-js single-file wiki (#5570) * Fix problems with building single-file wiki using external-js template * core/templates/external-js/tiddlywiki5-external-js.html.tid, core/templates/external-js/save-all-external-js.tid, core/templates/external-js/save-offline-external-js.tid core/templates/external-js/load-external-js.tid: Fix #5343. Exclude client-server plugins in tiddler imports and to specify a working URL for loading tiddlywiki5.js from local disk. Mirror save/all and save/offline templates in the regular server edition. Fix #4717 (tiddlywiki5-external-js.html.tid) * core/modules/saver-handler.js: Need the change to make single file autosave work with the external-js template. * editions/server-external-js/tiddlywiki.info: Provide external-js related build targets. * core/language/en-GB/Snippets/ExtJSReadme.tid: Temporary doc to supplement TW5.com's external-js section. Demonstrate that upgrade could be done on single-file wikis with an externalized TW core. * core/language/en-GB/Snippets/GetTiddlyWikiJS.tid: Documentation. Meant to be included in every wiki and to help end users acquire tiddlywiki5.js. * Pre-configure save-wiki template for end-users * Remove the newline character at the end of the file. * Trim "template" value in saveWiki() * Safeguard the code from extraneous whitespaces in transcluded result. * Rename and add versioning to downloaded tiddlywiki core JS * Rename "tiddlywiki5.js" to "twcore-VERSION.js" * Preload $:/config/SaveWikiButton/Template tiddler with the required external-js template value. * Update external-js user documentation * Add "download tiddlywiki core JS" menu item to the "cloud" button. * Update build's target defintions associated with external-js template. * Move the user doc to the tw5.com edition. * Coding style update * Undo template name changes * Correct text & fill colors on some disabled buttons * Add new "export tiddlywiki core" button under page control tools This new button can export tiddlywiki's core JS from user's wiki as long as the wiki is served with the regular "root" template. The button will be ineffective, thus disabled, if the core has already been externalized by the "external-js" template. With this button, a full standalone html wiki can obtain the matching core JS without TiddlyWiki on node.js. Once this is done, the html wiki can be converted to using the "external-js" template. * Alternate version of "save tiddlywiki core for offline use" This version will fire up a "Save File" dialogue box when clicked, instead of directing the user to a helper doc for further instruction. It achieves this by using the "download" attribute of the <a> html tag. It works on most modern desktop browsers, but older browsers (e.g. IE) may display the file instead. * Adjust font-weight to match other menu items * Merge two user documentations into one * Add user-browser-cache=yes to --listen command * Update "export tiddlywiki core" button hint * Simpler implementation for switching btw online/offline core URL Shave off one template by using filtered transclusion to control online/offline core URL. * Update user doc Update the user doc to clarify that build index step is not needed to initialize a new wiki. * Rename twcore to tiddlywikicore * Reformat the user doc * Rework export-tiddlywikicore button Popup an error message instead of disabling the button when export core cannot be performed. * Revert "Correct text & fill colors on some disabled buttons" This reverts commit e7dbb7e712e5cd23e57ec068b9fe9ed3bbaf4617.
2021-07-06 14:02:21 +00:00
# Save your wiki again. Your wiki is now converted to using the external core.