From d04a677387a99de7e2cfc96a72664e1811d2a7ce Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Mon, 13 May 2024 21:35:53 +0100 Subject: [PATCH] Revert "fix: turns out wkhtmltopdf has been depreciated for two years" This reverts commit 04b9be1fbc7d8b2d7afe506eabee5c9cb5ebcf7a. --- _scripts/format_handovers.sh | 2 +- _scripts/format_minutes.sh | 2 +- flake.nix | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/_scripts/format_handovers.sh b/_scripts/format_handovers.sh index 6dfae88..c14ae01 100755 --- a/_scripts/format_handovers.sh +++ b/_scripts/format_handovers.sh @@ -36,7 +36,7 @@ for d in */ ; do echo "$out_folder/$stripped.pdf" # convert teh html to pdf - puppeteer print "$stripped.html" "$out_folder/$stripped.pdf" 2> ./tmp.txt + wkhtmltopdf -q --enable-local-file-access --no-stop-slow-scripts "$stripped.html" "$out_folder/$stripped.pdf" 2> ./tmp.txt fi done done diff --git a/_scripts/format_minutes.sh b/_scripts/format_minutes.sh index 47c5c5b..67757ce 100755 --- a/_scripts/format_minutes.sh +++ b/_scripts/format_minutes.sh @@ -39,7 +39,7 @@ for year in */ ; do echo $output - puppeteer print "$stripped.html" "$output" 2>> ../errors.log + wkhtmltopdf -q --enable-local-file-access --no-stop-slow-scripts "$stripped.html" "$output" 2>> ../errors.log fi done diff --git a/flake.nix b/flake.nix index b3d7af5..ee6b913 100644 --- a/flake.nix +++ b/flake.nix @@ -31,6 +31,8 @@ permittedInsecurePackages = [ # for obsidian "electron-25.9.0" + # for wkhtmltopdf + "qtwebkit-5.212.0-alpha4" ]; }; }; @@ -47,12 +49,12 @@ packages = { handovers = pkgs.writeShellScriptBin "format_handovers" '' - export PATH=${pkgs.lib.makeBinPath [pkgs.puppeteer-cli bfom.defaultPackage.x86_64-linux]}:$PATH + export PATH=${pkgs.lib.makeBinPath [pkgs.wkhtmltopdf bfom.defaultPackage.x86_64-linux]}:$PATH ${./_scripts/format_handovers.sh} ''; minutes = pkgs.writeShellScriptBin "format_minutes" '' - export PATH=${pkgs.lib.makeBinPath [pkgs.puppeteer-cli bfom.defaultPackage.x86_64-linux]}:$PATH + export PATH=${pkgs.lib.makeBinPath [pkgs.wkhtmltopdf bfom.defaultPackage.x86_64-linux]}:$PATH ${./_scripts/format_minutes.sh} ''; };