feat: Add embedMarkdown to upload response and document attachment format
Build and Push Outline MCP Docker Image / build (push) Successful in 7s

The upload response now includes an embedMarkdown field with the correct
Outline attachment syntax ([name size](/api/attachments.redirect?id=...))
so callers can insert it directly into documents for native card rendering.

IMPLEMENTATION.md updated with storage backend details, auth header,
and embedding format documentation.
This commit is contained in:
2026-05-25 02:52:49 +00:00
parent c68bb66de1
commit 176e1f1040
2 changed files with 68 additions and 4 deletions
+13 -4
View File
@@ -684,16 +684,25 @@ async def upload_endpoint(request: Request) -> JSONResponse:
logger.info("Upload to storage completed successfully")
# 4. Return success and attachment metadata
# 4. Return success with attachment metadata and embedding markdown
att_name = attachment_data.get("name", filename)
att_size = attachment_data.get("size", size)
att_url = attachment_data.get("url", "")
# Outline renders attachment cards when the link text is "filename size"
# and the href is the relative /api/attachments.redirect path.
embed_markdown = f"[{att_name} {att_size}]({att_url})"
return JSONResponse(
{
"ok": True,
"data": {
"id": attachment_data.get("id"),
"name": attachment_data.get("name"),
"size": attachment_data.get("size"),
"name": att_name,
"size": att_size,
"contentType": attachment_data.get("contentType"),
"url": attachment_data.get("url"),
"url": att_url,
"embedMarkdown": embed_markdown,
},
}
)