mdNotebook
mdNotebook keeps notebooks of markdown (a diary, a book, the pages of a website) on your own server, with a full copy on each of your devices. You can read and write with no signal at all, on a train or a plane, and everything syncs when you're back online.
How it fits together
- The server holds each notebook as plain files in a directory: no database. It checks every change against the notebook's rules, keeps the bin, and can run a command after changes (a hook), for example to commit to git and rebuild a website.
- The apps (Android, desktop, web, and
mdnon the command line) each keep a full copy of the notebooks they use, and sync it with the server: straight away after each change while online, and every so often in the background.
Notebooks, sections and pages
A notebook is divided into sections (directories), which hold pages and more sections. A page is a
directory named NAME.page, holding its markdown in page.md and any attached files (photos, PDFs)
beside it, linked from the page with ordinary relative links:
food/ a section
food/chili.page/page.md a page
food/chili.page/chili.jpg one of its attached files
A page can start with a few key: value lines of metadata (title, author, when it was written).
Drafts
Editing a page makes a draft, so the published page doesn't change until you publish. Drafts sync too, so you can start one on your phone and finish it on your laptop. A brand new page is a draft until it's first published.
When two devices disagree
If a page was changed differently on two devices before they synced, nothing is lost: the server's version stays, and the other is kept beside it as a conflict copy. The apps flag the page, show you both, and let you keep either.
The bin
Deleting anything moves it to the bin, which syncs like everything else. It can be restored from any device for 90 days (the server's administrator can change that).
Where to go next
- Running a server: installing it, configuring it, and hooks.
- The protocol: exactly how the notebook format, the server and the apps work, for anyone writing a client or wanting the details.
- Developing mdNotebook.