mohio

Document Editing and Persistence

This document covers how Mohio currently reads, edits, saves, renames, and re-syncs Markdown documents.

Scope

Document Model

Each loaded document currently returns:

The renderer edits two draft fields:

Title Resolution

When Mohio reads a Markdown file, it picks one of two title modes:

  1. h1-linked
    • active when the first H1 (after optional leading blank lines) sanitizes to the same value as the sanitized filename stem
    • visible title comes from that H1
    • the leading H1 is removed from the editable body
  2. filename-linked
    • active when no first H1 exists, or when sanitized H1 and sanitized filename stem differ
    • visible title comes from the filename stem
    • the body is kept as-is (no title-driven H1 stripping)

frontmatter.title is ignored for visible-title resolution.

Save Behavior

On save, Mohio rebuilds the file with:

Document Creation and Deletion

Filename Rules

Editor Surface

Markdown Editing Model

Autosave

External File Changes

Commit Hooks in Editing Flow

Current Limitations

Code Anchors