# christiannoll/sitegenerator architecture

> Architecture diagram of the GitHub repository christiannoll/sitegenerator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/christiannoll/sitegenerator
- Repository: https://github.com/christiannoll/sitegenerator

## Overview

##### Main Components

A. Core Generator Components:
- Content Processing System
- Output Generation System
- Verification System
- Statistics System

B. File Processing Pipeline:
- Input Processing
- Content Generation
- Output Generation

##### Component Breakdown and Relationships

a) Content Processing Layer (Top Level):
- LinkParser and YearParser as supporting components

b) Site Structure Components (Middle Level):
- Related components:
- Archive System (Archive, ArchiveMonth, ArchiveYear)
- Register System (BooksRegister, MoviesRegister, PersonsRegister)
- Index System (Index, IndexItem)
- Search System (SearchIndexBuilder, SearchItems)

c) Page Generation Layer:
- To PageWriter and AppWriter
- Relationship with SmlBuilder and FormatBuilder

d) Output Generation (Bottom Level):
- FeedWriter, SitemapWriter, and FtpScriptWriter
- Connection to final output files

##### Specific Implementation Details

**[Input Content] → [Markdown Processing] → [Content Parsing] → [Page Generation] → [Output Writers]**
- ↓
- [Support Systems]
- (Search, Statistics, Verification)

##### Additional Elements

Supporting systems as parallel workflows:
- Statistics Generation (Statistics folder components)
- Verification System (Verifier folder components)
- Search Functionality (Search-related components)

##### Data Flow Indicators

- Content transformation flow
- Data validation paths
- Output generation routes
- Verification processes

Key Relationships to Highlight:
##### Output Generation: PageWriter → SmlBuilder → FtpScriptWriter

This system design should clearly show how the generator transforms markdown content into a fully functional static website with features like search, archives, and various content registers.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Content Processing Layer"
        MP["MarkdownParser"]:::core
        MT["MarkdownTokenizer"]:::core
        CP["ContentParser"]:::core
        LP["LinkParser"]:::core
        YP["YearParser"]:::core
        
        MP --> MT
        MT --> CP
        CP --> LP
        CP --> YP
    end

    subgraph "Site Structure Layer"
        subgraph "Archive System"
            A["Archive"]:::structure
            AM["ArchiveMonth"]:::structure
            AY["ArchiveYear"]:::structure
            AP["ArchivePage"]:::structure
            AMP["ArchiveMonthPage"]:::structure
            
            A --> AM
            AM --> AY
            A --> AP
            AM --> AMP
        end

        subgraph "Register System"
            R["Register"]:::structure
            RI["RegisterItem"]:::structure
            BR["BooksRegister"]:::structure
            MR["MoviesRegister"]:::structure
            PR["PersonsRegister"]:::structure
            
            R --> RI
            R --> BR
            R --> MR
            R --> PR
        end

        subgraph "Index System"
            I["Index"]:::structure
            II["IndexItem"]:::structure
            IP["IndexPage"]:::structure
            IIP["IndexItemPage"]:::structure
            
            I --> II
            I --> IP
            II --> IIP
        end

        subgraph "Search System"
            SIB["SearchIndexBuilder"]:::structure
            SI["SearchItems"]:::structure
            SIT["SearchItem"]:::structure
            SP["SearchPage"]:::structure
            ASP["AdvancedSearchPage"]:::structure
            
            SIB --> SI
            SI --> SIT
            SI --> SP
            SI --> ASP
        end
    end

    subgraph "Page Generation Layer"
        P["Page"]:::page
        HP["HomePage"]:::page
        PP["PostPage"]:::page
        PB["PostBuilder"]:::page
        SB["SmlBuilder"]:::page
        FB["FormatBuilder"]:::page
        
        P --> HP
        P --> PP
        PB --> PP
        SB --> P
        FB --> P
    end

    subgraph "Output Generation Layer"
        PW["PageWriter"]:::output
        FW["FeedWriter"]:::output
        SW["SitemapWriter"]:::output
        FSW["FtpScriptWriter"]:::output
        AW["AppWriter"]:::output
        
        PW --> FW
        PW --> SW
        PW --> FSW
        PW --> AW
    end

    subgraph "Support Systems"
        subgraph "Verification System"
            PL["PageLoader"]:::support
            PV["PageVerifier"]:::support
            
            PL --> PV
        end

        subgraph "Statistics System"
            SS["SiteStatistics"]:::support
            SD["StatisticData"]:::support
            SP2["StatisticPage"]:::support
            PSD["PostStatisticData"]:::support
            
            SS --> SD
            SD --> SP2
            SD --> PSD
        end
    end

    CP --> PB
    PB --> PW
    
    %% Component Mappings
    click MP "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/MarkdownParser.swift"
    click MT "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/MarkdownTokenizer.swift"
    click CP "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/ContentParser.swift"
    click LP "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/LinkParser.swift"
    click YP "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/YearParser.swift"
    click PW "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/PageWriter.swift"
    click FW "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/FeedWriter.swift"
    click SW "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/SitemapWriter.swift"
    click FSW "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/FtpScriptWriter.swift"
    click AW "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/AppWriter.swift"
    click PL "https://github.com/christiannoll/SiteGenerator/blob/main/Verifier/PageLoader.swift"
    click PV "https://github.com/christiannoll/SiteGenerator/blob/main/Verifier/PageVerifier.swift"
    click SS "https://github.com/christiannoll/SiteGenerator/blob/main/Statistics/SiteStatistics.swift"
    click SD "https://github.com/christiannoll/SiteGenerator/blob/main/Statistics/StatisticData.swift"
    click SP2 "https://github.com/christiannoll/SiteGenerator/blob/main/Statistics/StatisticPage.swift"
    click PSD "https://github.com/christiannoll/SiteGenerator/blob/main/Statistics/PostStatisticData.swift"
    click A "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/Archive.swift"
    click AM "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/ArchiveMonth.swift"
    click AY "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/ArchiveYear.swift"
    click AP "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/ArchivePage.swift"
    click AMP "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/ArchiveMonthPage.swift"
    click R "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/Register.swift"
    click RI "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/RegisterItem.swift"
    click BR "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/BooksRegister.swift"
    click MR "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/MoviesRegister.swift"
    click PR "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/PersonsRegister.swift"
    click I "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/Index.swift"
    click II "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/IndexItem.swift"
    click IP "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/IndexPage.swift"
    click IIP "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/IndexItemPage.swift"
    click SIB "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/SearchIndexBuilder.swift"
    click SI "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/SearchItems.swift"
    click SIT "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/SearchItem.swift"
    click SP "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/SearchPage.swift"
    click ASP "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/AdvancedSearchPage.swift"
    click P "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/Page.swift"
    click HP "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/HomePage.swift"
    click PP "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/PostPage.swift"
    click PB "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/PostBuilder.swift"
    click SB "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/SmlBuilder.swift"
    click FB "https://github.com/christiannoll/SiteGenerator/blob/main/SiteGenerator/FormatBuilder.swift"

    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef structure fill:#4CAF50,stroke:#2E7D32,color:white
    classDef page fill:#FF9800,stroke:#EF6C00,color:white
    classDef output fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef support fill:#9E9E9E,stroke:#616161,color:white
```
