Export as Markdown (.md)
Lossless Markdown export, same source as on disk. GFM tables, fenced code with language hints, image references by R2 URL, inline HTML for image layout.
Markdown export is the canonical format. It downloads the exact Markdown source we save to the database — every character, every fence, every link reference, in the order you wrote it.
# Kyoto, days 1-3 We land in Kyoto on the 12th and have three full days before Osaka. - Reserve the dawn slot at Arashiyama. - Pre-book the Nishiki food tour. ```javascript const total = perDay * 3 ```
How to export
| Path | What happens |
|---|---|
| Doc toolbar → download icon → Markdown (.md) | Browser downloads a file named <title>.md |
| Doc toolbar → copy icon | Copies the same content to your clipboard (no file download) |
The download filename is the doc’s title with the standard filename-safe sanitization, plus .md.
What’s in the file
| Element | Output |
|---|---|
| Title | Prepended as an H1 if your body doesn’t already start with one |
| Headings | # through ###### (level preserved) |
| Inline marks | **bold**, *italic*, ~~strikethrough~~, `code` |
| Links | [text](url) inline format |
| Lists | - for bullets, 1. for ordered, nested with indentation |
| Blockquotes | > |
| Code blocks | Triple-backtick fences with the language hint |
| Tables | GFM pipe tables with the separator row |
| Horizontal rules | --- |
| Images (no width/alignment) |  |
| Images (with width or alignment) | Inline HTML: <img src="…" width="50%" class="img-align-center" data-align="center" /> |
| Hex color swatches | The literal #RRGGBB characters (no special encoding) |
| Comment anchors | Inline <span data-comment-id="…">…</span> |
Image URLs
Markdown export keeps image references as URLs pointing at our R2 storage — it does not download or embed the image bytes. This means:
- The file is small (text only, even for image-heavy docs)
- Images keep loading from the URL as long as the underlying object exists
- Sharing the
.mdfile with someone else: they see the images if they have internet access; the URL itself is public read-only on R2
If you need the images embedded in the export (for offline reading or for hosting on a different system), use Word export instead — it downloads the binaries.
Image layout via inline HTML
Width and alignment on an image don’t serialize as plain Markdown (the syntax has no slot for them). The serializer detects when an image has either attribute set and emits inline HTML instead:
<img src="https://r2.sweetdocs.app/u/abc123" alt="diagram" width="50%" class="img-align-center" data-align="center" />
This is standard inline HTML allowed by every Markdown spec — other Markdown tools that render embedded HTML will show the image correctly with the layout intact. Tools that strip HTML will still show the image (since the <img> tag is preserved by most stripping rules) just at its natural size.
When to use Markdown export
- You’re migrating to another Markdown-based tool
- You want to commit the doc to a Git repository
- You want a small, plain-text archive
- You need the exact source the AI saw (e.g., to debug AI Author behavior)
- You want to manually edit the doc in another editor and bring it back
What’s not in the file
- Comment thread bodies (only the anchor spans)
- Version history
- Share settings, ACL, audit timeline
- AI conversation history
- Document metadata (created_at, owner, library)
- Theme preferences
This is by design — Markdown is the body content, not the application state around it.