Keep the presentation of loop-claude, with the script that prints it to PDF and what writing it settled
CI / tests (pull_request) Successful in 2m15s
CI / tests (pull_request) Successful in 2m15s
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
# Print index.html to loop-claude-explained.pdf beside it, in the playwright-for-claude image.
|
||||
# The image comes from ~/code/playwright-for-agents: its ./pw builds it on first use.
|
||||
set -eu
|
||||
|
||||
here=$(cd "$(dirname "$0")" && pwd)
|
||||
work=$(mktemp -d)
|
||||
trap 'rm -rf "$work"' EXIT
|
||||
|
||||
if ! docker image inspect playwright-for-claude >/dev/null 2>&1; then
|
||||
echo "No playwright-for-claude image. Build it once with: ~/code/playwright-for-agents/pw about:blank" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# index.html is an artifact body, without a doctype, head or body of its own, so wrap it as the artifact host does.
|
||||
{
|
||||
printf '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"><style>:root{color-scheme:light}body{margin:0}img{max-width:100%%}[hidden]{display:none!important}</style></head><body>\n'
|
||||
cat "$here/index.html"
|
||||
printf '</body></html>\n'
|
||||
} > "$work/page.html"
|
||||
cp "$here/render-pdf.js" "$work/"
|
||||
|
||||
docker run --rm --init --memory 2g --memory-swap 2g -v "$work:/work" -w /work --entrypoint node playwright-for-claude render-pdf.js
|
||||
cp "$work/out.pdf" "$here/loop-claude-explained.pdf"
|
||||
echo "Wrote $here/loop-claude-explained.pdf"
|
||||
Reference in New Issue
Block a user