# b-3llum/out-of-the-cave architecture

> Architecture diagram of the GitHub repository b-3llum/out-of-the-cave, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/b-3llum/out-of-the-cave
- Repository: https://github.com/b-3llum/out-of-the-cave

## Overview

Out of the Cave is a static mathematics-problem library, not a solutions platform. The main user journey is to browse a subject collection, filter and select problems, then assemble a worksheet for printing or LaTeX download. The graph also includes the documented high-school, special-topic, typesetting, and per-page download capabilities. Runtime links follow the README and sampled JavaScript; unsampled page markup and wiring are not inferred.

Main entry points: [`worksheet.js`](https://github.com/b-3llum/out-of-the-cave/blob/main/worksheet.js) (Worksheet builder), [`pure-foundations.html`](https://github.com/b-3llum/out-of-the-cave/blob/main/pure-foundations.html) (Pure mathematics), [`applied-calculus.html`](https://github.com/b-3llum/out-of-the-cave/blob/main/applied-calculus.html) (Applied mathematics), [`index.html`](https://github.com/b-3llum/out-of-the-cave/blob/main/index.html) (Home and navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_library["Problem library"]
  node_home["Home and navigation<br/>[index.html]"]
  node_pure["Pure mathematics"]
  node_applied["Applied mathematics"]
  node_highschool["High-school collection<br/>[highschool.html]"]
  node_special["Special collections<br/>[open-problems.html]"]
end

subgraph group_browse["Browsing experience"]
  node_browsejs["Filters and selection<br/>[site.js]"]
  node_storage[("Browser saved state")]
end

subgraph group_worksheet["Worksheet creation"]
  node_worksheetpage["Worksheet interface<br/>[worksheet.html]"]
  node_worksheetjs["Worksheet builder<br/>[worksheet.js]"]
  node_problemdata["Worksheet problem data<br/>[problems-data.js]"]
  node_print["Printable worksheet<br/>[worksheet.js]"]
end

subgraph group_presentation["Presentation and exports"]
  node_tex["LaTeX downloads"]
  node_pdf["Compiled PDF downloads"]
  node_katex["KaTeX rendering"]
  node_mathfit["Math overflow handling<br/>[mathfit.js]"]
  node_theme["Theme preferences<br/>[theme.js]"]
end

node_reader(("Reader"))

node_reader -->|"opens"| node_home
node_home -->|"links to"| node_pure
node_home -->|"links to"| node_applied
node_home -->|"links to"| node_highschool
node_home -->|"links to"| node_special
node_reader -->|"browses"| node_pure
node_reader -->|"browses"| node_applied
node_reader -->|"browses"| node_highschool
node_reader -->|"browses"| node_special
node_browsejs -->|"filters"| node_pure
node_browsejs -->|"filters"| node_applied
node_browsejs -->|"filters"| node_highschool
node_browsejs -->|"saves selections"| node_storage
node_worksheetpage -->|"runs"| node_worksheetjs
node_worksheetjs -->|"reads"| node_problemdata
node_worksheetjs -->|"loads selections"| node_storage
node_worksheetjs -->|"renders"| node_print
node_worksheetjs -->|"exports"| node_tex
node_pure -->|"offers source"| node_tex
node_applied -->|"offers source"| node_tex
node_highschool -->|"offers source"| node_tex
node_special -->|"offers source"| node_tex
node_pure -->|"offers PDF"| node_pdf
node_applied -->|"offers PDF"| node_pdf
node_highschool -->|"offers PDF"| node_pdf
node_special -->|"offers PDF"| node_pdf
node_katex -->|"renders math"| node_pure
node_katex -->|"renders math"| node_applied
node_katex -->|"renders math"| node_worksheetjs
node_mathfit -->|"measures formulas"| node_katex
node_theme -->|"persists preference"| node_storage

click node_home "https://github.com/b-3llum/out-of-the-cave/blob/main/index.html"
click node_pure "https://github.com/b-3llum/out-of-the-cave/blob/main/pure-foundations.html"
click node_applied "https://github.com/b-3llum/out-of-the-cave/blob/main/applied-calculus.html"
click node_highschool "https://github.com/b-3llum/out-of-the-cave/blob/main/highschool.html"
click node_special "https://github.com/b-3llum/out-of-the-cave/blob/main/open-problems.html"
click node_browsejs "https://github.com/b-3llum/out-of-the-cave/blob/main/site.js"
click node_worksheetpage "https://github.com/b-3llum/out-of-the-cave/blob/main/worksheet.html"
click node_worksheetjs "https://github.com/b-3llum/out-of-the-cave/blob/main/worksheet.js"
click node_problemdata "https://github.com/b-3llum/out-of-the-cave/blob/main/problems-data.js"
click node_print "https://github.com/b-3llum/out-of-the-cave/blob/main/worksheet.js"
click node_tex "https://github.com/b-3llum/out-of-the-cave/blob/main/tex/applied-calculus.tex"
click node_pdf "https://github.com/b-3llum/out-of-the-cave/blob/main/tex/applied-calculus.pdf"
click node_katex "https://github.com/b-3llum/out-of-the-cave/tree/main/katex"
click node_mathfit "https://github.com/b-3llum/out-of-the-cave/blob/main/mathfit.js"
click node_theme "https://github.com/b-3llum/out-of-the-cave/blob/main/theme.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_home,node_pure,node_applied,node_highschool,node_special toneBlue
class node_browsejs,node_storage toneAmber
class node_worksheetpage,node_worksheetjs,node_problemdata,node_print toneMint
class node_tex,node_pdf,node_katex,node_mathfit,node_theme toneRose
class node_reader toneIndigo
```

## Components

### Problem library

- [Home and navigation](https://github.com/b-3llum/out-of-the-cave/blob/main/index.html): `index.html`
- [Pure mathematics](https://github.com/b-3llum/out-of-the-cave/blob/main/pure-foundations.html): `pure-foundations.html`
- [Applied mathematics](https://github.com/b-3llum/out-of-the-cave/blob/main/applied-calculus.html): `applied-calculus.html`
- [High-school collection](https://github.com/b-3llum/out-of-the-cave/blob/main/highschool.html): `highschool.html`
- [Special collections](https://github.com/b-3llum/out-of-the-cave/blob/main/open-problems.html): `open-problems.html`

### Browsing experience

- [Filters and selection](https://github.com/b-3llum/out-of-the-cave/blob/main/site.js): `site.js`
- **Browser saved state**

### Worksheet creation

- [Worksheet interface](https://github.com/b-3llum/out-of-the-cave/blob/main/worksheet.html): `worksheet.html`
- [Worksheet builder](https://github.com/b-3llum/out-of-the-cave/blob/main/worksheet.js): `worksheet.js`
- [Worksheet problem data](https://github.com/b-3llum/out-of-the-cave/blob/main/problems-data.js): `problems-data.js`
- [Printable worksheet](https://github.com/b-3llum/out-of-the-cave/blob/main/worksheet.js): `worksheet.js`

### Presentation and exports

- [LaTeX downloads](https://github.com/b-3llum/out-of-the-cave/blob/main/tex/applied-calculus.tex): `tex/applied-calculus.tex`
- [Compiled PDF downloads](https://github.com/b-3llum/out-of-the-cave/blob/main/tex/applied-calculus.pdf): `tex/applied-calculus.pdf`
- [KaTeX rendering](https://github.com/b-3llum/out-of-the-cave/tree/main/katex): `katex`
- [Math overflow handling](https://github.com/b-3llum/out-of-the-cave/blob/main/mathfit.js): `mathfit.js`
- [Theme preferences](https://github.com/b-3llum/out-of-the-cave/blob/main/theme.js): `theme.js`

### Other components

- **Reader**

## Connections

- Reader → Home and navigation: opens
- Home and navigation → Pure mathematics: links to
- Home and navigation → Applied mathematics: links to
- Home and navigation → High-school collection: links to
- Home and navigation → Special collections: links to
- Reader → Pure mathematics: browses
- Reader → Applied mathematics: browses
- Reader → High-school collection: browses
- Reader → Special collections: browses
- Filters and selection → Pure mathematics: filters
- Filters and selection → Applied mathematics: filters
- Filters and selection → High-school collection: filters
- Filters and selection → Browser saved state: saves selections
- Worksheet interface → Worksheet builder: runs
- Worksheet builder → Worksheet problem data: reads
- Worksheet builder → Browser saved state: loads selections
- Worksheet builder → Printable worksheet: renders
- Worksheet builder → LaTeX downloads: exports
- Pure mathematics → LaTeX downloads: offers source
- Applied mathematics → LaTeX downloads: offers source
- High-school collection → LaTeX downloads: offers source
- Special collections → LaTeX downloads: offers source
- Pure mathematics → Compiled PDF downloads: offers PDF
- Applied mathematics → Compiled PDF downloads: offers PDF
- High-school collection → Compiled PDF downloads: offers PDF
- Special collections → Compiled PDF downloads: offers PDF
- KaTeX rendering → Pure mathematics: renders math
- KaTeX rendering → Applied mathematics: renders math
- KaTeX rendering → Worksheet builder: renders math
- Math overflow handling → KaTeX rendering: measures formulas
- Theme preferences → Browser saved state: persists preference
