Plugin reference
Each file is rendered by the first plugin that accepts it. Order matters: specific formats are tried before code, whose lexers accept almost any extension, and plain text is the catch-all.
| Plugin | Handles | Views | Anchor |
|---|---|---|---|
| markdown | .md, .markdown | Rendered, Source | line |
| json | .json | Raw, Formatted | line |
| csv | .csv (comma-separated only) | Table, Source | cell |
| image | .png, .jpg, .gif, .webp, .svg | Image | region |
| audio | .mp3, .wav, .ogg, .m4a, .flac | Player | time |
| video | .mp4, .webm, .mov, .ogv | Player | region_time |
| code | Anything chroma has a lexer for | Highlighted source | line |
| plaintext | Everything else | Text | line |
Anchors
- line: a start and end line. Gloss stores a few lines of context either side so it can follow the text when the file changes.
- cell: the CSV record's line span, a column, and the column's header. After an edit, the column is found again by header text. If the header is gone the thread orphans.
- region: a rectangle on an image, as fractions (0–1) of its width and height.
- time: a start and end in seconds on an audio file.
- region_time: a rectangle on a video frame plus a time range.
Media files cannot be re-located after an edit, so if the file changes, its region and time threads are orphaned. They stay visible and can be reopened.
Limits
- Files over 1 MB fall back to plain text.
- Binary files are shown as a placeholder.
- Raw HTML inside markdown is stripped, not rendered.
- Tab-separated files render as text.
- Images, audio and video over 25 MB are not previewed. SVG is shown as an image only.
- PDF annotation is not available yet.
Writing a plugin
Plugins live in internal/plugins/ and implement a small interface that returns one or more
named HTML views. Line-addressable output follows the data-line attribute convention, which
gives selection, highlighting, re-anchoring and MCP support for free. The repository's
/new-plugin command scaffolds the renderer, tests and fixtures. See
the checklist.