|
1 |
| -# Tiddlywiki Server |
| 1 | +# TiddlyWiki Server |
2 | 2 |
|
3 | 3 | [](code_of_conduct.md)
|
4 | 4 | [](https://matrix.to/#/#tws:conduit.nathanielknight.ca)
|
5 | 5 | [](https://gitter.im/tiddly-wiki-server/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
6 | 6 |
|
7 |
| -This is a web backend for [TiddlyWiki]. It uses TiddlyWiki's [web server |
| 7 | +This is a web server for [TiddlyWiki]. It uses TiddlyWiki's [web server |
8 | 8 | API] to save tiddlers in a [SQLite database]. It should come with a
|
9 | 9 | slightly altered empty TiddlyWiki that includes an extra tiddler store (for
|
10 |
| -saved tiddlers) and the `$:/plugins/tiddlywiki/tiddlyweb` plugin (which is |
11 |
| -necessary to make use of the web backend). |
| 10 | +saved tiddlers) and the [TiddlyWeb plugin] (which is necessary to make use of |
| 11 | +the web server API). |
12 | 12 |
|
13 | 13 | [TiddlyWiki]: https://tiddlywiki.com/
|
14 | 14 | [web server API]: https://tiddlywiki.com/#WebServer
|
15 | 15 | [SQLite]: https://sqlite.org/index.html
|
16 |
| - |
| 16 | +[TiddlyWeb plugin]: https://github.com/Jermolene/TiddlyWiki5/tree/master/plugins/tiddlywiki/tiddlyweb |
17 | 17 |
|
18 | 18 | ## Motivation
|
19 | 19 |
|
20 |
| -TiddlyWiki 5 has a [NodeJS based webserver] that re-uses much of the front-end |
| 20 | +TiddlyWiki 5 has a [NodeJS based web server] that re-uses much of the front-end |
21 | 21 | JavaScript for maximum compatibility. However, this server needs about 70 MB of
|
22 | 22 | memory to start, and can easily consume 100 MB or more. This is fine for running
|
23 | 23 | on a workstation, but a cheap VPS quickly gets crowded running services of this
|
24 | 24 | size.
|
25 | 25 |
|
26 | 26 | [NodeJS based webserver]: https://tiddlywiki.com/static/WebServer.html
|
27 | 27 |
|
28 |
| -In rudimetnary benchmarks it looks like `tiddly-wiki-server` uses about 10 MB of |
| 28 | +In rudimentary benchmarks it looks like `tiddly-wiki-server` uses about 10 MB of |
29 | 29 | memory (with no optimizations), which I find much more manageable.
|
30 | 30 |
|
31 | 31 |
|
32 | 32 | ## Setup
|
33 | 33 |
|
34 |
| -To create a Tiddlywiki backed by this server: |
| 34 | +To create a TiddlyWiki backed by this server: |
35 | 35 |
|
36 |
| -1. Build or install the executable on your server (e.g. by checking out the repo |
37 |
| - and running `cargo install --path .`). |
38 |
| -1. Set up the directory you want to run the server in: |
39 |
| - a. Copy the `empty.html.template` file into the directory. |
40 |
| - b. Create a `files/` folder to hold [static files]. |
| 36 | +1. Build or install the executable on your server (e.g. by checking out this |
| 37 | + repository and running `cargo install --path .`). |
| 38 | +1. Set up the directory you want to run the server in: a. Copy the |
| 39 | + `empty.html.template` file into the directory. b. Create a `files/` folder |
| 40 | + to hold [static files]. |
41 | 41 | 1. Run `tiddly-wiki-server`.
|
42 | 42 |
|
43 | 43 |
|
| 44 | +## Differences from TiddlyWiki |
| 45 | + |
| 46 | +The initial page that this project serves has a few changes compared to the |
| 47 | +empty wiki you can download from tiddlywiki.com/empty.html. It has: |
| 48 | + |
| 49 | +* the [TiddlyWeb plugin] to let TiddlyWiki save data to the server, and |
| 50 | +* any data that you entered or imported. |
| 51 | +* no `noscript` section for browsers that disable JavaScript (this is |
| 52 | + considered a bug) |
| 53 | + |
| 54 | +It was created by following this procedure: |
| 55 | + |
| 56 | +1. Download an empty TiddlyWiki from tiddlywiki.com/empty.html |
| 57 | +1. Add the TiddlyWeb plugin via the [plugin library] |
| 58 | +1. Add a `script` element to the very end of the HTML document with |
| 59 | + - `class="tiddlywiki-tiddler-store"` |
| 60 | + - `type="application/json` |
| 61 | + - The contents `@@TIDDLY-WIKI-SERVER-EXTRA-TIDDLERS-@@N41yzvgnloEcoiY0so8e2dlri4cbYopzw7D5K4XRO9I@@` |
| 62 | + |
| 63 | +[plugin library]: https://tiddlywiki.com/static/Installing%2520a%2520plugin%2520from%2520the%2520plugin%2520library.html |
| 64 | + |
| 65 | +The server replaces the contents of the `script` tag with the saved tiddlers. |
| 66 | +Since tiddlers can contain escaped (sometimes twice-escaped) code in various |
| 67 | +programming and/or markup languages, creating a separate tiddler store is much |
| 68 | +easier than dynamically modifying the core TiddlyWiki tiddlers. |
| 69 | + |
| 70 | + |
44 | 71 | ## Contributing
|
45 | 72 |
|
46 | 73 | The most valuable way to contribute to this project is currently testing: try to
|
47 |
| -setup a Tiddlywiki with it and see if it behaves the way you'd expect. The |
48 |
| -server aims to have feature parity with the first-party NodeJS backend; any |
| 74 | +setup a TiddlyWiki with it and see if it behaves the way you'd expect. The |
| 75 | +server aims to have feature parity with the first-party NodeJS server; any |
49 | 76 | discrepancy is a potential bug, which I'd be very grateful to have reported!
|
50 | 77 |
|
51 | 78 |
|
|
0 commit comments