From 59260c4f7a265f1ad4db9e0ee5e469132cdef094 Mon Sep 17 00:00:00 2001 From: Matt Kosarek Date: Wed, 18 Feb 2026 17:03:06 -0500 Subject: minor: publishing from public with a Makefile instead of having everything at the toplevel --- public/download/build.js | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 public/download/build.js (limited to 'public/download/build.js') diff --git a/public/download/build.js b/public/download/build.js new file mode 100644 index 0000000..6c58162 --- /dev/null +++ b/public/download/build.js @@ -0,0 +1,50 @@ + + +const fs = require('fs'); +const childProcess = require('child_process'); + +const resumeHtml = fs.readFileSync('../resume.html').toString(); +const resumeCss = fs.readFileSync('../resume.css').toString(); +const resumeDlCss = fs.readFileSync('./resume_dl.css').toString(); + +function getRidofTagsBetween(start, end, html) { + let si = newHtml.indexOf(start); + let ei = newHtml.indexOf(end, si) + end.length; + return html.substring(0, si) + newHtml.substring(ei); +} + +const newHeader = ` + + + + + + + + + + + +` + +const startHead = resumeHtml.indexOf(''); +const endHead = resumeHtml.indexOf('') + ''.length; + +let newHtml = resumeHtml.substring(0, startHead) + newHeader + resumeHtml.substring(endHead); + +newHtml = getRidofTagsBetween('
', '
', newHtml); +newHtml = getRidofTagsBetween(`
`, '
', newHtml); + +fs.writeFileSync('./resume_dl.html', newHtml); + +childProcess.exec('wkhtmltopdf --encoding \'UTF-8\' ./resume_dl.html cv.pdf ') -- cgit v1.2.1