Compare commits
5 Commits
8e119c59e0
...
v0.2.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91799b978a | ||
|
|
abf22cc58b | ||
|
|
7bc307d28c | ||
|
|
1d25cbcfb3 | ||
|
|
7ca8071baf |
@@ -23,35 +23,8 @@ rm -rf $outdir
|
||||
mkdir -p $outdir/public
|
||||
cp homebrew/homebrew.html $outdir/public/index.html
|
||||
cp -r ./homebrew/fonts $outdir/public/
|
||||
|
||||
echo PRINTING PDF
|
||||
echo ...which google
|
||||
which google-chrome-stable
|
||||
echo ...which miniserve
|
||||
which miniserve
|
||||
miniserve $outdir/public &
|
||||
pid=${!}
|
||||
until curl localhost:8080; do sleep 5; done
|
||||
google-chrome-stable \
|
||||
--no-sandbox \
|
||||
--headless \
|
||||
--disable-gpu \
|
||||
--print-to-pdf=$outdir/public/BreeLaPointeResume.pdf \
|
||||
--run-all-compositor-stages-before-draw \
|
||||
--no-pdf-header-footer \
|
||||
http://localhost:8080/index.html
|
||||
get_state() {
|
||||
cksum $outdir/public/BreeLaPointeResume.pdf | awk '{print $1}'
|
||||
}
|
||||
state=$(get_state)
|
||||
while true; do
|
||||
sleep 5
|
||||
if [ "$state" == "$(get_state)" ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
kill $pid || true
|
||||
echo; ls $outdir/public/BreeLaPointeResume.pdf
|
||||
cp homebrew/homebrew.pdf $outdir/public/BreeLaPointeResume.pdf
|
||||
ls $outdir/public/BreeLaPointeResume.pdf
|
||||
|
||||
(
|
||||
if ! which woff2_compress; then
|
||||
@@ -73,6 +46,9 @@ echo; ls $outdir/public/BreeLaPointeResume.pdf
|
||||
echo asserting ${basename_f%.ttf}.woff2
|
||||
grep -R "${basename_f%.ttf}.woff2" "$outdir/public"
|
||||
done
|
||||
find "$outdir/public" -type f | grep -v public.fonts | while read -r f; do
|
||||
sed -i 's#type="font/ttf"#type="font/woff2"#g' "$f"
|
||||
done
|
||||
du -sh "$outdir/public/fonts/"*
|
||||
)
|
||||
|
||||
|
||||
36
headless_homebrew_pdf.sh
Normal file
36
headless_homebrew_pdf.sh
Normal file
@@ -0,0 +1,36 @@
|
||||
#! /bin/sh
|
||||
|
||||
set -o pipefail
|
||||
set -e
|
||||
set -u
|
||||
|
||||
cd src
|
||||
|
||||
echo PRINTING PDF
|
||||
echo ...which google
|
||||
which google-chrome-stable
|
||||
echo ...which miniserve
|
||||
which miniserve
|
||||
miniserve ./homebrew/ &
|
||||
pid=${!}
|
||||
until curl localhost:8080; do sleep 5; done
|
||||
google-chrome-stable \
|
||||
--no-sandbox \
|
||||
--headless \
|
||||
--disable-gpu \
|
||||
--print-to-pdf=./homebrew/homebrew.pdf \
|
||||
--run-all-compositor-stages-before-draw \
|
||||
--no-pdf-header-footer \
|
||||
http://localhost:8080/homebrew.html
|
||||
get_state() {
|
||||
cksum ./homebrew/homebrew.pdf | awk '{print $1}'
|
||||
}
|
||||
state=$(get_state)
|
||||
while true; do
|
||||
sleep 5
|
||||
if [ "$state" == "$(get_state)" ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
kill $pid || true
|
||||
echo
|
||||
@@ -5,7 +5,7 @@
|
||||
<link rel="preload" as="font" href="./fonts/Lato-Bold.ttf" type="font/ttf" crossorigin="anonymous">
|
||||
</link>
|
||||
<style>
|
||||
@media print { .no-print, .no-print * { visibility: hidden !important; }
|
||||
@media print { .no-print, .no-print * { visibility: hidden !important; } }
|
||||
@font-face {font-family: "Roboto"; src: url("./fonts/Roboto-Regular.ttf");}
|
||||
@font-face {font-family: "Roboto"; src: url("./fonts/Roboto-Bold.ttf"); font-weight: bold;}@font-face {font-family: "Lato"; src: url("./fonts/Lato-Regular.ttf");}
|
||||
@font-face {font-family: "Lato"; src: url("./fonts/Lato-Bold.ttf"); font-weight: bold;}@font-face {font-family: "Montserrat"; src: url("./fonts/Montserrat-Regular.ttf");}
|
||||
|
||||
Binary file not shown.
@@ -5,7 +5,7 @@
|
||||
<link rel="preload" as="font" href="./fonts/Lato-Bold.ttf" type="font/ttf" crossorigin="anonymous">
|
||||
</link>
|
||||
<style>
|
||||
@media print { .no-print, .no-print * { visibility: hidden !important; }
|
||||
@media print { .no-print, .no-print * { visibility: hidden !important; } }
|
||||
@font-face {font-family: "Roboto"; src: url("./fonts/Roboto-Regular.ttf");}
|
||||
@font-face {font-family: "Roboto"; src: url("./fonts/Roboto-Bold.ttf"); font-weight: bold;}@font-face {font-family: "Lato"; src: url("./fonts/Lato-Regular.ttf");}
|
||||
@font-face {font-family: "Lato"; src: url("./fonts/Lato-Bold.ttf"); font-weight: bold;}@font-face {font-family: "Montserrat"; src: url("./fonts/Montserrat-Regular.ttf");}
|
||||
|
||||
@@ -63,4 +63,3 @@ resume:
|
||||
- 'Platforms: Docker, Hashicorp, Linux/Unix, AWS, Jenkins, REST, Microservices, Git'
|
||||
- 'Datastores: MongoDB, Redis, S3, Couchbase, DynamoDB'
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user