# eliemichel/learnwebgpu architecture

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

- Interactive diagram: https://gitdiagram.com/eliemichel/learnwebgpu
- Repository: https://github.com/eliemichel/learnwebgpu

## Overview

LearnWebGPU is an educational WebGPU guide published as a website. Readers progress from setup and a first rendered result into 3D rendering and compute, then consult advanced techniques and appendices. Sphinx Literate supports embedded, cross-referenced code examples and can tangle them into source files. The tree also contains reusable WebGPU rendering and image-export helpers. Source excerpts establish the literate extension’s main calls; documentation-section relationships are presented as reader navigation, not an asserted runtime pipeline.

Main entry points: [`index.md`](https://github.com/eliemichel/learnwebgpu/blob/main/index.md) (LearnWebGPU site), [`_extensions/sphinx_literate/registry.py`](https://github.com/eliemichel/learnwebgpu/blob/main/_extensions/sphinx_literate/registry.py) (Block registry), [`_extensions/sphinx_literate/directives.py`](https://github.com/eliemichel/learnwebgpu/blob/main/_extensions/sphinx_literate/directives.py) (Literate directives), [`_extensions/sphinx_literate/tangle.py`](https://github.com/eliemichel/learnwebgpu/blob/main/_extensions/sphinx_literate/tangle.py) (Code tangler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guide["Learning guide"]
  node_site["LearnWebGPU site<br/>[index.md]"]
  node_intro["Introduction<br/>[introduction.md]"]
  node_getting_started["Getting started"]
  node_rendering["3D rendering"]
  node_compute["Compute"]
  node_advanced["Advanced techniques"]
  node_appendices["Appendices"]
end

subgraph group_literate["Literate code tooling"]
  node_directives["Literate directives<br/>[directives.py]"]
  node_parser["Block parser<br/>[parse.py]"]
  node_registry[("Block registry<br/>[registry.py]")]
  node_nodes["Document nodes<br/>[nodes.py]"]
  node_tangler["Code tangler<br/>[tangle.py]"]
  node_handlers["Build handlers<br/>[handlers.py]"]
  node_builder["Tangle builder<br/>[builder.py]"]
end

subgraph group_helpers["WebGPU helpers"]
  node_imgui["ImGui WebGPU renderer"]
  node_imgui_api["ImGui renderer API<br/>[imgui_impl_wgpu.h]"]
  node_image_export["Texture image export<br/>[save_image.h]"]
  node_image_writer["Image encoding<br/>[stb_image_write.h]"]
end

subgraph group_translations["Translations"]
  node_fr["French translation"]
  node_ru["Russian translation"]
  node_uk["Ukrainian translation"]
  node_zh["Chinese translation"]
end

node_reader(("Learner"))
node_sphinx["Sphinx"]

node_reader -->|"visits"| node_site
node_site -->|"introduces"| node_intro
node_site -->|"guides setup"| node_getting_started
node_site -->|"teaches rendering"| node_rendering
node_site -.->|"teaches compute"| node_compute
node_site -.->|"covers techniques"| node_advanced
node_site -.->|"provides reference"| node_appendices
node_sphinx -->|"builds website"| node_site
node_sphinx -.->|"loads extension"| node_directives
node_directives -->|"parses titles"| node_parser
node_directives -->|"registers blocks"| node_registry
node_directives -->|"creates nodes"| node_nodes
node_parser -->|"uses block types"| node_registry
node_nodes -->|"uses block records"| node_registry
node_handlers -->|"resolves blocks"| node_registry
node_handlers -->|"tangles directives"| node_tangler
node_tangler -->|"looks up blocks"| node_registry
node_tangler -->|"parses links"| node_parser
node_builder -->|"enumerates blocks"| node_registry
node_builder -->|"generates files"| node_tangler
node_imgui -->|"implements API"| node_imgui_api
node_image_export -->|"writes images"| node_image_writer
node_site -.->|"offers translation"| node_fr
node_site -.->|"offers translation"| node_ru
node_site -.->|"offers translation"| node_uk
node_site -.->|"offers translation"| node_zh

click node_site "https://github.com/eliemichel/learnwebgpu/blob/main/index.md"
click node_intro "https://github.com/eliemichel/learnwebgpu/blob/main/introduction.md"
click node_getting_started "https://github.com/eliemichel/learnwebgpu/tree/main/getting-started"
click node_rendering "https://github.com/eliemichel/learnwebgpu/tree/main/basic-3d-rendering"
click node_compute "https://github.com/eliemichel/learnwebgpu/tree/main/basic-compute"
click node_advanced "https://github.com/eliemichel/learnwebgpu/tree/main/advanced-techniques"
click node_appendices "https://github.com/eliemichel/learnwebgpu/tree/main/appendices"
click node_directives "https://github.com/eliemichel/learnwebgpu/blob/main/_extensions/sphinx_literate/directives.py"
click node_parser "https://github.com/eliemichel/learnwebgpu/blob/main/_extensions/sphinx_literate/parse.py"
click node_registry "https://github.com/eliemichel/learnwebgpu/blob/main/_extensions/sphinx_literate/registry.py"
click node_nodes "https://github.com/eliemichel/learnwebgpu/blob/main/_extensions/sphinx_literate/nodes.py"
click node_tangler "https://github.com/eliemichel/learnwebgpu/blob/main/_extensions/sphinx_literate/tangle.py"
click node_handlers "https://github.com/eliemichel/learnwebgpu/blob/main/_extensions/sphinx_literate/handlers.py"
click node_builder "https://github.com/eliemichel/learnwebgpu/blob/main/_extensions/sphinx_literate/builder.py"
click node_imgui "https://github.com/eliemichel/learnwebgpu/blob/main/data/imgui_impl_wgpu.cpp"
click node_imgui_api "https://github.com/eliemichel/learnwebgpu/blob/main/data/imgui_impl_wgpu.h"
click node_image_export "https://github.com/eliemichel/learnwebgpu/blob/main/data/save_image.h"
click node_image_writer "https://github.com/eliemichel/learnwebgpu/blob/main/data/stb_image_write.h"
click node_fr "https://github.com/eliemichel/learnwebgpu/tree/main/translation/fr"
click node_ru "https://github.com/eliemichel/learnwebgpu/tree/main/translation/ru"
click node_uk "https://github.com/eliemichel/learnwebgpu/tree/main/translation/uk"
click node_zh "https://github.com/eliemichel/learnwebgpu/tree/main/translation/zh"

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_site,node_intro,node_getting_started,node_rendering,node_compute,node_advanced,node_appendices toneBlue
class node_directives,node_parser,node_registry,node_nodes,node_tangler,node_handlers,node_builder toneAmber
class node_imgui,node_imgui_api,node_image_export,node_image_writer toneMint
class node_fr,node_ru,node_uk,node_zh toneRose
class node_reader,node_sphinx toneIndigo
```

## Components

### Learning guide

- [LearnWebGPU site](https://github.com/eliemichel/learnwebgpu/blob/main/index.md): `index.md`
- [Introduction](https://github.com/eliemichel/learnwebgpu/blob/main/introduction.md): `introduction.md`
- [Getting started](https://github.com/eliemichel/learnwebgpu/tree/main/getting-started): `getting-started`
- [3D rendering](https://github.com/eliemichel/learnwebgpu/tree/main/basic-3d-rendering): `basic-3d-rendering`
- [Compute](https://github.com/eliemichel/learnwebgpu/tree/main/basic-compute): `basic-compute`
- [Advanced techniques](https://github.com/eliemichel/learnwebgpu/tree/main/advanced-techniques): `advanced-techniques`
- [Appendices](https://github.com/eliemichel/learnwebgpu/tree/main/appendices): `appendices`

### Literate code tooling

- [Literate directives](https://github.com/eliemichel/learnwebgpu/blob/main/_extensions/sphinx_literate/directives.py): `_extensions/sphinx_literate/directives.py`
- [Block parser](https://github.com/eliemichel/learnwebgpu/blob/main/_extensions/sphinx_literate/parse.py): `_extensions/sphinx_literate/parse.py`
- [Block registry](https://github.com/eliemichel/learnwebgpu/blob/main/_extensions/sphinx_literate/registry.py): `_extensions/sphinx_literate/registry.py`
- [Document nodes](https://github.com/eliemichel/learnwebgpu/blob/main/_extensions/sphinx_literate/nodes.py): `_extensions/sphinx_literate/nodes.py`
- [Code tangler](https://github.com/eliemichel/learnwebgpu/blob/main/_extensions/sphinx_literate/tangle.py): `_extensions/sphinx_literate/tangle.py`
- [Build handlers](https://github.com/eliemichel/learnwebgpu/blob/main/_extensions/sphinx_literate/handlers.py): `_extensions/sphinx_literate/handlers.py`
- [Tangle builder](https://github.com/eliemichel/learnwebgpu/blob/main/_extensions/sphinx_literate/builder.py): `_extensions/sphinx_literate/builder.py`

### WebGPU helpers

- [ImGui WebGPU renderer](https://github.com/eliemichel/learnwebgpu/blob/main/data/imgui_impl_wgpu.cpp): `data/imgui_impl_wgpu.cpp`
- [ImGui renderer API](https://github.com/eliemichel/learnwebgpu/blob/main/data/imgui_impl_wgpu.h): `data/imgui_impl_wgpu.h`
- [Texture image export](https://github.com/eliemichel/learnwebgpu/blob/main/data/save_image.h): `data/save_image.h`
- [Image encoding](https://github.com/eliemichel/learnwebgpu/blob/main/data/stb_image_write.h): `data/stb_image_write.h`

### Translations

- [French translation](https://github.com/eliemichel/learnwebgpu/tree/main/translation/fr): `translation/fr`
- [Russian translation](https://github.com/eliemichel/learnwebgpu/tree/main/translation/ru): `translation/ru`
- [Ukrainian translation](https://github.com/eliemichel/learnwebgpu/tree/main/translation/uk): `translation/uk`
- [Chinese translation](https://github.com/eliemichel/learnwebgpu/tree/main/translation/zh): `translation/zh`

### Other components

- **Learner**
- **Sphinx**

## Connections

- Learner → LearnWebGPU site: visits (evidence: `README.md`)
- LearnWebGPU site → Introduction: introduces (evidence: `README.md`)
- LearnWebGPU site → Getting started: guides setup (evidence: `README.md`)
- LearnWebGPU site → 3D rendering: teaches rendering (evidence: `README.md`)
- LearnWebGPU site → Compute: teaches compute
- LearnWebGPU site → Advanced techniques: covers techniques
- LearnWebGPU site → Appendices: provides reference
- Sphinx → LearnWebGPU site: builds website (evidence: `README.md`)
- Sphinx → Literate directives: loads extension
- Literate directives → Block parser: parses titles (evidence: `_extensions/sphinx_literate/directives.py`)
- Literate directives → Block registry: registers blocks (evidence: `_extensions/sphinx_literate/directives.py`)
- Literate directives → Document nodes: creates nodes (evidence: `_extensions/sphinx_literate/directives.py`)
- Block parser → Block registry: uses block types (evidence: `_extensions/sphinx_literate/parse.py`)
- Document nodes → Block registry: uses block records (evidence: `_extensions/sphinx_literate/nodes.py`)
- Build handlers → Block registry: resolves blocks (evidence: `_extensions/sphinx_literate/handlers.py`)
- Build handlers → Code tangler: tangles directives (evidence: `_extensions/sphinx_literate/handlers.py`)
- Code tangler → Block registry: looks up blocks (evidence: `_extensions/sphinx_literate/tangle.py`)
- Code tangler → Block parser: parses links (evidence: `_extensions/sphinx_literate/tangle.py`)
- Tangle builder → Block registry: enumerates blocks (evidence: `_extensions/sphinx_literate/builder.py`)
- Tangle builder → Code tangler: generates files (evidence: `_extensions/sphinx_literate/builder.py`)
- ImGui WebGPU renderer → ImGui renderer API: implements API (evidence: `data/imgui_impl_wgpu.cpp`)
- Texture image export → Image encoding: writes images (evidence: `data/save_image.h`)
- LearnWebGPU site → French translation: offers translation
- LearnWebGPU site → Russian translation: offers translation
- LearnWebGPU site → Ukrainian translation: offers translation
- LearnWebGPU site → Chinese translation: offers translation
