PureWiki Technical Documentation
PureWiki is a flat-file wiki written in PHP (8.1 or higher) with vanilla JavaScript and CSS. It needs no database, no Node.js and no build step. All content is stored as JSON files in the filesystem. The code is licensed under the AGPLv3.
How It Works
- Storage: Each page is a folder below
pages/. The filepage.jsonholds the title, the page settings and a list of Editor.js blocks. Drafts are stored aspage.draft.json, translations aspage.{lang}.jsonand older versions in_history/. No HTML or Markdown is stored in the page files. - Rendering:
index.phpis the front controller for all requests. The parser converts the blocks of a page to HTML, the renderer inserts the result into the PHP template of the active theme. - Caching: Rendered pages are stored as static HTML in
cache/and delivered to visitors without reading the page data again. - Editing: Pages are edited with the Editor.js block editor in the dashboard. The browser talks to
purewiki/api.php, the single entry point of the API. - Extensions: Extensions are loaded from
extensions/and attach to the core through hooks. They can extend the parser, the renderer, the editor, the settings and the API.
Directory Layout
index.php Front controller
purewiki/ Core, API, dashboard, parser and renderer, Editor.js plugins
themes/ Frontend themes
pages/ Page content (JSON) and media
config/ Configuration and users
cache/ Static HTML and index files
backups/ Backups
extensions/ Installed extensions
The sections of this documentation are listed in the sidebar.