# ewantown/nice-org-html architecture

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

- Interactive diagram: https://gitdiagram.com/ewantown/nice-org-html
- Repository: https://github.com/ewantown/nice-org-html

## Overview

nice-org-html is an Emacs Org-to-HTML export and publishing package. Users export an Org document or project through its extended HTML backend; the generated page can incorporate theme-derived styling and optional assets, then provides responsive browser controls. The README documents publishing, image embedding, admonitions, and export customization; implementation details for the Emacs backend and CSS were not sampled, so those relationships are documented rather than inferred from source.

Main entry points: [`code/nice-org-html.el`](https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.el) (HTML backend), [`code/nice-org-html.css`](https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.css) (CSS template), [`code/nice-org-html.js`](https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.js) (Theme toggling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_export["Org export"]
  node_org["Org document"]
  node_backend["HTML backend<br/>[nice-org-html.el]"]
end

subgraph group_presentation["Page presentation"]
  node_theme["Theme colors<br/>[nice-org-html.el]"]
  node_template["CSS template<br/>[nice-org-html.css]"]
  node_injection["Asset injection<br/>[nice-org-html.el]"]
  node_admonitions["Admonitions<br/>[nice-org-html.el]"]
  node_images["Image embedding<br/>[nice-org-html.el]"]
end

subgraph group_browser["Browser behavior"]
  node_html["Generated HTML"]
  node_mode["Theme toggling<br/>[nice-org-html.js]"]
  node_toc["TOC controls<br/>[nice-org-html.js]"]
  node_navigation["Sticky navigation<br/>[nice-org-html.js]"]
  node_drawers["Header drawers<br/>[nice-org-html.js]"]
  node_collapsing["Section collapsing<br/>[nice-org-html.js]"]
  node_clipboard["Code copy<br/>[nice-org-html.js]"]
end

node_author(("Org author"))
node_browser(("Visitor browser"))

node_author -->|"writes"| node_org
node_org -->|"exports"| node_backend
node_backend -->|"extracts colors"| node_theme
node_theme -->|"fills template"| node_template
node_backend -->|"injects assets"| node_injection
node_backend -->|"renders blocks"| node_admonitions
node_backend -->|"embeds images"| node_images
node_backend -->|"generates"| node_html
node_template -->|"styles"| node_html
node_injection -->|"adds assets"| node_html
node_html -->|"opens"| node_browser
node_browser -->|"runs script"| node_mode
node_browser -->|"runs script"| node_toc
node_browser -->|"runs script"| node_navigation
node_browser -->|"runs script"| node_drawers
node_browser -->|"runs script"| node_collapsing
node_browser -.->|"runs script"| node_clipboard

click node_backend "https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.el"
click node_theme "https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.el"
click node_template "https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.css"
click node_injection "https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.el"
click node_admonitions "https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.el"
click node_images "https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.el"
click node_mode "https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.js"
click node_toc "https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.js"
click node_navigation "https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.js"
click node_drawers "https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.js"
click node_collapsing "https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.js"
click node_clipboard "https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.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_org,node_backend,node_browser toneBlue
class node_theme,node_template,node_injection,node_admonitions,node_images toneAmber
class node_html,node_mode,node_toc,node_navigation,node_drawers,node_collapsing,node_clipboard toneMint
class node_author toneIndigo
```

## Components

### Org export

- **Org document**
- [HTML backend](https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.el): `code/nice-org-html.el`

### Page presentation

- [Theme colors](https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.el): `code/nice-org-html.el`
- [CSS template](https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.css): `code/nice-org-html.css`
- [Asset injection](https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.el): `code/nice-org-html.el`
- [Admonitions](https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.el): `code/nice-org-html.el`
- [Image embedding](https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.el): `code/nice-org-html.el`

### Browser behavior

- **Generated HTML**
- [Theme toggling](https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.js): `code/nice-org-html.js`
- [TOC controls](https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.js): `code/nice-org-html.js`
- [Sticky navigation](https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.js): `code/nice-org-html.js`
- [Header drawers](https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.js): `code/nice-org-html.js`
- [Section collapsing](https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.js): `code/nice-org-html.js`
- [Code copy](https://github.com/ewantown/nice-org-html/blob/master/code/nice-org-html.js): `code/nice-org-html.js`

### Other components

- **Org author**
- **Visitor browser**

## Connections

- Org author → Org document: writes
- Org document → HTML backend: exports
- HTML backend → Theme colors: extracts colors
- Theme colors → CSS template: fills template
- HTML backend → Asset injection: injects assets
- HTML backend → Admonitions: renders blocks
- HTML backend → Image embedding: embeds images
- HTML backend → Generated HTML: generates
- CSS template → Generated HTML: styles
- Asset injection → Generated HTML: adds assets
- Generated HTML → Visitor browser: opens
- Visitor browser → Theme toggling: runs script (evidence: `code/nice-org-html.js`)
- Visitor browser → TOC controls: runs script (evidence: `code/nice-org-html.js`)
- Visitor browser → Sticky navigation: runs script (evidence: `code/nice-org-html.js`)
- Visitor browser → Header drawers: runs script (evidence: `code/nice-org-html.js`)
- Visitor browser → Section collapsing: runs script (evidence: `code/nice-org-html.js`)
- Visitor browser → Code copy: runs script
