# systemrdl/peakrdl-html architecture

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

- Interactive diagram: https://gitdiagram.com/systemrdl/peakrdl-html
- Repository: https://github.com/systemrdl/peakrdl-html

## Overview

PeakRDL-html turns an elaborated SystemRDL address map into browsable HTML documentation. The principal workflow is compiler/CLI invocation, exporter configuration, address-map traversal and data generation, then HTML output; users browse the generated pages with navigation and search. The repository also includes RAL serialization, source-link and template customization, and browser-side address/path/content search. Some exporter and viewer wiring is not visible in the excerpts, so the graph omits those uncertain connections.

Main entry points: [`src/peakrdl_html/exporter.py`](https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/exporter.py) (HTML exporter), [`src/peakrdl_html/static/js/search.js`](https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/static/js/search.js) (Search interface), [`src/peakrdl_html/__peakrdl__.py`](https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/__peakrdl__.py) (PeakRDL CLI plugin), [`src/peakrdl_html/static/js/ral.js`](https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/static/js/ral.js) (RAL navigation model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_export["Export workflow"]
  node_cli["PeakRDL CLI plugin<br/>[__peakrdl__.py]"]
  node_exporter["HTML exporter<br/>[exporter.py]"]
  node_version["Package version<br/>[__about__.py]"]
end

subgraph group_generation["Documentation generation"]
  node_rdl_walk["Address-map traversal<br/>[exporter.py]"]
  node_ral_output["RAL data output<br/>[exporter.py]"]
  node_search_index["Search index builder<br/>[search_indexer.py]"]
  node_value_format["RDL value formatting<br/>[stringify.py]"]
  node_templates["HTML templates"]
  node_static_assets["Viewer assets"]
end

subgraph group_viewer["Browser viewer"]
  node_browser(("Documentation reader"))
  node_page_controller["Page controller<br/>[main.js]"]
  node_ral_runtime["RAL navigation model<br/>[ral.js]"]
end

subgraph group_search["Search experience"]
  node_search_ui["Search interface<br/>[search.js]"]
  node_address_search["Address lookup<br/>[address_search.js]"]
  node_path_search["Path search<br/>[path_search.js]"]
  node_content_search["Content search<br/>[content_search.js]"]
end

node_engineer(("SystemRDL user"))
node_compiler["Elaborated RDL"]

node_engineer -->|"invokes export"| node_cli
node_compiler -->|"provides nodes"| node_cli
node_cli -->|"configures and calls"| node_exporter
node_exporter -->|"exports nodes"| node_rdl_walk
node_rdl_walk -->|"indexes node text"| node_search_index
node_rdl_walk -->|"formats values"| node_value_format
node_exporter -->|"loads templates"| node_templates
node_exporter -->|"writes RAL data"| node_ral_output
node_exporter -->|"writes search index"| node_search_index
node_exporter -.->|"copies assets"| node_static_assets
node_browser -.->|"browses output"| node_page_controller
node_page_controller -->|"loads navigation"| node_ral_runtime
node_search_ui -->|"searches paths"| node_path_search
node_search_ui -->|"looks up addresses"| node_address_search
node_path_search -->|"reads paths"| node_ral_runtime
node_address_search -->|"looks up addresses"| node_ral_runtime
node_search_ui -.->|"runs content search"| node_content_search
node_exporter -->|"reports version"| node_version

click node_cli "https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/__peakrdl__.py"
click node_exporter "https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/exporter.py"
click node_version "https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/__about__.py"
click node_rdl_walk "https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/exporter.py"
click node_ral_output "https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/exporter.py"
click node_search_index "https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/search_indexer.py"
click node_value_format "https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/stringify.py"
click node_templates "https://github.com/systemrdl/peakrdl-html/tree/main/src/peakrdl_html/templates"
click node_static_assets "https://github.com/systemrdl/peakrdl-html/tree/main/src/peakrdl_html/static"
click node_page_controller "https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/static/js/main.js"
click node_ral_runtime "https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/static/js/ral.js"
click node_search_ui "https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/static/js/search.js"
click node_address_search "https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/static/js/address_search.js"
click node_path_search "https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/static/js/path_search.js"
click node_content_search "https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/static/js/content_search.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_cli,node_exporter,node_version,node_engineer toneBlue
class node_rdl_walk,node_ral_output,node_search_index,node_value_format,node_templates,node_static_assets toneAmber
class node_browser,node_page_controller,node_ral_runtime toneMint
class node_search_ui,node_address_search,node_path_search,node_content_search toneRose
class node_compiler toneIndigo
```

## Components

### Export workflow

- [PeakRDL CLI plugin](https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/__peakrdl__.py): `src/peakrdl_html/__peakrdl__.py`
- [HTML exporter](https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/exporter.py): `src/peakrdl_html/exporter.py`
- [Package version](https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/__about__.py): `src/peakrdl_html/__about__.py`

### Documentation generation

- [Address-map traversal](https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/exporter.py): `src/peakrdl_html/exporter.py`
- [RAL data output](https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/exporter.py): `src/peakrdl_html/exporter.py`
- [Search index builder](https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/search_indexer.py): `src/peakrdl_html/search_indexer.py`
- [RDL value formatting](https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/stringify.py): `src/peakrdl_html/stringify.py`
- [HTML templates](https://github.com/systemrdl/peakrdl-html/tree/main/src/peakrdl_html/templates): `src/peakrdl_html/templates`
- [Viewer assets](https://github.com/systemrdl/peakrdl-html/tree/main/src/peakrdl_html/static): `src/peakrdl_html/static`

### Browser viewer

- **Documentation reader**
- [Page controller](https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/static/js/main.js): `src/peakrdl_html/static/js/main.js`
- [RAL navigation model](https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/static/js/ral.js): `src/peakrdl_html/static/js/ral.js`

### Search experience

- [Search interface](https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/static/js/search.js): `src/peakrdl_html/static/js/search.js`
- [Address lookup](https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/static/js/address_search.js): `src/peakrdl_html/static/js/address_search.js`
- [Path search](https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/static/js/path_search.js): `src/peakrdl_html/static/js/path_search.js`
- [Content search](https://github.com/systemrdl/peakrdl-html/blob/main/src/peakrdl_html/static/js/content_search.js): `src/peakrdl_html/static/js/content_search.js`

### Other components

- **SystemRDL user**
- **Elaborated RDL**

## Connections

- SystemRDL user → PeakRDL CLI plugin: invokes export (evidence: `README.md`)
- Elaborated RDL → PeakRDL CLI plugin: provides nodes (evidence: `README.md`)
- PeakRDL CLI plugin → HTML exporter: configures and calls (evidence: `src/peakrdl_html/__peakrdl__.py`)
- HTML exporter → Address-map traversal: exports nodes (evidence: `src/peakrdl_html/exporter.py`)
- Address-map traversal → Search index builder: indexes node text (evidence: `src/peakrdl_html/exporter.py`)
- Address-map traversal → RDL value formatting: formats values (evidence: `src/peakrdl_html/exporter.py`)
- HTML exporter → HTML templates: loads templates (evidence: `src/peakrdl_html/exporter.py`)
- HTML exporter → RAL data output: writes RAL data (evidence: `src/peakrdl_html/exporter.py`)
- HTML exporter → Search index builder: writes search index (evidence: `src/peakrdl_html/exporter.py`)
- HTML exporter → Viewer assets: copies assets
- Documentation reader → Page controller: browses output
- Page controller → RAL navigation model: loads navigation (evidence: `src/peakrdl_html/static/js/main.js`)
- Search interface → Path search: searches paths (evidence: `src/peakrdl_html/static/js/search.js`)
- Search interface → Address lookup: looks up addresses (evidence: `src/peakrdl_html/static/js/search.js`)
- Path search → RAL navigation model: reads paths (evidence: `src/peakrdl_html/static/js/path_search.js`)
- Address lookup → RAL navigation model: looks up addresses (evidence: `src/peakrdl_html/static/js/address_search.js`)
- Search interface → Content search: runs content search
- HTML exporter → Package version: reports version (evidence: `src/peakrdl_html/exporter.py`)
