prettier pdf with code highlighting

master
adb-sh 3 years ago
parent 40adfb49c9
commit 78ef6faac6

@ -36,7 +36,17 @@ try{
if (!title) title = await (await page.waitForSelector('h1')).evaluate(el => el.textContent); if (!title) title = await (await page.waitForSelector('h1')).evaluate(el => el.textContent);
if (!subtitle) subtitle = await (await page.waitForSelector('h2')).evaluate(el => el.textContent); if (!subtitle) subtitle = await (await page.waitForSelector('h2')).evaluate(el => el.textContent);
console.log(title,subtitle) console.log(title,subtitle);
await page.emulateMediaType('screen');
await page.addStyleTag({content: `
.hidden-print {
display: none !important;
}
*:not(code, .code > *){
color: #000 !important;
}
`});
const pages = await page.pdf({ const pages = await page.pdf({
//path: `${path}/${date}_${title}_pages.pdf`, //path: `${path}/${date}_${title}_pages.pdf`,

Loading…
Cancel
Save