mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-04-22 02:33:17 +00:00
Update external-js user documentation
This commit is contained in:
parent
dc41487079
commit
6d0bfc5747
@ -1,15 +1,19 @@
|
||||
title: $:/language/Snippets/ExtJSReadme
|
||||
|
||||
Additions to ~TiddlyWiki documentation [[Using the external JavaScript template|https://tiddlywiki.com/#Using%20the%20external%20JavaScript%20template]]:
|
||||
This is an addendum to the ~TiddlyWiki documentation—[[Using the external JavaScript template|https://tiddlywiki.com/#Using%20the%20external%20JavaScript%20template]]:
|
||||
|
||||
To ensure that the "save snapshot for offline use" button saves a working wiki, it is also necessary to set the tiddler $:/config/SaveWikiButton/Template to contain <code>~$:/core/save/<b>offline-external-js</b></code>. You must also save a copy of "tiddlywiki5.js" in the same folder as your offline wiki file. See [[How to obtain tiddlywiki5.js|$:/language/Snippets/GetTiddlyWikiJS]] for details.
|
||||
...
|
||||
|
||||
To properly save your snapshot for offline use, it is necessary to set the text of the tiddler $:/config/SaveWikiButton/Template to <code>~$:/core/save/<b>offline-external-js</b></code>. You must also save a copy of <code>twcore-TIDDLYWIKI_VERSION.js</code> in the same folder as your HTML file. From your own wiki, open the tiddler [[$:/language/Snippets/GetTiddlyWikiJS]]. It will show you how to acquire ~TiddlyWiki's core ~JavaScript.
|
||||
|
||||
The provided edition "server-external-js" contains all the configuration necessary to use the external ~JavaScript template.
|
||||
|
||||
!! Upgrading
|
||||
|
||||
Upgrading an offline wiki with an external-js template will be a three-step process:
|
||||
Before you proceed, backup your wiki first! Upgrading a single-file wiki with the external-js template will be a three-step process:
|
||||
|
||||
# Follow the standalone file ~TiddlyWiki Upgrading process. Your wiki will be converted to a full standalone version.
|
||||
# Follow the standalone file ~TiddlyWiki [[Upgrading]] process. Your wiki will be converted to a full standalone HTML.
|
||||
|
||||
# Open $:/language/Snippets/GetTiddlyWikiJS tiddler from your newly upgraded wiki and click the "Export tiddlywiki5.js" button.
|
||||
# From the upgraded wiki, open the tiddler [[$:/language/Snippets/GetTiddlyWikiJS]]. Click on the "Export ~TiddlyWiki Core" button to obtain the new release of ~TiddlyWiki's core ~JavaScript.
|
||||
|
||||
# Verify that $:/config/SaveWikiButton/Template still contains `$:/core/save/offline-external-js`. Save your wiki again and the wiki will be converted to using the external-js template.
|
||||
# Verify that $:/config/SaveWikiButton/Template still contains `$:/core/save/offline-external-js`. Save your wiki again. It is now converted to using the external core.
|
||||
|
@ -1,12 +1,15 @@
|
||||
title: $:/language/Snippets/GetTiddlyWikiJS
|
||||
|
||||
To obtain "tiddlywiki5.js" for your offline external-js ~TiddlyWiki, use one of the following methods:
|
||||
\define jsFileName() twcore-$(version)$.js
|
||||
|
||||
In the external-js setting, you must have a copy of `twcore-TIDDLYWIKI_VERSION.js` alongside your single-file wiki. To obtain the core ~JavaScript, use one of the following methods:
|
||||
<ul>
|
||||
|
||||
<$reveal state="$:/plugins/tiddlywiki/tiddlyweb!!plugin-type" type="match" text="plugin">
|
||||
|
||||
<li>
|
||||
If you are running ~TiddlyWiki on node.js, you can download <a class="tc-tiddlylink" href="%24%3A%2Fcore%2Ftemplates%2Ftiddlywiki5.js" download="tiddlywiki5.js">tiddlywiki5.js</a> from your server.
|
||||
If you are running ~TiddlyWiki on Node.js, you can download <a class="tc-tiddlylink" href="%24%3A%2Fcore%2Ftemplates%2Ftwcore.js" download=<<jsFileName>>><<jsFileName>></a>
|
||||
from your server. If clicking the link does not work, right-click the link and save it that way.
|
||||
</li>
|
||||
|
||||
</$reveal>
|
||||
@ -15,12 +18,10 @@ If you are running ~TiddlyWiki on node.js, you can download <a class="tc-tiddlyl
|
||||
|
||||
<li>
|
||||
|
||||
If this wiki's ~TiddlyWiki core has not been externalized, you can click the following button to export "tiddlywiki5.js" from your own wiki:
|
||||
If this wiki's core library has not been externalized, you can click the following button to export ~TiddlyWiki's core from your own wiki:
|
||||
<div><$button style=<<cssState>> class="tc-btn-big-green" disabled=<<isButtonOff>> >
|
||||
<$wikify name="site-title" text={{$:/config/SaveWikiButton/Filename}}>
|
||||
<$action-sendmessage $message="tm-download-file" $param="$:/core/templates/tiddlywiki5.js" filename="tiddlywiki5.js"/>
|
||||
</$wikify>
|
||||
{{$:/core/images/download-button}} Export tiddlywiki5.js
|
||||
<$action-sendmessage $message="tm-download-file" $param="$:/core/templates/twcore.js" filename=<<jsFileName>>/>
|
||||
{{$:/core/images/download-button}} Export ~TiddlyWiki Core
|
||||
</$button></div>
|
||||
|
||||
</li>
|
||||
@ -32,23 +33,24 @@ If this wiki's ~TiddlyWiki core has not been externalized, you can click the fol
|
||||
If you have created your wiki from the "server-external-js" edition, then you can run the command:
|
||||
|
||||
```
|
||||
tiddllywiki <your-wiki-folder> --build tiddlywiki5.js
|
||||
tiddllywiki <your-wiki-folder> --build twcore
|
||||
```
|
||||
|
||||
File "tiddlywiki5.js" will be saved in the`output` folder within your wiki-folder.
|
||||
File "<<jsFileName>>" will be saved in the`output` folder of your wiki folder.
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
From the command line, run:
|
||||
If you have installed ~TiddlyWiki on Node.js, you can run the following command:
|
||||
|
||||
```
|
||||
tiddlywiki <your-wiki-folder> \
|
||||
--rendertiddler '$:/core/templates/tiddlywiki5.js' \
|
||||
tiddlywiki5.js text/plain
|
||||
--render "$:/core/templates/twcore.js" \
|
||||
"[[twcore-]addsuffix<version>addsuffix[.js]]" \
|
||||
"text/plain"
|
||||
```
|
||||
|
||||
File "tiddlywiki5.js" will be saved in the`output` folder within your wiki-folder.
|
||||
File "<<jsFileName>>" will be saved in the`output` folder of your wiki folder.
|
||||
|
||||
</li>
|
||||
</ul>
|
Loading…
x
Reference in New Issue
Block a user