INNER CODE UNIT · JavaScript
bundlePdf
danburzo/percollate · index.js:287
async function bundlePdf(items, options) {
const DEFAULT_STYLESHEET = new URL(
'templates/default.css',
import.meta.url
);
const DEFAULT_TEMPLATE = new URL('templates/default.html', import.meta.url);
const style =
(await readFile(options.style || DEFAULT_STYLESHEET, 'utf8')) +
(options.hyphenate === true ? JUSTIFY_CSS : '') +
(options.css || '');
const title =
options.title || (items.length === 1 ? items[0].title : 'Untitled');
const author =
options.author || (items.length === 1 ? items[0].byline : undefined);
// either explicit `--toc` or implicit ToC in the absence of `--no-toc`.