diff --git a/.gitignore b/.gitignore index 80dbe6a..1c0e109 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,7 @@ assets/ # Local reference material — not for distribution .reference/ + +# PDF build artifacts +book-combined.md +claude-code-from-source.pdf diff --git a/.md-to-pdf.config.js b/.md-to-pdf.config.js new file mode 100644 index 0000000..e0c1b3e --- /dev/null +++ b/.md-to-pdf.config.js @@ -0,0 +1,32 @@ +const path = require('path'); + +const CHROME_PATHS = { + darwin: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', + win32: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', + linux: '/usr/bin/google-chrome', +}; + +const executablePath = process.env.CHROME_PATH || CHROME_PATHS[process.platform]; + +module.exports = { + stylesheet: [path.resolve(__dirname, 'book-style.css')], + body_class: 'book', + highlight_style: 'atom-one-dark', + launch_options: { + executablePath, + args: ['--no-sandbox', '--disable-setuid-sandbox'], + }, + pdf_options: { + format: 'Letter', + margin: { + top: '0.85in', + right: '0.85in', + bottom: '0.9in', + left: '0.9in', + }, + printBackground: true, + displayHeaderFooter: true, + headerTemplate: `

AN IN-DEPTH TECHNICAL ANALYSIS
+Architecture, Patterns & Internals of
Anthropic's AI Coding Agent
2024
+Claude Code from Source
+Architecture, Patterns & Internals of Anthropic's AI Coding Agent
+ +Educational Use Only
+This work contains no source code from Claude Code. Every code block is original pseudocode written to illustrate architectural patterns. No proprietary prompt text, internal constants, or exact function implementations are included.
+The analysis is based on TypeScript patterns extracted from publicly available npm packages. This book exists to help engineers understand the design principles behind production AI coding agents.
+This project has no affiliation with, and is not endorsed by, Anthropic.
+ + +${num}
+${tagline}
+