Importing — overview
Drop a file anywhere outside the editor and sweetdocs creates a new document from it. Five formats supported, 25 MB cap per file, format-specific converters under the hood.
The fastest way to bring an existing document into sweetdocs is drag-and-drop anywhere outside the active editor. A new document gets created with the file’s content converted to Markdown.
How importing works
There are three entry points:
| Method | Result |
|---|---|
| Drop a file anywhere outside the editor (sidebar, blank space, top bar) | New document is created in the current library |
| Use the upload menu in the sidebar or app | Same — pick from a file picker |
Paste a .md file’s contents into a doc | Goes through Markdown paste handling — see Paste from web |
Dropping a file inside an open editor is different — if it’s an image, it embeds inline; if it’s anything else, it falls through to the page-level drop overlay and creates a new doc.
Supported formats
Five formats, detected by file extension:
| Extension | Where the conversion happens | Notes |
|---|---|---|
.md / .markdown | Client-side | Used as-is; see Importing other formats |
.txt | Client-side | Plain text wrapped as a doc; see Importing other formats |
.docx | Client-side (mammoth + turndown) | See Importing Word |
.rtf | Server-side (/api/ai/convert-rtf, Gemini) | See Importing other formats |
.pdf | Server-side (/api/ai/convert-pdf, LlamaParse) | See Importing PDF |
The accept attribute on the file picker is: .md,.markdown,.txt,.docx,.rtf,.pdf.
File size limit
25 MB per file for any import. Anything larger gets rejected with a toast like:
roadmap.pdf is larger than 25 MB.
The same cap applies whether the file is dropped, picked, or sent via the API. Server-side converters enforce the same number.
What happens after a successful import
- The new document is created in the current library with the converted Markdown as its body
- The document’s title is the filename minus extension (and trimmed)
- Title conflicts with existing docs in the same folder are resolved by suffix-renaming
- The new document opens in the editor automatically
- Any warnings from the converter (e.g., “3 images skipped”, “1 page failed to convert”) show as a toast
Errors
The converter returns one of these error kinds when it can’t proceed:
| Kind | Message you’ll see | What it means |
|---|---|---|
empty | ”filename is empty.” | Zero-byte file |
too_large | ”filename is larger than 25 MB.” | Over the size cap |
unsupported | ”filename is not a supported format. Try .md, .txt, .docx, .rtf or .pdf.” | Wrong extension |
conversion_failed | Format-specific message | Server returned an error; sometimes auth-related |
quota_exceeded | Format-specific message | LLM-backed converters (RTF, PDF) hit your monthly quota |
misconfigured | Format-specific message | Server-side configuration issue (rare) |
Multiple files at once
You can drop multiple files in one go. Each file becomes its own document, processed in series. Errors on one file don’t stop the rest of the batch.
What about importing into an existing doc?
Imports always create a new document. To merge external content into an existing doc, open the doc and paste the source as text (see Paste from web for paste behavior) or open the import as a new doc and copy-paste sections across.