{
  "welcome": "# A markdown editor that reads like a book\n\nWelcome to **themarkdown**, a free, in-browser markdown editor for long-form prose. No sign-up, no server, no telemetry. Everything you type stays in your device.\n\nStart typing here, or open the **File** menu to begin fresh.\n\n## Try a few things\n\n- Press `Cmd/Ctrl+B` to bold a selection. `Cmd/Ctrl+Z` reverses it cleanly.\n- Drop a `.md` file onto this window to open it as a new tab.\n- Press `Cmd/Ctrl+F` to find & replace, or `Cmd/Ctrl+P` to fuzzy-find across all your tabs.\n- Type `/` at the start of a line to summon a command palette.\n- Open **Tools → Settings → Themes** to browse all 32 themes (or roll your own).\n\n## What it can do\n\n- All standard markdown, headings, lists, links, images, tables, code\n- Footnotes, definition lists, task lists\n- Math (KaTeX) and diagrams (Mermaid), opt-in, never auto-loaded\n- Find & replace with regex\n- Version history with one-click restore\n- Sync-scrolled live preview\n- Self-contained HTML export with theme baked in\n- DOCX, PDF, and shareable-URL exports\n- Works offline once installed as a PWA\n\nOpen **Help → How to use** for the longer tour, or just keep writing.",

  "templates": [
    {
      "id": "blank",
      "name": "Blank",
      "desc": "An empty document, start from a blank page.",
      "body": ""
    },
    {
      "id": "essay",
      "name": "Essay",
      "desc": "Long-form prose with sections, footnotes, and an epigraph.",
      "body": "# Title of the essay\n\n> An epigraph that frames what follows. *Author*\n\n## I.\n\nOpening paragraph. Set the scene, establish stakes, hint at the argument. Don't bury the lede.\n\nA second paragraph that extends or complicates the first. Introduce a tension the rest of the essay will resolve.[^1]\n\n## II.\n\nThe middle. This is where most of the work happens. Develop the argument with examples, evidence, asides. A good essay earns its conclusions; this section is the ledger of that earning.\n\nA quote, perhaps:\n\n> Something a smarter person said, related to the point.\n\n## III.\n\nThe turn. Reverse, deepen, or recontextualize what came before.\n\n## IV.\n\nLand. The closing should feel inevitable in retrospect, the reader had to come here, even if they didn't see it coming.\n\n[^1]: A footnote, for a citation, an aside, or a tangent that would derail the main flow."
    },
    {
      "id": "blog",
      "name": "Blog post",
      "desc": "A blog post template with intro, body sections, and a closing thought.",
      "body": "# A title that earns the click\n\n*Published on [date]. Reading time: ~7 minutes.*\n\nThe lede paragraph. State the question or claim. Hook the reader without being clickbait, promise something specific, then deliver it.\n\n## The setup\n\nWhat's the situation? Why does this matter now? Two or three paragraphs that orient the reader without dragging.\n\n## The body\n\nThe main argument or story. Use sub-headings if you have more than one beat:\n\n### A specific point\n\nDevelop it. Use examples. Don't be afraid of a list when the structure is genuinely a list:\n\n- One bullet\n- Another bullet\n- A third bullet that proves the pattern\n\n### A counterpoint\n\nAcknowledge what doesn't fit. Steel-man the opposing view. Explain why your view still holds.\n\n## What this means\n\nThe takeaway. Not a summary, a *consequence*. What should the reader do, think, or notice differently after reading this?\n\n---\n\n*Subscribe, follow, get in touch, whatever the call to action is.*"
    },
    {
      "id": "readme",
      "name": "README",
      "desc": "A project README with badges, install, usage, and license.",
      "body": "# Project name\n\n> One-line description that tells someone what this is in under twelve words.\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n## Install\n\n```bash\nnpm install project-name\n# or\npnpm add project-name\n```\n\n## Usage\n\n```javascript\nimport { thing } from 'project-name';\n\nthing.do(\"hello\");\n```\n\n## API\n\n### `thing.do(input: string): string`\n\nDoes the thing. Returns the result.\n\n## Why?\n\nA paragraph or two on the motivation. What problem does this solve? What's the philosophy?\n\n## Contributing\n\nPRs welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for the workflow.\n\n## License\n\n[MIT](LICENSE)."
    },
    {
      "id": "letter",
      "name": "Letter",
      "desc": "A formal or semi-formal letter.",
      "body": "*Your address*  \n*City, postcode*\n\n*[Date]*\n\n*Recipient name*  \n*Their address*  \n*City, postcode*\n\nDear *[Recipient]*,\n\nA strong opening line, a reason for writing, stated plainly.\n\nThe substance. One topic per paragraph. Be specific. Be brief. Don't pad.\n\nIf there's an ask, make it explicit and easy to act on. If there's a thank-you, make it concrete, name the thing.\n\nA closing that lands.\n\nYours sincerely,\n\n*Your name*"
    },
    {
      "id": "meeting",
      "name": "Meeting notes",
      "desc": "A meeting notes template with agenda, decisions, and action items.",
      "body": "# Meeting · *[topic]*\n\n**Date:** *[date]*  \n**Attendees:** *Alice, Bob, Carol*  \n**Recorder:** *Bob*\n\n## Agenda\n\n1. Topic one\n2. Topic two\n3. Topic three\n\n## Discussion\n\n### Topic one\n\nWhat was raised. The shape of the conversation. Disagreements (with sources).\n\n### Topic two\n\nDitto.\n\n### Topic three\n\nDitto.\n\n## Decisions\n\n- ✅ Decided to do *X*. Owner: *Alice*. Reason: *...*\n- ✅ Deferred *Y* until next month, depends on *Z*\n- 🚫 Rejected *W*, failed the cost/benefit test\n\n## Action items\n\n- [ ] *Alice*, draft the proposal by Friday\n- [ ] *Bob*, schedule the follow-up\n- [ ] *Carol*, circulate the budget numbers\n\n## Next meeting\n\n*[date / topic]*"
    },
    {
      "id": "brief",
      "name": "Design brief",
      "desc": "A design or research brief, context, goals, constraints, success metrics.",
      "body": "# *[Project name]* brief\n\n## Context\n\nA paragraph on the situation. What's true today? What changed to make this brief necessary now?\n\n## Goal\n\nOne sentence. The single most important outcome. If this is achieved and nothing else is, the project succeeded.\n\n## Non-goals\n\n- Things this project will *not* address\n- Boundaries that protect against scope creep\n- Adjacent problems someone might confuse with this one\n\n## Audience\n\nWho is this for? Be specific. \"Power users on macOS who write more than 500 words a day in markdown\" is more useful than \"writers.\"\n\n## Constraints\n\n- Technical: *...*\n- Time: *...*\n- Budget: *...*\n- Brand: *...*\n\n## Success metrics\n\n| Metric | Baseline | Target |\n| ------ | -------- | ------ |\n| Metric A | *current* | *target* |\n| Metric B | *current* | *target* |\n\n## Open questions\n\n- A question whose answer would change the approach\n- Another question worth flagging early\n\n## References\n\n- Link · *what you'll learn from it*\n- Link · *what you'll learn from it*"
    },
    {
      "id": "recipe",
      "name": "Recipe",
      "desc": "A recipe with ingredients, method, and notes.",
      "body": "# *[Recipe name]*\n\n*Serves [N]. Prep [time]. Cook [time]. Total [time].*\n\nA paragraph on what this dish is, texture, flavour, when to make it.\n\n## Ingredients\n\n- *[amount]* *[ingredient]*\n- *[amount]* *[ingredient]*\n- *[amount]* *[ingredient]*, finely chopped\n- A pinch of *[seasoning]*\n\n## Method\n\n1. Step one, what to do, how to know it's done\n2. Step two, and the next thing\n3. Step three, sensory cue to watch for\n4. Step four, final assembly\n5. Serve, temperature, accompaniment, garnish\n\n## Notes\n\n- Substitution: *[ingredient]* can be replaced with *[alt]* if needed\n- Make ahead: *[which steps can be done in advance]*\n- Storage: *[fridge / freezer / shelf, how long]*"
    }
  ],

  "samples": [
    {
      "name": "Showcase",
      "desc": "A tour of every feature, headings, lists, tables, code, math, footnotes, blockquotes, images.",
      "src": "# Showcase\n\nA tour of what themarkdown can render.\n\n## Headings\n\n# Heading 1\n## Heading 2\n### Heading 3\n#### Heading 4\n##### Heading 5\n###### Heading 6\n\n## Inline emphasis\n\n*Italic*, **bold**, ***bold italic***, ~~strikethrough~~, `inline code`, [a link](https://example.com).\n\n## Lists\n\nUnordered:\n\n- One\n- Two\n  - Nested\n  - Deeper\n- Three\n\nOrdered:\n\n1. First\n2. Second\n3. Third\n\nTask list:\n\n- [x] Done\n- [ ] Not yet\n- [ ] Later\n\n## Blockquote\n\n> Read like a writer. Write like a reader.\n>\n>, *probably someone*\n\n## Code\n\nInline `const x = 42` and a fenced block:\n\n```javascript\nfunction greet(name) {\n  return `Hello, ${name}!`;\n}\n\ngreet('themarkdown');\n```\n\n## Math\n\nInline math: $E = mc^2$. Block math:\n\n```math\n\\int_{-\\infty}^{\\infty} e^{-x^2} \\, dx = \\sqrt{\\pi}\n```\n\n## Diagrams\n\n```mermaid\nflowchart LR\n  A[Editor] --> B[Marked parse]\n  B --> C[Preview]\n  C --> D[You read]\n```\n\n## Tables\n\n| Feature | v1 | v2 |\n| ------- | -- | -- |\n| Themes | 9 | 32 |\n| Storage | localStorage | OPFS |\n| Render path | sync | sync + worker |\n| Bundle | inline IIFE | split |\n\n## Definition list\n\nMarkdown\n: A lightweight markup language for plain-text formatting.\n\nKaTeX\n: A fast math typesetting library that runs in the browser.\n\n## Footnotes\n\nThis sentence has a footnote.[^a]\n\n[^a]: And here is the footnote, with a return arrow."
    },
    {
      "name": "Long-form essay",
      "desc": "Pure prose, no code, no math. The kind of thing that reads best in a wide column with editorial typography.",
      "src": "# On reading slowly\n\n> *The first sentence can't be written until the final sentence is written.*, Joyce Carol Oates\n\n## I.\n\nThere's a fashion for fast reading, apps that flash one word at a time, summary services, executive condensations of philosophical works. The premise is that reading is a delivery system for information, and any technology that increases throughput is a net good.\n\nThis premise is wrong. Reading is not a delivery system. It is a particular use of attention, and the value of that use of attention is partly intrinsic to the slowness of the reading itself.\n\nWhen I read slowly, when I let the rhythm of the prose carry me, when I stop at a strange word, when I re-read a sentence to understand why the writer chose *that* sentence, I am doing something that summary cannot replace. I am inhabiting the writer's mind for the duration of the sentence. Summary is the sound of a mind being abstracted away.\n\n## II.\n\nThis isn't an argument against speed reading per se. There are texts that earn no more than a skim, most professional reading, most news, most marketing copy. Reading those slowly would be a waste of attention, and attention is finite.\n\nThe argument is against the *ideology* of speed: the assumption that faster is always better, that the texts which deserve slow reading are an indulgence, that the sign of an efficient mind is the rate at which it consumes input.\n\nIf you've ever read a poem twice, you know this is wrong. The second reading is where the poem happens. The first reading was a kind of survey, necessary, but not the thing itself.\n\n## III.\n\nIt's easier to read fast on screens. The infrastructure rewards it: scrollable feeds, autoplay, infinite continuation. Slow reading on a screen requires friction, a tab that's the only one open, a window that's the right size, no notifications.\n\nThis is partly why people retreat to paper for slow reading. Paper has a shape that ends. The book closes. The chapter is twelve pages. There is no way to scroll past the moment when the writer wanted you to pause, because the page itself is the pause.\n\nA good editor can recreate some of this on a screen. A column of comfortable width, a serif font, generous leading, a paper-coloured background. None of this is decoration. It's the minimum infrastructure for the kind of attention that reading rewards.\n\n## IV.\n\nThe last few years I've been keeping a list of books that taught me to read more slowly. They aren't the most important books I've read; they're the ones that, by their density or strangeness or sheer beauty, simply *required* slowness as the cost of admission.\n\nI won't list them here. The list is personal, and you'd find your own, the books that, for you, are uncondensable.\n\nWhat I'll say is this: when you find such a book, treat it as practice. The reading habits you build there will travel back into the rest of your reading life. You'll start to notice when a sentence is asking you to slow down, even in a book that didn't seem to demand it.\n\nThat noticing is the skill. Once you have it, you have something the algorithms can't take from you."
    },
    {
      "name": "Code-heavy",
      "desc": "Technical content, multiple languages, fences with line counts that stretch, mixed prose and code.",
      "src": "# Tour of fenced code\n\nA short walk through the languages themarkdown's syntax highlighter recognises out of the box.\n\n## JavaScript\n\n```javascript\nasync function loadDocs() {\n  const res = await fetch('/api/docs');\n  if (!res.ok) throw new Error(`HTTP ${res.status}`);\n  const data = await res.json();\n  return data.map(d => ({\n    id: d.id,\n    title: d.title,\n    updatedAt: new Date(d.updated_at)\n  }));\n}\n\nloadDocs()\n  .then(docs => console.table(docs))\n  .catch(err => console.error('failed:', err));\n```\n\n## TypeScript\n\n```typescript\ninterface User {\n  id: string;\n  name: string;\n  active: boolean;\n}\n\nasync function getUser(id: string): Promise<User | null> {\n  const cached = await store.get(`user:${id}`);\n  if (cached) return JSON.parse(cached) as User;\n  return db.users.findFirst({ where: { id, active: true } });\n}\n```\n\n## Python\n\n```python\nfrom dataclasses import dataclass\nfrom typing import Optional\n\n@dataclass\nclass User:\n    id: str\n    name: str\n    active: bool = True\n\ndef get_user(uid: str) -> Optional[User]:\n    cached = cache.get(f\"user:{uid}\")\n    if cached:\n        return User(**cached)\n    row = db.execute(\"SELECT * FROM users WHERE id = ?\", (uid,)).fetchone()\n    return User(**row) if row else None\n```\n\n## Rust\n\n```rust\nuse std::collections::HashMap;\n\n#[derive(Debug, Clone)]\npub struct User {\n    pub id: String,\n    pub name: String,\n    pub active: bool,\n}\n\nimpl User {\n    pub fn greet(&self) -> String {\n        format!(\"Hello, {}!\", self.name)\n    }\n}\n```\n\n## Go\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"net/http\"\n)\n\nfunc handler(w http.ResponseWriter, r *http.Request) {\n  fmt.Fprintf(w, \"Hello, %s!\", r.URL.Path[1:])\n}\n\nfunc main() {\n  http.HandleFunc(\"/\", handler)\n  http.ListenAndServe(\":8080\", nil)\n}\n```\n\n## Shell\n\n```bash\nset -euo pipefail\n\nfor f in *.md; do\n  pandoc \"$f\" -o \"out/${f%.md}.html\"\nfone\n```\n\n## SQL\n\n```sql\nSELECT u.name, COUNT(d.id) AS doc_count\nFROM users u\nLEFT JOIN documents d ON d.user_id = u.id\nWHERE u.active = TRUE\nGROUP BY u.name\nORDER BY doc_count DESC\nLIMIT 10;\n```\n\nMix of these in one document is the real test, themarkdown handles them all without slowing the editor's main thread, because parsing happens off-thread once the doc crosses 1500 lines."
    }
  ]
}
