# kwasos/tolkienfanclub architecture

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

- Interactive diagram: https://gitdiagram.com/kwasos/tolkienfanclub
- Repository: https://github.com/kwasos/tolkienfanclub

## Overview

Tolkienfanclub is a learning-oriented static site generator. Its main workflow takes Markdown pages from content/, converts them into HTML using a shared template, and writes the pages into docs/; it also copies static assets into that output. Internally, Markdown conversion proceeds through block parsing, inline parsing, text-node conversion, and HTML-node serialization. The diagram reflects the sampled Python source; README documentation is brief, so no additional product capabilities are indicated.

Main entry points: [`src/create_public_files.py`](https://github.com/kwasos/tolkienfanclub/blob/main/src/create_public_files.py) (Page assembly), [`src/main.py`](https://github.com/kwasos/tolkienfanclub/blob/main/src/main.py) (Generator entry), [`src/markdown_blocks.py`](https://github.com/kwasos/tolkienfanclub/blob/main/src/markdown_blocks.py) (Block parser), [`src/textnode.py`](https://github.com/kwasos/tolkienfanclub/blob/main/src/textnode.py) (Text-node conversion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_generation["Site generation"]
  node_main["Generator entry<br/>[main.py]"]
  node_pagegen["Recursive page generation"]
  node_page["Page assembly"]
end

subgraph group_markdown["Markdown rendering"]
  node_blocks["Block parser<br/>[markdown_blocks.py]"]
  node_inline["Inline parser<br/>[inline_markdown.py]"]
  node_textnode["Text-node conversion<br/>[textnode.py]"]
  node_htmlnode["HTML-node serialization<br/>[htmlnode.py]"]
end

subgraph group_assets["Inputs and output"]
  node_content["Markdown content"]
  node_template["HTML template<br/>[template.html]"]
  node_static["Static assets"]
  node_output["Generated site"]
end

node_author(("Site author"))

node_author -->|"runs generator"| node_main
node_main -->|"dispatches pages"| node_pagegen
node_main -->|"copies assets"| node_static
node_main -->|"creates output"| node_output
node_pagegen -->|"reads pages"| node_content
node_pagegen -->|"generates page"| node_page
node_pagegen -->|"writes pages"| node_output
node_page -->|"reads Markdown"| node_content
node_page -->|"reads template"| node_template
node_page -->|"parses Markdown"| node_blocks
node_page -->|"serializes HTML"| node_htmlnode
node_page -->|"writes HTML"| node_output
node_blocks -->|"parses inline text"| node_inline
node_blocks -->|"converts text nodes"| node_textnode
node_blocks -->|"builds HTML nodes"| node_htmlnode
node_inline -->|"creates text nodes"| node_textnode
node_textnode -->|"creates leaf nodes"| node_htmlnode

click node_main "https://github.com/kwasos/tolkienfanclub/blob/main/src/main.py"
click node_pagegen "https://github.com/kwasos/tolkienfanclub/blob/main/src/create_public_files.py"
click node_page "https://github.com/kwasos/tolkienfanclub/blob/main/src/create_public_files.py"
click node_content "https://github.com/kwasos/tolkienfanclub/tree/main/content"
click node_template "https://github.com/kwasos/tolkienfanclub/blob/main/template.html"
click node_static "https://github.com/kwasos/tolkienfanclub/tree/main/static"
click node_output "https://github.com/kwasos/tolkienfanclub/tree/main/docs"
click node_blocks "https://github.com/kwasos/tolkienfanclub/blob/main/src/markdown_blocks.py"
click node_inline "https://github.com/kwasos/tolkienfanclub/blob/main/src/inline_markdown.py"
click node_textnode "https://github.com/kwasos/tolkienfanclub/blob/main/src/textnode.py"
click node_htmlnode "https://github.com/kwasos/tolkienfanclub/blob/main/src/htmlnode.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_main,node_pagegen,node_page toneBlue
class node_blocks,node_inline,node_textnode,node_htmlnode toneAmber
class node_content,node_template,node_static,node_output toneMint
class node_author toneIndigo
```

## Components

### Site generation

- [Generator entry](https://github.com/kwasos/tolkienfanclub/blob/main/src/main.py): `src/main.py`
- [Recursive page generation](https://github.com/kwasos/tolkienfanclub/blob/main/src/create_public_files.py): `src/create_public_files.py`
- [Page assembly](https://github.com/kwasos/tolkienfanclub/blob/main/src/create_public_files.py): `src/create_public_files.py`

### Markdown rendering

- [Block parser](https://github.com/kwasos/tolkienfanclub/blob/main/src/markdown_blocks.py): `src/markdown_blocks.py`
- [Inline parser](https://github.com/kwasos/tolkienfanclub/blob/main/src/inline_markdown.py): `src/inline_markdown.py`
- [Text-node conversion](https://github.com/kwasos/tolkienfanclub/blob/main/src/textnode.py): `src/textnode.py`
- [HTML-node serialization](https://github.com/kwasos/tolkienfanclub/blob/main/src/htmlnode.py): `src/htmlnode.py`

### Inputs and output

- [Markdown content](https://github.com/kwasos/tolkienfanclub/tree/main/content): `content`
- [HTML template](https://github.com/kwasos/tolkienfanclub/blob/main/template.html): `template.html`
- [Static assets](https://github.com/kwasos/tolkienfanclub/tree/main/static): `static`
- [Generated site](https://github.com/kwasos/tolkienfanclub/tree/main/docs): `docs`

### Other components

- **Site author**

## Connections

- Site author → Generator entry: runs generator
- Generator entry → Recursive page generation: dispatches pages
- Generator entry → Static assets: copies assets
- Generator entry → Generated site: creates output
- Recursive page generation → Markdown content: reads pages
- Recursive page generation → Page assembly: generates page
- Recursive page generation → Generated site: writes pages
- Page assembly → Markdown content: reads Markdown
- Page assembly → HTML template: reads template
- Page assembly → Block parser: parses Markdown
- Page assembly → HTML-node serialization: serializes HTML
- Page assembly → Generated site: writes HTML
- Block parser → Inline parser: parses inline text
- Block parser → Text-node conversion: converts text nodes
- Block parser → HTML-node serialization: builds HTML nodes
- Inline parser → Text-node conversion: creates text nodes
- Text-node conversion → HTML-node serialization: creates leaf nodes
