# venthur/blag architecture

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

- Interactive diagram: https://gitdiagram.com/venthur/blag
- Repository: https://github.com/venthur/blag

## Overview

blag is a Python static-site generator for Markdown-based blogs. A user can bootstrap a site with quickstart, edit content and configuration, then run the build command to convert Markdown, render pages, and generate blog indexes and an Atom feed in an output directory. Its integrated development server watches content, templates, and static assets, rebuilds on changes, and serves the output. The excerpts show the build and development-server relationships; the README documents syntax highlighting and theming, but not their full implementation wiring.

Main entry points: [`blag/blag.py`](https://github.com/venthur/blag/blob/master/blag/blag.py) (Page rendering), [`blag/quickstart.py`](https://github.com/venthur/blag/blob/master/blag/quickstart.py) (Quickstart setup), [`blag/devserver.py`](https://github.com/venthur/blag/blob/master/blag/devserver.py) (Development server), [`blag/content`](https://github.com/venthur/blag/tree/master/blag/content) (Markdown content)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Site authoring"]
  node_quickstart["Quickstart setup<br/>[quickstart.py]"]
  node_site_content["Markdown content"]
  node_site_config["Site configuration"]
end

subgraph group_generation["Site generation"]
  node_cli["CLI commands<br/>[blag.py]"]
  node_markdown["Markdown conversion<br/>[markdown.py]"]
  node_page_rendering["Page rendering<br/>[blag.py]"]
  node_blog_indexes["Blog indexes and tags<br/>[blag.py]"]
  node_atom_feed["Atom feed generation<br/>[blag.py]"]
  node_output_site["Generated site"]
end

subgraph group_presentation["Themes and assets"]
  node_templates["Jinja templates"]
  node_static_assets["Static assets"]
  node_syntax_highlighting["Syntax highlighting"]
end

subgraph group_development["Development server"]
  node_devserver["Development server<br/>[devserver.py]"]
  node_file_watcher["Change monitoring<br/>[devserver.py]"]
end

node_site_author(("Site author"))
node_browser(("Browser"))

node_site_author -->|"initializes site"| node_quickstart
node_quickstart -->|"writes config"| node_site_config
node_quickstart -->|"copies theme"| node_templates
node_quickstart -->|"copies examples"| node_site_content
node_site_author -->|"writes Markdown"| node_site_content
node_site_author -->|"runs commands"| node_cli
node_cli -->|"builds site"| node_page_rendering
node_page_rendering -->|"reads settings"| node_site_config
node_page_rendering -->|"reads files"| node_site_content
node_page_rendering -->|"converts Markdown"| node_markdown
node_page_rendering -->|"renders with"| node_templates
node_page_rendering -->|"writes pages"| node_output_site
node_page_rendering -->|"copies assets"| node_static_assets
node_page_rendering -->|"generates indexes"| node_blog_indexes
node_blog_indexes -->|"writes indexes"| node_output_site
node_page_rendering -->|"generates feed"| node_atom_feed
node_atom_feed -->|"writes Atom feed"| node_output_site
node_markdown -.->|"supports highlighting"| node_syntax_highlighting
node_cli -->|"starts server"| node_devserver
node_devserver -->|"starts monitoring"| node_file_watcher
node_file_watcher -->|"triggers rebuild"| node_page_rendering
node_devserver -->|"serves files"| node_output_site
node_browser -.->|"requests pages"| node_devserver

click node_quickstart "https://github.com/venthur/blag/blob/master/blag/quickstart.py"
click node_site_content "https://github.com/venthur/blag/tree/master/blag/content"
click node_cli "https://github.com/venthur/blag/blob/master/blag/blag.py"
click node_markdown "https://github.com/venthur/blag/blob/master/blag/markdown.py"
click node_page_rendering "https://github.com/venthur/blag/blob/master/blag/blag.py"
click node_blog_indexes "https://github.com/venthur/blag/blob/master/blag/blag.py"
click node_atom_feed "https://github.com/venthur/blag/blob/master/blag/blag.py"
click node_templates "https://github.com/venthur/blag/tree/master/blag/templates"
click node_static_assets "https://github.com/venthur/blag/tree/master/blag/static"
click node_devserver "https://github.com/venthur/blag/blob/master/blag/devserver.py"
click node_file_watcher "https://github.com/venthur/blag/blob/master/blag/devserver.py"

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_quickstart,node_site_content,node_site_config,node_browser toneBlue
class node_cli,node_markdown,node_page_rendering,node_blog_indexes,node_atom_feed,node_output_site toneAmber
class node_templates,node_static_assets,node_syntax_highlighting toneMint
class node_devserver,node_file_watcher toneRose
class node_site_author toneIndigo
```

## Components

### Site authoring

- [Quickstart setup](https://github.com/venthur/blag/blob/master/blag/quickstart.py): `blag/quickstart.py`
- [Markdown content](https://github.com/venthur/blag/tree/master/blag/content): `blag/content`
- **Site configuration**

### Site generation

- [CLI commands](https://github.com/venthur/blag/blob/master/blag/blag.py): `blag/blag.py`
- [Markdown conversion](https://github.com/venthur/blag/blob/master/blag/markdown.py): `blag/markdown.py`
- [Page rendering](https://github.com/venthur/blag/blob/master/blag/blag.py): `blag/blag.py`
- [Blog indexes and tags](https://github.com/venthur/blag/blob/master/blag/blag.py): `blag/blag.py`
- [Atom feed generation](https://github.com/venthur/blag/blob/master/blag/blag.py): `blag/blag.py`
- **Generated site**

### Themes and assets

- [Jinja templates](https://github.com/venthur/blag/tree/master/blag/templates): `blag/templates`
- [Static assets](https://github.com/venthur/blag/tree/master/blag/static): `blag/static`
- **Syntax highlighting**

### Development server

- [Development server](https://github.com/venthur/blag/blob/master/blag/devserver.py): `blag/devserver.py`
- [Change monitoring](https://github.com/venthur/blag/blob/master/blag/devserver.py): `blag/devserver.py`

### Other components

- **Site author**
- **Browser**

## Connections

- Site author → Quickstart setup: initializes site (evidence: `README.md`)
- Quickstart setup → Site configuration: writes config (evidence: `blag/quickstart.py`)
- Quickstart setup → Jinja templates: copies theme (evidence: `blag/quickstart.py`)
- Quickstart setup → Markdown content: copies examples (evidence: `blag/quickstart.py`)
- Site author → Markdown content: writes Markdown (evidence: `README.md`)
- Site author → CLI commands: runs commands (evidence: `README.md`)
- CLI commands → Page rendering: builds site (evidence: `blag/blag.py`)
- Page rendering → Site configuration: reads settings (evidence: `blag/blag.py`)
- Page rendering → Markdown content: reads files (evidence: `blag/blag.py`)
- Page rendering → Markdown conversion: converts Markdown (evidence: `blag/blag.py`)
- Page rendering → Jinja templates: renders with (evidence: `blag/blag.py`)
- Page rendering → Generated site: writes pages (evidence: `blag/blag.py`)
- Page rendering → Static assets: copies assets (evidence: `blag/blag.py`)
- Page rendering → Blog indexes and tags: generates indexes (evidence: `blag/blag.py`)
- Blog indexes and tags → Generated site: writes indexes (evidence: `blag/blag.py`)
- Page rendering → Atom feed generation: generates feed (evidence: `blag/blag.py`)
- Atom feed generation → Generated site: writes Atom feed (evidence: `blag/blag.py`)
- Markdown conversion → Syntax highlighting: supports highlighting (evidence: `README.md`)
- CLI commands → Development server: starts server (evidence: `blag/blag.py`)
- Development server → Change monitoring: starts monitoring (evidence: `blag/devserver.py`)
- Change monitoring → Page rendering: triggers rebuild (evidence: `blag/devserver.py`)
- Development server → Generated site: serves files (evidence: `blag/devserver.py`)
- Browser → Development server: requests pages
