Skip to content

Commit

Permalink
Add Highlight.js support
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrakowitzer committed Sep 8, 2020
1 parent acd1074 commit 4727f3a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apt-get update && \
libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget curl && \
rm -rf /var/lib/apt/lists/*

RUN npm install puppeteer markdown-it mustache markdown-it-named-headers cheerio
RUN npm install puppeteer markdown-it mustache markdown-it-named-headers cheerio markdown-it-highlightjs
COPY makepdfs.js /
COPY package.json /
COPY template/ template/
Expand Down
4 changes: 2 additions & 2 deletions makepdfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function makePdf(data,file) {
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch( {
executablePath:'/node_modules/puppeteer/.local-chromium/linux-706915/chrome-linux/chrome',
executablePath:'/node_modules/puppeteer/.local-chromium/linux-782078/chrome-linux/chrome',
args: [
'--headless',
'--no-sandbox',
Expand Down Expand Up @@ -115,7 +115,7 @@ fs.readdir (mddir,function(err, files) {
}
return '<pre class="hljs"><code><div>' + str + '</div></code></pre>';
}
});
}).use(require('markdown-it-highlightjs'), { inline: true });
var options = {
slugify: Slug
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"dependencies": {
"puppeteer": "1.15.0",
"commander": "2.20.0",
"markdown-it": "8.4.2"
"markdown-it": "11.0.0"
"markdown-it-highlightjs": "3.2.0"
}
}

0 comments on commit 4727f3a

Please sign in to comment.