# fisicausc/dicionario architecture

> Architecture diagram of the GitHub repository fisicausc/dicionario, 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/fisicausc/dicionario
- Repository: https://github.com/fisicausc/dicionario

## Overview

This repository maintains the Dicionario de Física as JSON in an intermediate representation, with tooling to extract legacy XML content, validate entries, and produce Typst, HTML-preview, and PDF outputs. The main documented workflow is content editing in JSON followed by validation and rendering; the XML filter is a separate legacy-import path. The filter and validator are excerpted; rendering relationships and capabilities are documented in the README, but their implementation wiring was not sampled.

Main entry points: [`RI.json`](https://github.com/fisicausc/dicionario/blob/principal/RI.json) (Intermediate JSON), [`trebellos/validador_json.py`](https://github.com/fisicausc/dicionario/blob/principal/trebellos/validador_json.py) (JSON validator), [`dicionario`](https://github.com/fisicausc/dicionario/tree/principal/dicionario) (HTML preview), [`trebellos/filtro_XML_JSON/filtro_XML_JSON.py`](https://github.com/fisicausc/dicionario/blob/principal/trebellos/filtro_XML_JSON/filtro_XML_JSON.py) (XML filter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Dictionary content"]
  node_ri["Intermediate JSON<br/>[RI.json]"]
end

subgraph group_import["Legacy import"]
  node_xml["Legacy XML sources"]
  node_xmlfilter["XML filter<br/>[filtro_XML_JSON.py]"]
end

subgraph group_quality["Validation"]
  node_schema["RI schema<br/>[esquema_RI.json]"]
  node_validator["JSON validator<br/>[validador_json.py]"]
end

subgraph group_outputs["Rendering and output"]
  node_typstfilter["JSON to Typst<br/>[json_a_typst.jq]"]
  node_typststyle["Typst document and style<br/>[dicionario.typ]"]
  node_css["Preview styling<br/>[estilo.css]"]
  node_html["HTML preview"]
  node_pdf["Dictionary PDF"]
end

node_editor(("Content editor"))
node_reader(("Dictionary readers"))

node_editor -->|"edits"| node_ri
node_xml -->|"is filtered by"| node_xmlfilter
node_xmlfilter -->|"extracts entries"| node_ri
node_editor -->|"validates content"| node_validator
node_validator -->|"checks"| node_ri
node_validator -->|"loads schema"| node_schema
node_ri -->|"converts"| node_typstfilter
node_typstfilter -->|"generates content for"| node_typststyle
node_ri -->|"generates preview"| node_html
node_typststyle -->|"compiles to"| node_pdf
node_css -.->|"styles"| node_html
node_pdf -->|"distributes to"| node_reader
node_html -->|"previews for"| node_reader

click node_ri "https://github.com/fisicausc/dicionario/blob/principal/RI.json"
click node_xml "https://github.com/fisicausc/dicionario/tree/principal/trebellos/filtro_XML_JSON/XMLs"
click node_xmlfilter "https://github.com/fisicausc/dicionario/blob/principal/trebellos/filtro_XML_JSON/filtro_XML_JSON.py"
click node_schema "https://github.com/fisicausc/dicionario/blob/principal/trebellos/esquema_RI.json"
click node_validator "https://github.com/fisicausc/dicionario/blob/principal/trebellos/validador_json.py"
click node_typstfilter "https://github.com/fisicausc/dicionario/blob/principal/trebellos/json_a_typst.jq"
click node_typststyle "https://github.com/fisicausc/dicionario/blob/principal/dicionario/dicionario.typ"
click node_css "https://github.com/fisicausc/dicionario/blob/principal/dicionario/estilo.css"
click node_html "https://github.com/fisicausc/dicionario/tree/principal/dicionario"
click node_pdf "https://github.com/fisicausc/dicionario/tree/principal/dicionario"

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_ri toneBlue
class node_xml,node_xmlfilter toneAmber
class node_schema,node_validator toneMint
class node_typstfilter,node_typststyle,node_css,node_html,node_pdf toneRose
class node_editor,node_reader toneIndigo
```

## Components

### Dictionary content

- [Intermediate JSON](https://github.com/fisicausc/dicionario/blob/principal/RI.json): `RI.json`

### Legacy import

- [Legacy XML sources](https://github.com/fisicausc/dicionario/tree/principal/trebellos/filtro_XML_JSON/XMLs): `trebellos/filtro_XML_JSON/XMLs`
- [XML filter](https://github.com/fisicausc/dicionario/blob/principal/trebellos/filtro_XML_JSON/filtro_XML_JSON.py): `trebellos/filtro_XML_JSON/filtro_XML_JSON.py`

### Validation

- [RI schema](https://github.com/fisicausc/dicionario/blob/principal/trebellos/esquema_RI.json): `trebellos/esquema_RI.json`
- [JSON validator](https://github.com/fisicausc/dicionario/blob/principal/trebellos/validador_json.py): `trebellos/validador_json.py`

### Rendering and output

- [JSON to Typst](https://github.com/fisicausc/dicionario/blob/principal/trebellos/json_a_typst.jq): `trebellos/json_a_typst.jq`
- [Typst document and style](https://github.com/fisicausc/dicionario/blob/principal/dicionario/dicionario.typ): `dicionario/dicionario.typ`
- [Preview styling](https://github.com/fisicausc/dicionario/blob/principal/dicionario/estilo.css): `dicionario/estilo.css`
- [HTML preview](https://github.com/fisicausc/dicionario/tree/principal/dicionario): `dicionario`
- [Dictionary PDF](https://github.com/fisicausc/dicionario/tree/principal/dicionario): `dicionario`

### Other components

- **Content editor**
- **Dictionary readers**

## Connections

- Content editor → Intermediate JSON: edits (evidence: `README.md`)
- Legacy XML sources → XML filter: is filtered by (evidence: `README.md`)
- XML filter → Intermediate JSON: extracts entries (evidence: `README.md`)
- Content editor → JSON validator: validates content (evidence: `README.md`)
- JSON validator → Intermediate JSON: checks (evidence: `README.md`)
- JSON validator → RI schema: loads schema (evidence: `trebellos/validador_json.py`)
- Intermediate JSON → JSON to Typst: converts (evidence: `README.md`)
- JSON to Typst → Typst document and style: generates content for (evidence: `README.md`)
- Intermediate JSON → HTML preview: generates preview (evidence: `README.md`)
- Typst document and style → Dictionary PDF: compiles to (evidence: `README.md`)
- Preview styling → HTML preview: styles
- Dictionary PDF → Dictionary readers: distributes to (evidence: `README.md`)
- HTML preview → Dictionary readers: previews for (evidence: `README.md`)
