# sanda-avram/paali2english architecture

> Architecture diagram of the GitHub repository sanda-avram/paali2english, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sanda-avram/paali2english
- Repository: https://github.com/sanda-avram/paali2english

## Overview

Pāḷi2English is a static interactive reading tool: readers browse or search a text catalogue, open a selected text, and view aligned Pāḷi and English passages with hover-linked terms. The excerpts show catalogue loading and filtering in `js/search.js`, and metadata lookup, corpus loading, parsing, rendering, and highlighting in `js/paali.js`. The README documents the alignment and chanting/sutta scope; unsampled page wiring and corpus format details are not inferred beyond those references.

Main entry points: [`js/paali.js`](https://github.com/sanda-avram/paali2english/blob/main/js/paali.js) (Text selection loader), [`js/search.js`](https://github.com/sanda-avram/paali2english/blob/main/js/search.js) (Catalogue search), [`data/texts.json`](https://github.com/sanda-avram/paali2english/blob/main/data/texts.json) (Text catalogue data), [`text.html`](https://github.com/sanda-avram/paali2english/blob/main/text.html) (Text page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Text discovery"]
  node_catalogue["Catalogue search<br/>[search.js]"]
  node_metadata[("Text catalogue data<br/>[texts.json]")]
end

subgraph group_reader["Aligned reader"]
  node_reading_page["Text page<br/>[text.html]"]
  node_text_loader["Text selection loader<br/>[paali.js]"]
  node_alignment_parser["Alignment parser<br/>[paali.js]"]
  node_alignment_view["Aligned passage view<br/>[paali.js]"]
  node_term_highlighting["Term highlighting<br/>[paali.js]"]
end

subgraph group_corpus["Text corpus"]
  node_chanting_texts["Chanting texts"]
  node_sutta_texts["Sutta texts"]
end

node_reader(("Reader"))

node_reader -->|"browses"| node_catalogue
node_catalogue -->|"loads"| node_metadata
node_catalogue -->|"links to"| node_reading_page
node_reader -->|"opens"| node_reading_page
node_text_loader -->|"looks up"| node_metadata
node_text_loader -->|"loads selected file"| node_chanting_texts
node_text_loader -->|"loads selected file"| node_sutta_texts
node_text_loader -->|"passes content"| node_alignment_parser
node_alignment_parser -->|"builds passage"| node_alignment_view
node_alignment_view -->|"registers hover"| node_term_highlighting

click node_catalogue "https://github.com/sanda-avram/paali2english/blob/main/js/search.js"
click node_metadata "https://github.com/sanda-avram/paali2english/blob/main/data/texts.json"
click node_reading_page "https://github.com/sanda-avram/paali2english/blob/main/text.html"
click node_text_loader "https://github.com/sanda-avram/paali2english/blob/main/js/paali.js"
click node_alignment_parser "https://github.com/sanda-avram/paali2english/blob/main/js/paali.js"
click node_alignment_view "https://github.com/sanda-avram/paali2english/blob/main/js/paali.js"
click node_term_highlighting "https://github.com/sanda-avram/paali2english/blob/main/js/paali.js"
click node_chanting_texts "https://github.com/sanda-avram/paali2english/tree/main/texts/chanting"
click node_sutta_texts "https://github.com/sanda-avram/paali2english/tree/main/texts/sutta"

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_catalogue,node_metadata toneBlue
class node_reading_page,node_text_loader,node_alignment_parser,node_alignment_view,node_term_highlighting toneAmber
class node_chanting_texts,node_sutta_texts toneMint
class node_reader toneIndigo
```

## Components

### Text discovery

- [Catalogue search](https://github.com/sanda-avram/paali2english/blob/main/js/search.js): `js/search.js`
- [Text catalogue data](https://github.com/sanda-avram/paali2english/blob/main/data/texts.json): `data/texts.json`

### Aligned reader

- [Text page](https://github.com/sanda-avram/paali2english/blob/main/text.html): `text.html`
- [Text selection loader](https://github.com/sanda-avram/paali2english/blob/main/js/paali.js): `js/paali.js`
- [Alignment parser](https://github.com/sanda-avram/paali2english/blob/main/js/paali.js): `js/paali.js`
- [Aligned passage view](https://github.com/sanda-avram/paali2english/blob/main/js/paali.js): `js/paali.js`
- [Term highlighting](https://github.com/sanda-avram/paali2english/blob/main/js/paali.js): `js/paali.js`

### Text corpus

- [Chanting texts](https://github.com/sanda-avram/paali2english/tree/main/texts/chanting): `texts/chanting`
- [Sutta texts](https://github.com/sanda-avram/paali2english/tree/main/texts/sutta): `texts/sutta`

### Other components

- **Reader**

## Connections

- Reader → Catalogue search: browses (evidence: `README.md`)
- Catalogue search → Text catalogue data: loads (evidence: `js/search.js`)
- Catalogue search → Text page: links to (evidence: `js/search.js`)
- Reader → Text page: opens (evidence: `README.md`)
- Text selection loader → Text catalogue data: looks up (evidence: `js/paali.js`)
- Text selection loader → Chanting texts: loads selected file (evidence: `js/paali.js`)
- Text selection loader → Sutta texts: loads selected file (evidence: `js/paali.js`)
- Text selection loader → Alignment parser: passes content (evidence: `js/paali.js`)
- Alignment parser → Aligned passage view: builds passage (evidence: `js/paali.js`)
- Aligned passage view → Term highlighting: registers hover (evidence: `js/paali.js`)
