# wsoft-ws/lantana architecture

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

- Interactive diagram: https://gitdiagram.com/wsoft-ws/lantana
- Repository: https://github.com/wsoft-ws/lantana

## Overview

##### Project Type and Purpose
- Lantana is not a full-stack web app or a backend system—it’s a theme package designed to plug into MkDocs. Its purpose is to provide HTML, CSS, JS assets, and Python “extension” modules (written with Jinja2 templating) so that users can generate modern, responsive, and customizable documentation sites.
- The README confirms support, contribution details, and includes screenshots that illustrate its intended look on PC and mobile.

##### Analyzing the File Structure
- Key Directories:
- The “lantana” directory is the core package. It includes:
▪ Python files (__init__.py, __main__.py) that likely boot the theme.
▪ An “extensions” folder with multiple Python files (accordion.py, alerts.py, etc.) that extend or customize aspects of MkDocs.
▪ Templates and partials (HTML files like base.html, nav.html, breadcrumb.html, and Jinja2 components in “components”) that form the layout.
- The “docs” directory holds extensive documentation including tutorial files, cheat sheets, extension guides, and contribution guidelines.
- Configuration/Build Files:
▪ mkdocs.yml is the configuration file for MkDocs integration.
▪ Setup files like setup.py and MANIFEST.in indicate how the Python package is built and distributed.
▪ The “script” directory contains several build and deployment scripts (install, build-site.sh, update-locales.sh, etc.) which are used for packaging, serving, and updating locales.
- Auxiliary configuration files (.gitattributes, .gitignore, workflows for GitHub Actions) that support CI/CD and versioning.

##### Main Components & Their Interactions
- MkDocs Integration:
- MkDocs reads its configuration (mkdocs.yml) and uses Lantana as the specified theme.
- Core Theme Engine (Lantana Package):
- Within the “lantana” folder, distinct subcomponents exist:
▪ Templating Engine: Base templates (base.html, main.html) and partials (nav.html, breadcrumb.html, components, etc.) define the layout.
▪ Extensions: The “extensions” folder modules (e.g., accordion, alerts, codeblock_copybtn, etc.) adjust or enhance the MkDocs output.
▪ Static Assets: CSS and JS files are responsible for styling and interactive behavior.
▪ Locale Files: The “locales” directory provides internationalization support.
▪ MkDocs → Lantana Base Templates (HTML rendering).
▪ Lantana Base Templates → Call to Extension Modules (for dynamic content and features).
▪ Static Asset Delivery (CSS/JS) supporting rendered pages.
- Build & Deployment Infrastructure:
- Scripts and configuration files (in “script/”, setup.py, GitHub workflows) manage package building, testing, and deployment.

##### Architectural Patterns and Principles
- Separation of Concerns:
- The theme separates visual layout (templates and CSS/JS assets) from functionality (Python extension modules).
- Modularity:
- Each extension (accordion, alerts, etc.) is modular—allowing users to enable or disable components as needed.
- Configuration Driven:
- MkDocs uses the mkdocs.yml file to drive the build process, making it clear how the theme integrates into the documentation build pipeline.
- Internationalization:
- The “locales” folder shows that language support is built in.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["MkDocs Build Process/Configuration"]:::config

    subgraph "Lantana Theme Package"
        subgraph "Templates & Views"
            T1["Base Template"]:::template
            T2["Nav Template"]:::template
            T3["Main Template"]:::template
            T4["After Header Template"]:::template
            T5["Before Header Template"]:::template
            T6["Breadcrumb Template"]:::template
            T7["Jinja2 Components"]:::template
        end
        X["Extension Modules"]:::extension
        subgraph "Static Assets"
            S1["CSS Assets"]:::asset
            S2["JS Assets"]:::asset
        end
        L["Localization Files"]:::localization
    end

    D["Documentation & Tutorials"]:::doc

    subgraph "Build & CI/CD Infrastructure"
        B1["Build Scripts"]:::build
        B2["setup.py"]:::build
        B3["GitHub Workflows"]:::build
    end

    A -->|"uses"| T1
    T7 -->|"calls"| X
    T1 -->|"loads"| S1
    T1 -->|"loads"| S2
    B1 -->|"builds"| T1
    B1 -->|"builds"| X
    B2 -->|"packages"| L
    B3 -->|"deploys"| D

    click A "https://github.com/wsoft-ws/lantana/blob/master/mkdocs.yml"
    click T1 "https://github.com/wsoft-ws/lantana/blob/master/lantana/base.html"
    click T2 "https://github.com/wsoft-ws/lantana/blob/master/lantana/nav.html"
    click T3 "https://github.com/wsoft-ws/lantana/blob/master/lantana/main.html"
    click T4 "https://github.com/wsoft-ws/lantana/blob/master/lantana/after_header.html"
    click T5 "https://github.com/wsoft-ws/lantana/blob/master/lantana/before_header.html"
    click T6 "https://github.com/wsoft-ws/lantana/blob/master/lantana/breadcrumb.html"
    click T7 "https://github.com/wsoft-ws/lantana/blob/master/lantana/components/nav.html.j2"
    click X "https://github.com/wsoft-ws/lantana/tree/master/lantana/extensions"
    click S1 "https://github.com/wsoft-ws/lantana/tree/master/lantana/css"
    click S2 "https://github.com/wsoft-ws/lantana/blob/master/lantana/js/theme.js"
    click L "https://github.com/wsoft-ws/lantana/tree/master/lantana/locales"
    click D "https://github.com/wsoft-ws/lantana/tree/master/docs"
    click B1 "https://github.com/wsoft-ws/lantana/tree/master/script"
    click B2 "https://github.com/wsoft-ws/lantana/blob/master/setup.py"
    click B3 "https://github.com/wsoft-ws/lantana/tree/master/.github/workflows"

    classDef config fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef template fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef extension fill:#FFB6C1,stroke:#333,stroke-width:2px;
    classDef asset fill:#FFD700,stroke:#333,stroke-width:2px;
    classDef localization fill:#F08080,stroke:#333,stroke-width:2px;
    classDef doc fill:#E6E6FA,stroke:#333,stroke-width:2px;
    classDef build fill:#D3D3D3,stroke:#333,stroke-width:2px;
```
