id | title |
---|---|
gettingstarted |
The Getting Started Guide |
The minimum Node version required is
- TiddlyServer 2.0: Node v6
- TiddlyServer 2.1: Node v8
TiddlyServer is published to NPM. This means that you need NodeJS and NPM installed on your computer.
- On Windows and Mac, download and run the installer from https://nodejs.org/en/download/.
- On Linux, you can usually install the
nodejs
package using your package manager. You may need to runapt update
to update the package registry. - If you're on anything else, you probably know how to do this yourself, and if not, you should be able to Google it.
- Install TiddlyServer globally using
npm install tiddlyserver -g
. - Create your config file.
- Run
tiddlyserver --config ~/path/to/settings.json
. - Run
tiddlyserver --help
for additional options. - All paths in the config are relative to the config file. The working directory is not used by TiddlyServer for anything. TiddlyWiki Data Folders do not use the working directory for anything either.
- Create a new folder and
cd
into the folder or open it in your favorite terminal. - Run
npm init -y
to quickly create a package.json file. - Run "
npm install tiddlyserver --save-exact
".- Notice there is no
-g
option there.
- Notice there is no
- Create the JSON Schema by running
npx tiddlyserver --gen-schema
(noticenpx
, notnpm
). - Create your config file.
- Test it by running
npx tiddlyserver --config settings.json
. - Create your bash or batch file with the following command.
- "
node node_modules/tiddlyserver/index.js --config settings.json
"
- "
- You can also copy the Node executable into the folder for a truly portable install.
- Windows CMD will use this immediately, but bash and other shells usually require you to change the command
node
to./node
.
- Windows CMD will use this immediately, but bash and other shells usually require you to change the command
- Whenever you want to upgrade to a new version, run
npm install tiddlyserver@latest --save-exact
. - Copy the entire folder onto your USB drive or wherever you store it.
Upgrading is simple. Just run npm install -g tiddlyserver@latest
. Remove the -g
flag if this is a portable install. TiddlyServer always exactly specifies the latest version of TiddlyWiki at the time it is published so this will also update the TiddlyWiki version that TiddlyServer uses. This will not affect your global install of TiddlyWiki, as the files are completely separate.
Here's a more detailed version of the above instructions.
The first thing you need to do is download and install NodeJS on your computer. If you're on Linux, read the note below this paragraph. If you have never heard of NodeJS and you either don't know what a "command prompt" or "terminal" is or you never use it, then just go to the NodeJS website (https://nodejs.org/en/download/), and download the installer for your operating system. Once it's downloaded, you can just run the downloaded file.
LINUX TIP: Most Linux distributions allow Node to be installed using
apt-get
or whatever the equivelant package manager is for your flavor of linux. The package name isnodejs
, notnode
, even though the command you type into the console isnode
.
PRO TIP: TiddlyServer is completely portable, so the only thing required to actually run it is the node executable. See the portable install instructions at the top of this page.
Install TiddlyServer globally using npm install tiddlyserver@latest -g
.
Now you need to create tiddlyserver.json
.
- If you are upgrading from a previous 2.1 version, copy your
settings.json
file from your old installation. - If you are upgrading from 2.0, follow the instructions below, but replace the tree property with the one from your old
settings.json
file. - Otherwise, create a
tiddlyserver.json
file with the following content.
I prefer to edit my settings.json file with VS Code, because it uses the
$schema
property to give intellisense hints and descriptions of the various properties available in settings.json. Runtiddlyserver --gen-schema
in your config file directory to generate thetiddlyserver-2-2.schema.json
file.
Uncomment one of the lines in bindInfo
according to your use case. The bindAddress array may be set to any IP addresses desired.
Remove one of the tree properties, according to your use case. Be sure to create the appropriate folders on your hard-drive if they do not already exist. No error will be thrown in the server if a path does not exist, but it will have an error icon in the directory listing and will return 404 if accessed by the client.
Create a backups
folder beside your tiddlyserver.json
file.
Please refer to ServerConfig for more information.
You have multiple options depending on your operating system.
Open the terminal or command prompt and run tiddlyserver --config path/to/settings.json
The easy way to install it on Android is to use Dory (https://play.google.com/store/apps/details?id=io.tempage.dorynode).
Create a portable install as explained at the top of the page and copy it to your phones storage.
Open the app, tap the + button on the bottom right, then select "file". Select the node_modules/tiddlyserver/index.js
file in your TiddlyServer portable install. In this case it may be easier to put your config file in the same folder as the index.js
file referred to above. That's basically all there is to it. Save it, then hit back to return to the list of scripts and tap start. Tap stdout to see the terminal output, including any error messages.
The other option is to use Termux. If you have a keyboard attached to your Android, it can help.
- Once you enable shared storage inside Termux you can use your regular Android file manager to unzip the TiddlyServer files and then cd to the directory to access them from Termux.
- You can install Node on Termux using the built-in package manager.
Sorry, we're still kind of up the creek on this one, but if you can find a way to run Node on iOS, then that's what you need. There are a couple options out there but none that I've tested.
In case you haven't figured it out yet, TiddlyServer's only dependancy is Node itself, so it should run on anything that supports Node.
Note: This does not apply to data folders.
TiddlyWiki5 files currently use the put saver. The put saver URI encodes the document location, which is usually already encoded by the browser, resulting in a 404 error when saving, if the URL contains any characters that get converted to percent codes (such as %20).
You will need to use the bookmarklet included in the directory pages to fix the saving. The bookmarklet needs to be clicked each time the affected wiki is opened, after which saving should work normally until the page is reloaded. If there are unsaved changes, another change needs to be made to trigger a save.
The updated tiddler is also included as another link and may be dragged into the wiki to import the tiddler normally. After import, the wiki will still need to be saved, either by downloading or by using the bookmarklet.
This is a bug in TiddlyWiki, and is fixed in version 5.1.15.