Skip to content

About

A tiny, git-diff-friendly single-file wiki

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

124 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DifflyWiki

A tiny, git-diff-friendly single-file wiki - an empty wiki is less than 50 KB.

Why

  • Git-diff-friendly file format
    • Notes are stored at the beginning of the file; saving without changes gives a byte-identical file
    • Saving preserves note formatting and keeps notes sorted alphabetically (A-Z by title, then by id)
  • Single, self-contained HTML file in vanilla JS with no external imports
  • Bare-bones functionality: notes (title, content, update date), recent notes, visit history, search (title and content), tag filter
  • Bare-bones tag support: tags are auto-discovered from notes content
  • Basic import/export in TiddlyWiki 5 JSON format
  • Very slim - the HTML file is basically just your wiki content plus a minimum of vanilla JS

Tradeoffs

  • Saving in place needs Chrome/Edge or a small helper (see Saving); otherwise Save downloads a copy
  • Basic Markdown only
  • Basic set of settings
  • Default theme only (TiddlyWiki 5-like)
  • No plugins or add-ons - hack the source if needed

Getting started

  • Download the empty wiki file and open it in any browser, or work with it from the command line using XML tools like xmlstarlet (docs/xml-cli.md)

Saving

Save writes the wiki back into its own file when it can, and downloads a copy otherwise:

  • Chrome, Edge, Opera (desktop), wiki opened from disk: the first Save shows an Open dialog; choose the wiki file itself, and later saves go straight into it. After a browser restart, the browser asks once to allow editing the file again
  • Otherwise - for example Firefox or Safari opening the file directly - Save downloads a copy
  • Also works with TiddlyStow, Tiddloid and WebDAV servers
  • Small helper for any browser: run scripts/serve.py (Python 3, no dependencies, starts localhost WebDAV) on the wiki's folder and open the wiki through it; Save then writes into the file, optionally keeping backups. See its header for usage

More details

  • Visit history for fast navigation (instead of a TiddlyWiki-style story river)
  • New notes: customizable title format
  • Markdown: basic support for formatting, links, fenced code blocks and inline HTML
  • WikiLinks: [[Title]] links by title by default; [[id=...]] links by note id, which can be handy for hand-written documentation. Clicking a link to a missing note creates it
  • Tags: filter the note list by tags (always sorted A-Z); the selected filter is saved in the file
  • Tags: tag-like words inside code and links are not counted as tags
  • Index note: the note with the fixed id .index, recreated if missing; it opens first unless start defined (see docs/customisation.md)
  • Works with TiddlyStow v1 and TiddlyStow v2
    • Tested with v1: in-place save (open the wiki file there; Save writes straight back into that file)
    • v1 requires a browser with the File System Access API, e.g. Chrome, Edge
    • Tested with v2: in-place save. Save sends an HTTP PUT to the wiki's own URL, like TiddlyWiki's PUT saver (same as WebDAV servers)
  • Works in Tiddloid (Android)
    • Tested with v2.5.4: in-place save, exit warning, share-to-wiki
    • Reports the Index note's title and content as the wiki name and description
  • Internals: how the file works and why is described in docs/internals.md
    • Unlike FeatherWiki and TiddlyWiki 5 (which store content as a JSON string), DifflyWiki uses an XML vault inside an XHTML file. In some ways, it resembles TiddlyWiki Classic, but with improvements
    • Note content is wrapped in CDATA when saved, so file source stays readable (no escaped entities)
    • The wiki HTML file is also well-formed XML (XHTML-style), and saving keeps it that way, so XML tools can read and edit notes: see docs/xml-cli.md
  • Themes, translations and options: the page style and the UI strings are separate sections, easy to edit or swap between wikis; options include a read-only (locked) mode for embedded documentation: see docs/customisation.md
  • Tests: scripts/unit-tests.py checks the main features in headless Chrome and Firefox: see docs/tests.md

Moving notes from an old TiddlyWiki

scripts/tw2json.py (Python 3, no dependencies) extracts notes from a TiddlyWiki Classic or TiddlyWiki 5 HTML file into TiddlyWiki 5 JSON:

python3 scripts/tw2json.py old-wiki.html

Inspired by

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A tiny, git-diff-friendly single-file wiki

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages