{"id":50902143,"url":"https://github.com/yeonsolkim/fp-lean-print","last_synced_at":"2026-06-16T04:00:30.516Z","repository":{"id":365130583,"uuid":"1270698274","full_name":"yeonsolkim/fp-lean-print","owner":"yeonsolkim","description":"Print layout helpers for generating a Letter-size PDF of Functional Programming in Lean","archived":false,"fork":false,"pushed_at":"2026-06-16T02:30:48.000Z","size":980,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-16T03:14:03.237Z","etag":null,"topics":["chrome-printing","functional-programming","lean","lean4","pagedjs","pdf","print-css","typography"],"latest_commit_sha":null,"homepage":"https://github.com/yeonsolkim/fp-lean-print","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yeonsolkim.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-16T01:05:24.000Z","updated_at":"2026-06-16T02:30:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/yeonsolkim/fp-lean-print","commit_stats":null,"previous_names":["yeonsolkim/fp-lean-print"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/yeonsolkim/fp-lean-print","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeonsolkim%2Ffp-lean-print","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeonsolkim%2Ffp-lean-print/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeonsolkim%2Ffp-lean-print/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeonsolkim%2Ffp-lean-print/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yeonsolkim","download_url":"https://codeload.github.com/yeonsolkim/fp-lean-print/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeonsolkim%2Ffp-lean-print/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34390052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chrome-printing","functional-programming","lean","lean4","pagedjs","pdf","print-css","typography"],"created_at":"2026-06-16T04:00:18.799Z","updated_at":"2026-06-16T04:00:30.400Z","avatar_url":"https://github.com/yeonsolkim.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fp-lean-print\n\nPrint-layout support files for producing a Letter-size, book-style PDF of\n[_Functional Programming in Lean_](https://lean-lang.org/functional_programming_in_lean/), tuned to resemble the visual rhythm of the\n_Mathematics in Lean_ PDF.\n\nThis repository is a small reusable layout layer. It does not include the\noriginal book content. Use it when you already have a generated\n`fp-lean-letter-book-html` bundle and want a cleaner print/PDF pass.\n\n## What This Does\n\n- Replaces the generated bundle's `book-print.css` with a Letter-oriented print stylesheet.\n- Keeps the page layout close to _Mathematics in Lean_: 1 inch side margins,\n  book-like cover spacing, running headers/footers, roomier chapter openers,\n  and tighter code blocks.\n- Provides an optional Node/Playwright helper for producing a PDF from the\n  generated `index.html`.\n\n## Files\n\n- `book-print.css`: print stylesheet to copy into the generated HTML bundle.\n- `html_to_pdf.cjs`: optional PDF helper script.\n- `index-cache-version.patch`: optional patch for the generated `index.html`\n  cache-busting query strings.\n- `package.json`: Node package metadata and Playwright dependency.\n\n## Requirements\n\n- A generated `fp-lean-letter-book-html` bundle for _Functional Programming in Lean_.\n- Node.js 18 or newer.\n- Playwright, installed with `npm install`.\n- Chrome or the Playwright Chromium browser.\n\nTested during the layout pass on macOS with Chrome-style PDF output. The\nstylesheet is intentionally Letter-size only.\n\n## Quick Start\n\n```bash\ngit clone https://github.com/yeonsolkim/fp-lean-print.git\ncd fp-lean-print\nnpm install\n\n# Copy the stylesheet into your generated bundle.\ncp book-print.css /path/to/fp-lean-letter-book-html/book-print.css\n\n# Make the generated index.html load the new print stylesheet/script versions.\npython3 - \u003c\u003c'PY'\nfrom pathlib import Path\np = Path('/path/to/fp-lean-letter-book-html/index.html')\ns = p.read_text()\ns = s.replace('book-print.css?v=letter15', 'book-print.css?v=letter16')\ns = s.replace('book-setup.js?v=letter15', 'book-setup.js?v=letter16')\np.write_text(s)\nPY\n\n# Generate a PDF with the helper.\nnpm run pdf -- /path/to/fp-lean-letter-book-html/index.html fp-lean.pdf\n```\n\nThe expected output is a Letter-size PDF named `fp-lean.pdf`.\n\n## Optional Patch\n\nInstead of the Python replacement step above, you can apply the included patch\nfrom the generated bundle directory:\n\n```bash\ncd /path/to/fp-lean-letter-book-html\npatch -p1 \u003c /path/to/fp-lean-print/index-cache-version.patch\n```\n\nIf the generated HTML has slightly different surrounding lines, edit\n`index.html` manually so these two references use `letter16`:\n\n```html\n\u003clink rel=\"stylesheet\" href=\"book-print.css?v=letter16\"\u003e\n\u003cscript src=\"book-setup.js?v=letter16\" defer=\"defer\"\u003e\u003c/script\u003e\n```\n\n## Manual Chrome Print\n\nIf you prefer to print manually:\n\n1. Copy `book-print.css` into the generated bundle.\n2. Change the `book-print.css` and `book-setup.js` query strings in\n   `index.html` to `letter16`.\n3. Open the generated `index.html`.\n4. Click `조판 시작`.\n5. Wait for `책 조판 준비 완료`.\n6. Print from Chrome.\n\nRecommended print options:\n\n- Destination: Save to PDF\n- Pages: All\n- Scale: 100\n- Background graphics: On\n- Headers and footers: Off\n- Margins: None\n\n## Known Limitations\n\n- Letter-size output only.\n- Optimized for Chrome/Chromium PDF rendering.\n- The original _Functional Programming in Lean_ book content is not included.\n- The cache-busting edit is only needed to make browsers pick up the new\n  `book-print.css`/`book-setup.js` versions when working with a generated bundle.\n- The helper script waits for the Korean Paged.js status button text used in\n  the current generated bundle.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeonsolkim%2Ffp-lean-print","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeonsolkim%2Ffp-lean-print","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeonsolkim%2Ffp-lean-print/lists"}