INNER CODE UNIT · JavaScript

bundleHtml

danburzo/percollate · index.js:489

async function bundleHtml(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 || '');

	// either explicit `--toc` or implicit ToC in the absence of `--no-toc`.
	const use_toc =
		options.toc ||
		((items.length > 1 || options['toc-level'] > 1) &&
			options.toc !== false);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…