prettier pdf with code highlighting
This commit is contained in:
parent
40adfb49c9
commit
78ef6faac6
12
index.js
12
index.js
@ -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…
Reference in New Issue
Block a user