Files
paseo/plugin-examples/markdown-panel
Mohamed Boudra 58edbdcd0e fix(plugins): file events are objects, deletion is a typed error, DocumentFrame owns its fallback
- watch listeners receive { type: "changed" } | { type: "deleted" }, so later
  versions can add fields without breaking them.
- PluginFileDeletedError joins PluginFileConflictError. The read hooks report a
  deleted file with it, and a write over a deleted file rejects with it; Source
  shows that as the deleted notice. PluginFileConflictError now means only
  "changed on disk".
- DocumentFrame on Android shows Paseo's "<TYPE> files can't be shown on this
  device" message for documents its WebView cannot display, so the PDF example
  is useFileUrl + Loading + DocumentFrame with no platform branch.
2026-10-20 08:18:20 +02:00
..

Markdown file panel example

Requires Paseo 0.13.0 or later. Install the editor dependencies, then install this directory:

cd plugin-examples/markdown-panel
npm install
paseo plugin install "$PWD"

Open a .md or .markdown file in Files. Choose Rich Markdown — markdown-panel in the picker. Check Don't ask me again to remember the choice on this device.

The panel is a CodeMirror editor with Markdown highlighting, line numbers, undo, redo, and line wrapping. It reads the file once with readText, saves 500 ms after the last edit with writeText, and reports unsaved edits with tab.setModified. When the file changes on disk with nothing unsaved, it reads again; with unsaved edits, or when a write rejects with PluginFileConflictError, it offers Reload and Overwrite. The bar's switcher still offers Paseo's Markdown and Source panels. Native shows selectable, read-only text through useFileText.

Paseo bundles the editor dependencies into this plugin. They are loaded only on web; the native path uses React Native primitives. DOM integration lives in client/web.ts.

See the file panel reference.