Minimalism

The Purple Tree is all about doing much with little. It began with in 2021 with a simple Youtube tutorial illustrating how the essence of a Wiki can take only about 100 lines of Php.

I started exploring ways of following up that tutorial, though other things got in the way. I discovered Obsidian for taking notes, but wished for something at least as immediate, but online in a web browser so that, like a Wiki, you are live-editing online content. Syncing Obsidian vaults between my multiple machines was becoming too much of a hassle. Naturally there are two ways to have private content: either somewhere online where others do not have access,for example, by placing a TPT1 wiki at a location like https://w.allsup.co/SalvadorProgressRecommendsMetadata, and then requiring the user to visit https://w.allsup.co/SalvadorProgressRecommendsMetadata, and answering a nonsensicle riddle in order to get the write cookie set appropritately. Alternatively, you can place a TPT1 Wiki on a local machine on your home LAN running an Apache2+Php stack. (The same permission thing works for viewing rights, so you can have a wiki that you cannot view without a cookie being set.) What I do not do, is to have a username+password login box at https://wp.allsup.co/wp-admin/admin.php for an attacker to try guessing at, and phishing for credentials. Yet another feature of this approach is that admin requires ssh access to the server, rather than being administered through a web interface. So provided you keep your ssh access secure, your site is too. There just isn't an attack cross-section like Wordpress.

The result of that is the Purple Tree Wiki v1. I modularised things using classes, allowing for multiple different renderer classes to be swapped in. But in time, I settled on exclusively using Parsedown for rendering source pages written in Markdown, using hightlight.js to syntax highlight code blocks. My personal online notes are at (w.allsup.co"), and I have added MathJax, though that is not yet present in the version I have put on my github. I find it very quick to edit. On a page, you press shift-` to access the source and, if you have the right to save, then shift-` saves again. At first I used Escape to abort an edit but, being used to vim, I instinctively pressed Escape and lost work. So my version now uses shift-Escape to abort. Aside from Parsedown, which is ~2000 lines of Php, and hightlight.js which is another ~1200 lines in minimised form, the rest is around 1000 lines of Php, Css, Html and Javascript combined. I imagine it will grow a little, but I certainly don't expect it to get up to 2000 lines in total. I like my projects to be the size that one can read and understand all the code in a single weeked of casual reading. No massive edifaces of Software Engineering here. To compare, Wordpress and MediaWiki are 100,000s of lines of code, and nowhere as quick to edit. Then I find Markdown to be a far better language for source.

The second version is in the works, but much of the essence is already present in v1. The difference is in how files are organised and, whereas v1 is designed to use a single folder, v2 will allow you to have a hierarchy of folders, some of which are indices, some of which are WikiSpaces. I am still finalising design decisions, but it is intended to use the same source format, so that pages from a v1 wiki can be copied across to a folder on a v2 wiki and it will just work. Basically v1 is designed to be put in a folder anywhere on a webhost running just Apache2 and a recent version of Php, and giving you a single space of WikiPages. Purple Tree Wiki v2 is designed to occupy an entire subdomain, and offer multiple WikiSpaces, with per-WikiSpace settings for visibility and write permissions. Again, however, I don't intend it to get up to 2000 lines (aside from Parsedown and highlight.js), and in part that will be achieved by removing much of the modular flexibility the previous had in order to allow the renderer and storage backend to have multiple implementations. Things have converged to a single renderer, so there is no need for abstract base classes and suchlike.

The original wiki tutorial examples from 2021 are at wikitutorial.thepurpletree.uk and an example of TPTv1 is here for now. I hope to make a few Youtube videos detailing how TPT1 and TPT2 work, once TPT2 is finalised.