mirror of
https://github.com/NohamR/pdfy.git
synced 2026-10-11 02:39:58 +00:00
Add configurable highlighting style
This commit is contained in:
11
src/index.js
11
src/index.js
@@ -23,9 +23,9 @@ async function main () {
|
||||
|
||||
const config = await loadConfigFile(opts.config)
|
||||
|
||||
const prefsPath = opts.prefs || null
|
||||
const cssPath = opts.css || null
|
||||
const outputPath = opts.output || null
|
||||
const prefsPath = opts.prefs || config.prefs || null
|
||||
const cssPath = opts.css || config.css || null
|
||||
const outputPath = opts.output || config.output || null
|
||||
|
||||
const preferences = prefsPath ? loadPreferences(path.resolve(prefsPath)) : {}
|
||||
const customCss = cssPath ? readCustomCss(path.resolve(cssPath)) : null
|
||||
@@ -37,10 +37,11 @@ async function main () {
|
||||
try {
|
||||
const result = await convert(currentUrl, {
|
||||
html,
|
||||
theme: opts.theme || preferences.mode,
|
||||
theme: opts.theme || config.theme || preferences.mode || 'light',
|
||||
css: customCss,
|
||||
prefs: preferences,
|
||||
output: outputPath
|
||||
output: outputPath,
|
||||
highlightStyle: opts.highlightStyle || config.highlightStyle
|
||||
})
|
||||
|
||||
const sizeKb = (result.pdfBuffer.length / 1024).toFixed(0)
|
||||
|
||||
Reference in New Issue
Block a user