StealThis .dev

Wiki — Article Editor (markdown + preview)

A genuinely working markdown article editor in a clean knowledge-base aesthetic. A formatting toolbar wraps or inserts markdown at the selection, a split pane pairs a mono source textarea with a live serif preview rendered by a small from-scratch markdown engine, and a metadata bar carries the title, edit summary, and tags. Synced scrolling links the panes, write/split/preview modes reflow the layout, keyboard shortcuts drive the toolbar, and a footer tracks word count with save-draft and publish actions plus an unsaved-changes indicator.

In Lab öffnen
html css vanilla-js
Targets: JS HTML

Code

Article Editor (markdown + preview)

A functional wiki editor for the fictional Aurora DB article, built in the clean, high-density knowledge-base tradition. A breadcrumb topbar carries the Verdant Wiki mark and a live saved / unsaved-changes badge; below it a metadata bar holds the article title, an edit summary, and a comma-separated tag list. The formatting toolbar groups bold, italic, and inline code, then headings and blockquote, then lists, link, image, and a fenced code block — each button wraps the current selection or prefixes the spanned lines with the right markdown, leaving the inserted text reselected so you can keep typing.

The body is a split pane: a JetBrains Mono source textarea on the left and a live preview on the right, set in a serif face at a generous 1.65 line-height. A small markdown-to-HTML renderer — written from scratch, no libraries — re-parses on every keystroke, handling headings, bold/italic, links and image placeholders, inline and fenced code, blockquotes, ordered and unordered lists, horizontal rules, and paragraphs. The two panes scroll in sync by ratio, and a Write / Split / Preview switch reflows the layout, collapsing to a single column under 820px.

The script wires Ctrl/⌘ + B · I · K · E shortcuts to the toolbar (and S to save), Tab to indent, an unsaved-changes indicator that flips the topbar badge, a live footer with word count, character count, and estimated read time, and Save draft / Publish actions that stamp the footer and fire a toast(). A beforeunload guard warns before discarding unsaved edits.

Illustrative UI only — fictional articles, products, and data.