Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions hooks/99_generatePdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ const puppeteer = require('puppeteer');
const path = require('path');

/**
* Generates PDF if user pass `pdf` paramater.
* Generates a PDF if the user passes the `pdf` parameter.
*/
module.exports = {
'generate:after': async ({ templateParams = {}, targetDir }) => {
// all actions of this hook depend on parameters passed by the user,
// if non are provided we should just stop the hook
// if none are provided we should just stop the hook
if (templateParams.pdf !== 'true') {
return;
}
Expand All @@ -24,7 +24,7 @@ module.exports = {
// Hide burger-menu in pdf
await page.evaluate(() => { document.querySelector('.burger-menu').style.display = 'none'; });

// React uses its own events system with SyntheticEvents (prevents browser incompatabilities and gives React more control of events),
// React uses its own events system with SyntheticEvents (prevents browser incompatibilities and gives React more control of events),
// so we must use `{ bubbles: true }`
await page.$$eval('button > svg', chevrons => chevrons.forEach(chevron => {
const button = chevron.parentElement;
Expand Down
Loading