Files
paseo/plugin-examples/markdown-panel
Mohamed Boudra cd102d08b6 fix(file-panels): Settings offers Source where the picker does, and review follow-ups
- Settings > Files offers Source on every key except those a built-in panel of
  another kind (Image) claims, so a plugin that alone claims a text extension
  shows the same choices as the picker.
- Delete the unused isSourceFilePanel.
- The Markdown example warns with the file name when its unmount write fails,
  rather than dropping the edit silently.
- Document that PluginFile stat fields are read at render time and that watch
  or the read hooks are how a panel learns they changed.
2026-10-20 08:07:00 +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.