Supported formats
The format is detected from the file extension (case-insensitive); the file content isn't inspected.
| Format | Extensions | Preview |
|---|---|---|
| Markdown | .md, .markdown |
Rendered as a document, with task lists, math (KaTeX) and embedded Mermaid diagrams |
| MDX | .mdx |
Markdown with JSX and {} expressions, laid out like Markdown; components can be imported from agentdocs/components |
| HTML | .html, .htm |
A self-contained page runs in an isolated sandbox |
| Mermaid | .mmd, .mermaid |
Rendered as a diagram |
| SVG | .svg |
Shown after sanitizing |
| DOT (Graphviz) | .dot, .gv |
Laid out by Graphviz in the sandbox and shown as a diagram you can enlarge |
| Vega-Lite | .vl.json |
A Vega-Lite chart spec rendered as an interactive chart (tooltips, selections) |
| Canvas (experimental) | .canvas.tsx, .canvas |
.canvas.tsx: Cursor Canvas components rendered with React in the sandbox; .canvas: JSON Canvas, shown as an infinite canvas you can pan and zoom |
JSON, YAML and plain text aren't separate formats: put them in a Markdown code block tagged json, yaml or text. Uploading a plain .json, .yaml, .yml or .txt file returns 415 with a hint to use a code block; existing documents in these formats were converted to Markdown automatically, with .md added to the filename (config.json is now config.json.md). .qmd and .puml are planned; uploading them currently returns 415 too.
Both Canvas extensions are experimental and carry the same "CAN" tag in the interface, but they render differently. After upload, .canvas.tsx (Cursor Canvas) is transpiled and rendered in the sandbox: imports are only allowed from cursor/canvas, using React 19's JSX runtime. Supported exports and props are listed in the Canvas compatibility table. useHostTheme() follows the system's light or dark mode. useCanvasState() only lasts for the page you have open and resets on reload. useCanvasAction() can't control Cursor; clicking it explains that the action only works inside Cursor. namespace and decorators are rejected before transpiling. Unimplemented modules or exports report UNSUPPORTED_IMPORT with the module and export name. In .canvas (JSON Canvas), text nodes render as Markdown, file nodes only show their path, and link nodes only show the URL without embedding the page.
Boundaries
- Files must be UTF-8 text without NUL bytes. A document may be empty; a new blank document is saved right away.
- HTML runs in a sandbox with no access to this site's data and no network access, so pages that rely on external scripts, styles or images will be missing them; the preview tells you what's missing.
- Source files are stored as is. Sanitizing and conversion for the preview never overwrite the original; a download returns exactly the bytes you uploaded.
- DOT graphs are drawn as an image:
URL,hrefandimageattributes don't become clickable links or load remote images. Graphviz only knows the widths of Latin characters, so labels in other scripts (such as Chinese) may be wider than their boxes; addwidthor padding to those nodes if needed. - MDX can only import from
agentdocs/components, which provides the display components of the Canvas compatibility table:BarChart,Callout,Card,CardBody,CardHeader,Code,CollapsibleSection,DiffStats,Divider,Grid,LineChart,PieChart,Pill,Row,Spacer,Stack,Stat,Swatch,Table,TextandUsageBar(for exampleimport { Callout } from 'agentdocs/components'). Imports from URLs, relative paths or npm packages are reported as errors with the line number. JavaScript in{}expressions andexportruns inside the isolated sandbox, which has no access to this site's data and no network access. - Vega-Lite charts only use inline data: put the rows under
data.values. A remotedata.urlisn't loaded; the preview says so and lists the URL instead of drawing an empty chart. Image marks andhreflinks don't load or open. - When Markdown or a diagram has a syntax error, the preview shows the error (with the line number when known), and you can still switch to "Source" to see the original.