Importing other formats
Markdown, plain text, and RTF imports. Each has a small, specific pipeline. This page is the one-shot reference.
Beyond Word and PDF, sweetdocs supports three smaller formats. Each one has a straightforward pipeline.
.md / .markdown
The path of least resistance: the file is read as text and used as-is as the new document’s body.
| Aspect | Behavior |
|---|---|
| Conversion | None — the bytes become the doc |
| Encoding | UTF-8 expected; UTF-16 also accepted via the browser’s FileReader.readAsText |
| Frontmatter | Not stripped — YAML frontmatter at the top stays in the body |
| Images referenced as remote URLs | Stay as-is (no re-upload) — they render via the URL each time the doc opens |
| Images referenced by relative path | The path stays as-is; the image won’t load unless the path matches our R2 storage |
Markdown imports are the lossless path. Use this when migrating from another Markdown-based tool: export your docs as .md, drop them in, every Markdown construct that sweetdocs supports (see Markdown essentials) round-trips perfectly.
.txt
Plain text. The file becomes the document body verbatim.
| Aspect | Behavior |
|---|---|
| Conversion | None — content used as-is |
| Encoding | UTF-8 expected |
| Line breaks | Preserved literally |
| Markdown shortcuts | Don’t trigger — pasted/imported text isn’t subject to the live # → heading transforms |
If your .txt has Markdown-style syntax in it, it’ll still render correctly the first time you open the doc, because the Edit-mode Tiptap parser sees the #, *, etc. as Markdown. But you can also leave it as plain text — there’s no auto-detection.
.rtf
RTF (Rich Text Format) goes server-side via /api/ai/convert-rtf, where Gemini converts the RTF source to clean Markdown.
Why an LLM and not a parser? Word’s RTF dialect has too many edge cases — every version of Word, Pages, and TextEdit emits slightly different RTF. A hand-rolled parser would be brittle. Sending the source to an LLM gives much better output at a low marginal cost per file.
| Aspect | Behavior |
|---|---|
| Conversion | Server-side via Gemini |
| Auth | Required (you must be signed in) |
| Quota | Counts against the AI quota (same as AI Author) |
| Speed | Typically a couple of seconds per file |
| What’s preserved | Headings, bold/italic, lists, tables, links, paragraphs — same fidelity profile as Word import |
| What’s dropped | Embedded objects (OLE), images embedded in RTF (rare; usually external paths), exotic style attributes |
For RTF files that are just prose, the import quality is high. For RTF files that are de facto Word docs saved in RTF, consider saving as .docx and using the Word import path instead — Word’s structure is preserved more cleanly there.
What’s not supported
Formats we don’t accept in v1:
| Extension | Why |
|---|---|
.doc (legacy Word, pre-2007) | The binary format. Save as .docx first. |
.odt (OpenDocument) | Not in v1. Export from your editor as .docx or .md. |
.pages (Apple Pages) | Not in v1. Export as .docx or .pdf. |
.epub | Not in v1. |
.html / .htm files | Not in v1. The closest path is to open the file in a browser and use the paste-from-web flow. |
.numbers, .xlsx, .csv | Not in v1 — sweetdocs doesn’t have a spreadsheet model. |
The accept attribute on the file picker is intentionally narrow (.md,.markdown,.txt,.docx,.rtf,.pdf) so picking an unsupported file fails fast.