23 lines
663 B
TypeScript
23 lines
663 B
TypeScript
import { downloadMarkdownAsDocx } from "@/core/scheduled-tasks/markdown-docx";
|
|
|
|
/**
|
|
* Unified Markdown → Word export.
|
|
*
|
|
* All download surfaces use the same required Gateway endpoint. The Gateway
|
|
* applies the formal OOXML profile and embeds its bundled title font; there is
|
|
* deliberately no client-font fallback.
|
|
*/
|
|
export async function downloadMarkdownDocxFromBackend(options: {
|
|
title?: string;
|
|
markdown: string;
|
|
}): Promise<void> {
|
|
const markdown = options.markdown.trim();
|
|
if (!markdown) throw new Error("文档内容为空");
|
|
|
|
await downloadMarkdownAsDocx(
|
|
markdown,
|
|
options.title?.trim() || "document",
|
|
options.title,
|
|
);
|
|
}
|