# adlerzz/fast-markup architecture

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

- Interactive diagram: https://gitdiagram.com/adlerzz/fast-markup
- Repository: https://github.com/adlerzz/fast-markup

## Overview

fast-markup is a small browser-side markup and DOM utility exposed as the global `fm`. Its workflow converts a declarative Unit into a DOM element, or selects existing elements; callers can then insert, remove, or substitute template content. Separate APIs register and dispose event listeners and generate removable stylesheets. The excerpts show the implementation and its calls into shared types/utilities; README documentation is absent, so no additional capabilities are inferred.

Main entry points: [`src/main.ts`](https://github.com/adlerzz/fast-markup/blob/main/src/main.ts) (Global fm entry), [`src/types/models.ts`](https://github.com/adlerzz/fast-markup/blob/main/src/types/models.ts) (Markup and style types), [`src/functions/fm.function.ts`](https://github.com/adlerzz/fast-markup/blob/main/src/functions/fm.function.ts) (Markup and DOM ops), [`src/functions/style.function.ts`](https://github.com/adlerzz/fast-markup/blob/main/src/functions/style.function.ts) (Stylesheet generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Global API"]
  node_entry["Global fm entry<br/>[main.ts]"]
end

subgraph group_markup["Markup and DOM"]
  node_fm["Markup and DOM ops<br/>[fm.function.ts]"]
end

subgraph group_extensions["Browser extensions"]
  node_events["Event listeners<br/>[on.function.ts]"]
  node_styles["Stylesheet generator<br/>[style.function.ts]"]
end

subgraph group_shared["Shared models"]
  node_utils["Markup utilities<br/>[utils.ts]"]
  node_models["Markup and style types<br/>[models.ts]"]
end

node_browser(("Browser caller"))

node_browser -->|"calls global"| node_entry
node_entry -->|"dispatches markup"| node_fm
node_entry -->|"exposes events"| node_events
node_entry -->|"exposes styles"| node_styles
node_fm -->|"converts units"| node_utils
node_fm -->|"uses types"| node_models
node_utils -->|"uses types"| node_models
node_events -->|"uses types"| node_models
node_styles -->|"checks values"| node_utils
node_styles -->|"uses types"| node_models

click node_entry "https://github.com/adlerzz/fast-markup/blob/main/src/main.ts"
click node_fm "https://github.com/adlerzz/fast-markup/blob/main/src/functions/fm.function.ts"
click node_utils "https://github.com/adlerzz/fast-markup/blob/main/src/utils.ts"
click node_models "https://github.com/adlerzz/fast-markup/blob/main/src/types/models.ts"
click node_events "https://github.com/adlerzz/fast-markup/blob/main/src/functions/on.function.ts"
click node_styles "https://github.com/adlerzz/fast-markup/blob/main/src/functions/style.function.ts"

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_entry,node_browser toneBlue
class node_fm toneAmber
class node_events,node_styles toneMint
class node_utils,node_models toneRose
```

## Components

### Global API

- [Global fm entry](https://github.com/adlerzz/fast-markup/blob/main/src/main.ts): `src/main.ts`

### Markup and DOM

- [Markup and DOM ops](https://github.com/adlerzz/fast-markup/blob/main/src/functions/fm.function.ts): `src/functions/fm.function.ts`

### Browser extensions

- [Event listeners](https://github.com/adlerzz/fast-markup/blob/main/src/functions/on.function.ts): `src/functions/on.function.ts`
- [Stylesheet generator](https://github.com/adlerzz/fast-markup/blob/main/src/functions/style.function.ts): `src/functions/style.function.ts`

### Shared models

- [Markup utilities](https://github.com/adlerzz/fast-markup/blob/main/src/utils.ts): `src/utils.ts`
- [Markup and style types](https://github.com/adlerzz/fast-markup/blob/main/src/types/models.ts): `src/types/models.ts`

### Other components

- **Browser caller**

## Connections

- Browser caller → Global fm entry: calls global (evidence: `src/main.ts`)
- Global fm entry → Markup and DOM ops: dispatches markup (evidence: `src/main.ts`)
- Global fm entry → Event listeners: exposes events (evidence: `src/main.ts`)
- Global fm entry → Stylesheet generator: exposes styles (evidence: `src/main.ts`)
- Markup and DOM ops → Markup utilities: converts units (evidence: `src/functions/fm.function.ts`)
- Markup and DOM ops → Markup and style types: uses types (evidence: `src/functions/fm.function.ts`)
- Markup utilities → Markup and style types: uses types (evidence: `src/utils.ts`)
- Event listeners → Markup and style types: uses types (evidence: `src/functions/on.function.ts`)
- Stylesheet generator → Markup utilities: checks values (evidence: `src/functions/style.function.ts`)
- Stylesheet generator → Markup and style types: uses types (evidence: `src/functions/style.function.ts`)
