1 <img src="raw/icon32x32.png" alt="HTML WARDen Icon" style="float:right; width:128px; height:128px; image-rendering:pixelated">
2
3 # HTML WARDen
4
5 An HTML file wiki in PHP and vanilla JavaScript. No DB, no 3rd party libraries.
6
7 Read quite a bit more about this project including a multi-part "making of"
8 article series titled _The Wiki Weekend_ here:
9
10 <a href="https://ratfactor.com/htmlwarden/">https://ratfactor.com/htmlwarden/</a>
11
12
13 ## Installation/setup
14
15 Clone this repo to a directory accessible
16 on a web server somewhere running PHP.
17
18 $ cp example_settings.php settings.php
19
20 Edit `settings.php` and tweak it for your setup. The comments should explain
21 what each option does.
22
23 You'll need to set write permissions to the pages directory to match either the
24 `user` or `group` PHP runs under. It is likely your web server's user/group.
25 Setting permisions may look something like:
26
27 $ chgrp -R www pages
28 $ chmod 0775 pages
29 $ chmod 0775 pages/archives
30
31 You'll also need to either make `index.php` the default "index" page for the
32 directory (this is a web server setting) or go to `index.php` directly in
33 the browser.
34
35 ## Usage
36
37 To edit pages, you'll need to be logged in.
38
39 Logins require a link. It will look something like this:
40
41 https://example.com/wiki/login.php?login=1234
42
43 Where the login above corresponds with an entry in `settings.php` like so:
44
45 '1234'=>'Guest'
46
47 If you want a login form instead, you'll need to make it. Have it submit by
48 POST to the `login.php` page.
49
50 "Pages" are saved as the inner bodies of an HTML document:
51
52 * Page bodies save to the `pages/` directory.
53 * Previous versions are saved to `pages/archive` with a timestamp prepended to the filename.
54
55 You can compare versions with normal command line diff tools. On POSIX systems
56 (such as Linux), this will show changes made since a particular archived
57 version of the `foo.html` page:
58
59 diff pages/archive/1749345875_foo.html pages/foo.html
60
61 That's about it. The source is small, so you can probably figure out how to add
62 things pretty easily if you're at all familiar with PHP or JavaScript. No
63 libraries of any kind are used.
64
65 ## License and what you can do with it
66
67 I'm releasing this under the GNU GPLv3 license. Please see the
68 <a href="html/LICENSE.html">LICENSE</a> text file in this repo.
69
70 In short, you can download, modify, and distribute this program.