# Browsing the Geometry book as HTML The whole project is available as a static website. You do not need a server: open `site/index.html` in a browser and everything works from disk. ``` site/ index.html start here: chapters, PDFs, guides, teacher material search.html full-text search Markdown/ the textbook, one HTML page per section Answers/ selected answers, one page per chapter Teacher_Answers/ teacher's guide answers + diagrams, one page per chapter Study_Guides/ chapter study guides and lesson one-pagers Other/lessonplans_md/ teacher's lesson plans and chapter notes Exams/ exam paper and answer key assets/ stylesheet, scripts, search index *.pdf the original chapter PDFs ``` Every Markdown file in the project has a converted HTML page, and every chapter PDF is linked from the home page (and from the top of its chapter). ## Rebuilding Check the lesson Markdown before rebuilding: ```bash python3 site_builder/check_geometry_markdown.py ``` This validates all 94 exercise lessons and 94 answer lessons, including native MathML conversion, image references, and consistency with the chapter sources. It does not certify mathematical correctness. Corrections and unresolved source checks are recorded in `OCR_Review_Log.md` and `OCR_Review_Pending.md` at the project root. Preserve those corrections when updating the source transcriptions; rerunning the original OCR extractor will overwrite edited answers. The site is generated from the Markdown and PDF sources by `build.py`: ```bash python3 site_builder/build.py ``` The selected answers are split out of `Markdown/Appendices.md` first, one Markdown file per chapter in `Answers/`. Re-run the splitter whenever the appendix changes, then rebuild: ```bash python3 site_builder/split_answers.py python3 site_builder/build.py ``` The teacher's guide answers are extracted from the scanned PDF into `Teacher_Answers/` (text plus cropped diagrams). That step needs Tesseract and poppler-utils and takes several minutes: ```bash python3 site_builder/extract_teacher_answers.py python3 site_builder/realign_teacher_answers.py python3 site_builder/merge_algebra_answers.py python3 site_builder/build.py ``` `realign_teacher_answers.py` uses the PDF's text-layer running heads to put each page in the right chapter, rebuilds the lesson headings, and removes the internal page markers so each chapter reads as one list of answers. `merge_algebra_answers.py` replaces an Algebra Review with the clean appendix answers when they cover every exercise in that review; otherwise the OCR text is left untouched rather than dropping answers. The extractor OCRs every page as **two separate columns** (left, then right) and splits numbered answers into separate paragraphs. Diagram regions are cropped from the scans; text blocks that merely look like figures are filtered out by text coverage. The OCR text is intentionally close to the scan; formulas may be imperfect, and every page links to the original PDF for checking. This rewrites `site/` from scratch. It needs: - Python 3.9+ - [pandoc](https://pandoc.org) 3.x on the `PATH` Figures and PDFs are **hard linked**, so the generated site does not duplicate their contents on disk. If you move `site/` to another drive, the links become ordinary copies. ## How it is made - Markdown → HTML with pandoc, using MathML for formulas so the pages render offline with no CDN or JavaScript dependency. - `README.md` becomes `index.html` in each folder, and links between Markdown files are rewritten to the matching HTML pages. - Book page markers such as `` become small "p. 123" markers with stable anchors (`#page-123`), so printed page references still work. - The search index is a plain `.js` file (`assets/search-index.js`), because browsers block `fetch()` for pages opened from disk. ## Reading features - Light and dark themes, following the operating system by default. - Per-chapter table of contents for long chapters. - Selected answers split one page per chapter, linked from each chapter. - Complete teacher's guide answers with extracted diagrams, split by chapter. - Previous/next navigation through the book and through each guide. - Print styles: navigation and sidebars are hidden when printing a page. - Full-text search across the book, study guides, teacher notes, and exams.