mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-04 11:50:15 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
a3f2da83d1
16 changed files with 18 additions and 2 deletions
|
|
@ -767,7 +767,7 @@ export const exportMd = (id: string) => {
|
|||
merge: localData.mergeSubdocs,
|
||||
}, async response => {
|
||||
const html = await onExport(response, undefined, {type: "pdf", id});
|
||||
window.JSAndroid.exportPDF(html);
|
||||
window.JSAndroid.print(html);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -649,6 +649,7 @@ export const onExport = async (data: IWebSocketData, filePath: string, exportOpt
|
|||
if (!isDefault) {
|
||||
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>
|
||||
<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>
|
||||
|
|
@ -678,6 +679,7 @@ style="max-width: 800px;margin: 0 auto;" id="preview">${data.data.content}</div>
|
|||
<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>
|
||||
document.body.style.minWidth = ${screenWidth} + "px";
|
||||
window.siyuan = {
|
||||
config: {
|
||||
appearance: { mode: ${mode}, codeBlockThemeDark: "${window.siyuan.config.appearance.codeBlockThemeDark}", codeBlockThemeLight: "${window.siyuan.config.appearance.codeBlockThemeLight}" },
|
||||
|
|
|
|||
3
app/src/types/index.d.ts
vendored
3
app/src/types/index.d.ts
vendored
|
|
@ -245,7 +245,8 @@ interface Window {
|
|||
readHTMLClipboard(): string
|
||||
getBlockURL(): string
|
||||
hideKeyboard(): void
|
||||
exportPDF(html: string): void
|
||||
print(html: string): void
|
||||
getScreenWidthPx(): number
|
||||
};
|
||||
JSHarmony: {
|
||||
openExternal(url: string): void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue