mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-12 17:26:17 +00:00
fix exporting storage's notes as PDFs
This commit is contained in:
@@ -5,8 +5,7 @@ import filenamify from 'filenamify'
|
||||
import path from 'path'
|
||||
import fs from 'fs'
|
||||
import exportNote from './exportNote'
|
||||
import formatMarkdown from './formatMarkdown'
|
||||
import formatHTML from './formatHTML'
|
||||
import getContentFormatter from './getContentFormatter'
|
||||
import getFilename from './getFilename'
|
||||
|
||||
/**
|
||||
@@ -43,31 +42,7 @@ function exportStorage(storageKey, fileType, exportDir, config) {
|
||||
}))
|
||||
})
|
||||
.then(({ storage, notes }) => {
|
||||
let contentFormatter = null
|
||||
if (fileType === 'md') {
|
||||
contentFormatter = formatMarkdown({
|
||||
storagePath: storage.path,
|
||||
export: config.export
|
||||
})
|
||||
} else if (fileType === 'html') {
|
||||
contentFormatter = formatHTML({
|
||||
theme: config.ui.theme,
|
||||
fontSize: config.preview.fontSize,
|
||||
fontFamily: config.preview.fontFamily,
|
||||
codeBlockTheme: config.preview.codeBlockTheme,
|
||||
codeBlockFontFamily: config.editor.fontFamily,
|
||||
lineNumber: config.preview.lineNumber,
|
||||
indentSize: config.editor.indentSize,
|
||||
scrollPastEnd: config.preview.scrollPastEnd,
|
||||
smartQuotes: config.preview.smartQuotes,
|
||||
breaks: config.preview.breaks,
|
||||
sanitize: config.preview.sanitize,
|
||||
customCSS: config.preview.customCSS,
|
||||
allowCustomCSS: config.preview.allowCustomCSS,
|
||||
storagePath: storage.path,
|
||||
export: config.export
|
||||
})
|
||||
}
|
||||
const contentFormatter = getContentFormatter(storage, fileType, config)
|
||||
|
||||
const folderNamesMapping = {}
|
||||
storage.folders.forEach(folder => {
|
||||
|
||||
@@ -8,7 +8,7 @@ import formatPDF from './formatPDF'
|
||||
* @param {Object} config
|
||||
*/
|
||||
|
||||
export default function getContentFormatterr(storage, fileType, config) {
|
||||
export default function getContentFormatter(storage, fileType, config) {
|
||||
if (fileType === 'md') {
|
||||
return formatMarkdown({
|
||||
storagePath: storage.path,
|
||||
|
||||
Reference in New Issue
Block a user