# songkg7/o2 architecture

> Architecture diagram of the GitHub repository songkg7/o2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/songkg7/o2
- Repository: https://github.com/songkg7/o2

## Overview

##### Main Components Identification

The system should be represented with these key components:

a) Core Components:
- Converter System (src/core/)
- Platform-Specific Converters (src/jekyll/, src/docusaurus/)
- Individual Conversion Handlers (various *Converter.ts files)

b) External Integration:
- Obsidian API Interface
- Output Platforms (Jekyll, Docusaurus)

**Top Level (User Interface):**
- Obsidian Plugin Interface

**Middle Level (Core Processing):**
- ConverterChain
- Individual Converters

**Bottom Level (Platform Specific):**
- Jekyll Implementation
- Docusaurus Implementation

##### Component Relationships

a) Data Flow:
- Input: Obsidian Markdown → Converter Chain
- Processing: Converter Chain → Individual Converters
- Output: Platform-Specific Converters → Converted Markdown

b) Dependencies:
- How ConverterChain orchestrates individual converters
- Platform-specific settings integration

##### Specific Implementation Details

Key architectural elements:

**Converter Chain:**
- WikiLinkConverter
- CalloutConverter
- EmbedsConverter
- FootnotesConverter
- FrontMatterConverter
- ResourceLinkConverter
- etc.

**Platform Handlers:**
- Jekyll/Chirpy
- Docusaurus

##### Important Notes

- File system interaction (ready → archive folder movement)
- Configuration points (settings.ts integration)
- Validation checkpoints
- Test coverage scope

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph UI[User Interface Layer]
        OPI[Obsidian Plugin Interface]
    end

    subgraph Core[Core Processing Layer]
        CC[Converter Chain]:::core
        CV[Core Converter]:::core
        VAL[Validation System]:::core
        OR[Obsidian Regex]:::core
    end

    subgraph Converters[Converter Components]
        WLC[WikiLink Converter]:::converter
        CAC[Callout Converter]:::converter
        EMC[Embeds Converter]:::converter
        FNC[Footnotes Converter]:::converter
        FMC[FrontMatter Converter]:::converter
        RLC[Resource Link Converter]:::converter
    end

    subgraph Platform[Platform Layer]
        subgraph Jekyll[Jekyll Implementation]
            JK[Jekyll/Chirpy Handler]:::platform
            JKS[Jekyll Settings]:::config
        end
        
        subgraph Docusaurus[Docusaurus Implementation]
            DC[Docusaurus Handler]:::platform
            DCS[Docusaurus Settings]:::config
        end
    end

    subgraph Config[Configuration]
        SET[Plugin Settings]:::config
    end

    %% Connections
    OPI --> CC
    CC --> CV
    CC --> VAL
    CC --> OR

    CC --> WLC
    CC --> CAC
    CC --> EMC
    CC --> FNC
    CC --> FMC
    CC --> RLC

    WLC & CAC & EMC & FNC & FMC & RLC --> JK
    WLC & CAC & EMC & FNC & FMC & RLC --> DC

    SET --> JKS
    SET --> DCS
    JKS --> JK
    DCS --> DC

    %% Click Events
    click CC "https://github.com/songkg7/o2/blob/main/src/core/ConverterChain.ts"
    click CV "https://github.com/songkg7/o2/blob/main/src/core/Converter.ts"
    click VAL "https://github.com/songkg7/o2/blob/main/src/core/validation.ts"
    click OR "https://github.com/songkg7/o2/blob/main/src/core/ObsidianRegex.ts"
    click WLC "https://github.com/songkg7/o2/blob/main/src/WikiLinkConverter.ts"
    click CAC "https://github.com/songkg7/o2/blob/main/src/CalloutConverter.ts"
    click EMC "https://github.com/songkg7/o2/blob/main/src/EmbedsConverter.ts"
    click FNC "https://github.com/songkg7/o2/blob/main/src/FootnotesConverter.ts"
    click FMC "https://github.com/songkg7/o2/blob/main/src/FrontMatterConverter.ts"
    click RLC "https://github.com/songkg7/o2/blob/main/src/ResourceLinkConverter.ts"
    click JK "https://github.com/songkg7/o2/blob/main/src/jekyll/chirpy.ts"
    click DC "https://github.com/songkg7/o2/blob/main/src/docusaurus/docusaurus.ts"
    click SET "https://github.com/songkg7/o2/blob/main/src/settings.ts"
    click JKS "https://github.com/songkg7/o2/blob/main/src/jekyll/settings/JekyllSettings.ts"
    click DCS "https://github.com/songkg7/o2/blob/main/src/docusaurus/settings/DocusaurusSettings.ts"

    %% Styling
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef converter fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef platform fill:#FF9800,stroke:#F57C00,color:white
    classDef config fill:#757575,stroke:#616161,color:white

    %% Legend
    subgraph Legend
        L1[Core Component]:::core
        L2[Converter]:::converter
        L3[Platform Handler]:::platform
        L4[Configuration]:::config
    end
```
