An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: https://github.com/siyuan-note/siyuan/issues/16121
Vanessac8b9eb9b6ba5
diff --git a/app/src/menus/commonMenuItem.ts b/app/src/menus/commonMenuItem.tsindex 747b2de4e5..c896054f18 100644--- a/app/src/menus/commonMenuItem.ts+++ b/app/src/menus/commonMenuItem.ts@@ -5,7 +5,7 @@ import {confirmDialog} from "../dialog/confirmDialog";import {getSearch, isMobile, isValidAttrName} from "../util/functions";import {isLocalPath, movePathTo, moveToPath, pathPosix} from "../util/pathName";import {MenuItem} from "./Menu";-import {saveExport} from "../protyle/export";+import {onExport, saveExport} from "../protyle/export";import {isInAndroid, isInHarmony, openByMobile, writeText} from "../protyle/util/compatibility";import {fetchPost, fetchSyncPost} from "../util/fetch";import {hideMessage, showMessage} from "../dialog/message";@@ -765,8 +765,9 @@ export const exportMd = (id: string) => {id,keepFold: localData.keepFold,merge: localData.mergeSubdocs,- }, response => {- window.JSAndroid.exportPDF(response.data.content);+ }, async response => {+ const html = await onExport(response, undefined, {type: "pdf", id});+ window.JSAndroid.exportPDF(html);});}},diff --git a/app/src/protyle/export/index.ts b/app/src/protyle/export/index.tsindex 626f50708b..6a4cfc9852 100644--- a/app/src/protyle/export/index.ts+++ b/app/src/protyle/export/index.ts@@ -635,7 +635,7 @@ const getExportPath = (option: IExportOptions, removeAssets?: boolean, mergeSubd});};-const onExport = async (data: IWebSocketData, filePath: string, exportOption: IExportOptions, removeAssets?: boolean, msgId?: string) => {+export const onExport = async (data: IWebSocketData, filePath: string, exportOption: IExportOptions, removeAssets?: boolean, msgId?: string) => {let themeName = window.siyuan.config.appearance.themeLight;let mode = 0;if (["html", "htmlmd"].includes(exportOption.type) && window.siyuan.config.appearance.mode === 1) {@@ -711,6 +711,9 @@ id="preview">${data.data.content}</div>})});</script></body></html>`;+ if (typeof filePath === "undefined") {+ return html;+ }const htmlPath = path.join(filePath, "index.html");fs.writeFileSync(htmlPath, html);afterExport(htmlPath, msgId);