KANTO DS v1.12.0
Customise

Theme

Accent

Font

Corners

Density

Text size

Reset to Kanto
Templates

Editor

GitHub Copy link

A document editor: documents in folders, Markdown with a preview, autosave and versions.

Demo

Live demo
Editor

The frame is the template itself, running. Everything in it works.

What to try

  • Select a word and press Bold — or Cmd+B (Ctrl+B).
  • Type, wait for Saved, reload: your text is there.
  • Open History after a minute of writing, and restore the older text: it asks first, and keeps what you had as a version too.
  • Make a New document, then delete it — that asks first as well.

Start a project

npm create kanto@latest my-app -- --template editor --stack react

Or fork it as it is, without the tool:

npx degit MrArnaudMichel/kanto/templates/editor-react my-app

What is inside

Northwind Docs: documents in folders on the side, a page to write in Markdown with a toolbar and a preview beside it, autosave, and a version kept every minute to go back to.

What is written stays plain text. The toolbar wraps the selection (src/formatting.ts), the preview is drawn by a small renderer that puts text in as text (src/markdown.ts), and the documents live in this browser until src/store.ts talks to your backend.

Route What it shows
/ The first document.
/doc/<id> A document: the page, the preview, its history.
To change first What it holds
src/store.ts Where documents are kept. Call your backend here.
src/content.ts The example documents.
src/formatting.ts What the toolbar does to the text.
src/markdown.ts How the preview is drawn.

Components