mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
This commit is contained in:
parent
a3f2da83d1
commit
ea2da27c0b
2 changed files with 6 additions and 3 deletions
|
|
@ -760,6 +760,7 @@ export const exportMd = (id: string) => {
|
||||||
icon: "iconPDF",
|
icon: "iconPDF",
|
||||||
ignore: !isInAndroid(),
|
ignore: !isInAndroid(),
|
||||||
click: () => {
|
click: () => {
|
||||||
|
const msId = showMessage(window.siyuan.languages.exporting);
|
||||||
const localData = window.siyuan.storage[Constants.LOCAL_EXPORTPDF];
|
const localData = window.siyuan.storage[Constants.LOCAL_EXPORTPDF];
|
||||||
fetchPost("/api/export/exportPreviewHTML", {
|
fetchPost("/api/export/exportPreviewHTML", {
|
||||||
id,
|
id,
|
||||||
|
|
@ -768,6 +769,9 @@ export const exportMd = (id: string) => {
|
||||||
}, async response => {
|
}, async response => {
|
||||||
const html = await onExport(response, undefined, {type: "pdf", id});
|
const html = await onExport(response, undefined, {type: "pdf", id});
|
||||||
window.JSAndroid.print(html);
|
window.JSAndroid.print(html);
|
||||||
|
setTimeout(() => {
|
||||||
|
hideMessage(msId);
|
||||||
|
}, 3000);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -649,7 +649,6 @@ export const onExport = async (data: IWebSocketData, filePath: string, exportOpt
|
||||||
if (!isDefault) {
|
if (!isDefault) {
|
||||||
themeStyle = `<link rel="stylesheet" type="text/css" id="themeStyle" href="${servePath}appearance/themes/${themeName}/theme.css?${Constants.SIYUAN_VERSION}"/>`;
|
themeStyle = `<link rel="stylesheet" type="text/css" id="themeStyle" href="${servePath}appearance/themes/${themeName}/theme.css?${Constants.SIYUAN_VERSION}"/>`;
|
||||||
}
|
}
|
||||||
const screenWidth = window.JSAndroid.getScreenWidthPx();
|
|
||||||
const html = `<!DOCTYPE html>
|
const html = `<!DOCTYPE html>
|
||||||
<html lang="${window.siyuan.config.appearance.lang}" data-theme-mode="${getThemeMode()}" data-light-theme="${window.siyuan.config.appearance.themeLight}" data-dark-theme="${window.siyuan.config.appearance.themeDark}">
|
<html lang="${window.siyuan.config.appearance.lang}" data-theme-mode="${getThemeMode()}" data-light-theme="${window.siyuan.config.appearance.themeLight}" data-dark-theme="${window.siyuan.config.appearance.themeDark}">
|
||||||
<head>
|
<head>
|
||||||
|
|
@ -674,12 +673,12 @@ export const onExport = async (data: IWebSocketData, filePath: string, exportOpt
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="${["htmlmd", "word"].includes(exportOption.type) ? "b3-typography" : "protyle-wysiwyg" + (window.siyuan.config.editor.displayBookmarkIcon ? " protyle-wysiwyg--attr" : "")}"
|
<div class="${["htmlmd", "word"].includes(exportOption.type) ? "b3-typography" : "protyle-wysiwyg" + (window.siyuan.config.editor.displayBookmarkIcon ? " protyle-wysiwyg--attr" : "")}"
|
||||||
style="max-width: 800px;margin: 0 auto;" id="preview">${data.data.content}</div>
|
style="${window.JSAndroid ? "margin: 0 16px;" : "max-width: 800px;margin: 0 auto;"}" id="preview">${data.data.content}</div>
|
||||||
<script src="${servePath}/appearance/icons/${window.siyuan.config.appearance.icon}/icon.js?v=${Constants.SIYUAN_VERSION}"></script>
|
<script src="${servePath}/appearance/icons/${window.siyuan.config.appearance.icon}/icon.js?v=${Constants.SIYUAN_VERSION}"></script>
|
||||||
<script src="${servePath}/stage/build/export/protyle-method.js?v=${Constants.SIYUAN_VERSION}"></script>
|
<script src="${servePath}/stage/build/export/protyle-method.js?v=${Constants.SIYUAN_VERSION}"></script>
|
||||||
<script src="${servePath}/stage/protyle/js/lute/lute.min.js?v=${Constants.SIYUAN_VERSION}"></script>
|
<script src="${servePath}/stage/protyle/js/lute/lute.min.js?v=${Constants.SIYUAN_VERSION}"></script>
|
||||||
<script>
|
<script>
|
||||||
document.body.style.minWidth = ${screenWidth} + "px";
|
${window.JSAndroid ? document.body.style.minWidth = window.JSAndroid.getScreenWidthPx() + "px" : ""};
|
||||||
window.siyuan = {
|
window.siyuan = {
|
||||||
config: {
|
config: {
|
||||||
appearance: { mode: ${mode}, codeBlockThemeDark: "${window.siyuan.config.appearance.codeBlockThemeDark}", codeBlockThemeLight: "${window.siyuan.config.appearance.codeBlockThemeLight}" },
|
appearance: { mode: ${mode}, codeBlockThemeDark: "${window.siyuan.config.appearance.codeBlockThemeDark}", codeBlockThemeLight: "${window.siyuan.config.appearance.codeBlockThemeLight}" },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue