Skip to content

Commit e8dec77

Browse files
Document differences from stock TiddlyWiki
1 parent 34a17be commit e8dec77

File tree

3 files changed

+49
-20
lines changed

3 files changed

+49
-20
lines changed

README.md

+42-15
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,78 @@
1-
# Tiddlywiki Server
1+
# TiddlyWiki Server
22

33
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)
44
[![Matrix](https://img.shields.io/matrix/tws:conduit.nathanielknight.ca)](https://matrix.to/#/#tws:conduit.nathanielknight.ca)
55
[![Join the chat at https://gitter.im/tiddly-wiki-server/community](https://badges.gitter.im/tiddly-wiki-server/community.svg)](https://gitter.im/tiddly-wiki-server/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
66

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
88
API] to save tiddlers in a [SQLite database]. It should come with a
99
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).
1212

1313
[TiddlyWiki]: https://tiddlywiki.com/
1414
[web server API]: https://tiddlywiki.com/#WebServer
1515
[SQLite]: https://sqlite.org/index.html
16-
16+
[TiddlyWeb plugin]: https://github.com/Jermolene/TiddlyWiki5/tree/master/plugins/tiddlywiki/tiddlyweb
1717

1818
## Motivation
1919

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
2121
JavaScript for maximum compatibility. However, this server needs about 70 MB of
2222
memory to start, and can easily consume 100 MB or more. This is fine for running
2323
on a workstation, but a cheap VPS quickly gets crowded running services of this
2424
size.
2525

2626
[NodeJS based webserver]: https://tiddlywiki.com/static/WebServer.html
2727

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
2929
memory (with no optimizations), which I find much more manageable.
3030

3131

3232
## Setup
3333

34-
To create a Tiddlywiki backed by this server:
34+
To create a TiddlyWiki backed by this server:
3535

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].
4141
1. Run `tiddly-wiki-server`.
4242

4343

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+
4471
## Contributing
4572

4673
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
4976
discrepancy is a potential bug, which I'd be very grateful to have reported!
5077

5178

empty.html.template

+5-3
Large diffs are not rendered by default.

src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//! # TiddlyWiki Server
22
//!
3-
//! This is a web backend for [TiddlyWiki]. It uses TiddlyWiki's [web server
3+
//! This is a web server for [TiddlyWiki]. It uses TiddlyWiki's [web server
44
//! API] to save tiddlers in a [SQLite database]. It should come with a
55
//! slightly altered empty TiddlyWiki that includes an extra tiddler store (for
66
//! saved tiddlers) and the `$:/plugins/tiddlywiki/tiddlyweb` plugin (which is
7-
//! necessary to make use of the web backend).
7+
//! necessary to make use of the web server).
88
//!
99
//! [TiddlyWiki]: https://tiddlywiki.com/
1010
//! [web server API]: https://tiddlywiki.com/#WebServer

0 commit comments

Comments
 (0)