How syswraith/elanor works
Project type and purpose
• Elanor is a minimalistic, Python-based static site generator.
• It reads Markdown files and transforms them into HTML pages using a classless CSS template and theme definitions.
File-structure analysis
• Top-level
• main.py – CLI entry point and orchestrator
• requirements.txt – Python dependencies (e.g., Markdown parser, Pygments)
• assets/
• config.json & config.py – site configuration and override hooks
• template.html – HTML skeleton for every page
• themes.json – style definitions per theme
• content/ – source Markdown files (.md)
• generated/ – output HTML and CSS (pygments.css)
• .github/workflows/deploy.yml – CI/CD pipeline for GitHub Pages
Key components
a. CLI & Orchestrator (main.py)
b. Configuration Loader (config.py + config.json)
c. Content Reader (file-system watcher/loader for content/)
d. Markdown Parser (third-party library)
e. Template Engine (injects parsed HTML into template.html)
f. Theme Manager (reads themes.json, selects CSS rules)
g. Syntax Highlighter (Pygments → pygments.css)
h. Output Writer (writes to generated/)
i. Deployment Pipeline (GitHub Actions → GitHub Pages)
Relationships and data flow
1. User runs main.py (CLI)
2. Orchestrator loads site config via Configuration Loader
3. Content Reader scans content/*.md
4. For each file:
– Feed Markdown to Markdown Parser → HTML fragment
– Pass fragment + front-matter into Template Engine → full HTML page
– Apply Theme Manager to choose CSS rules; link to pygments.css from Syntax Highlighter
– Output Writer writes .html into generated/
5. Deployment Pipeline picks up generated/ and publishes to GitHub Pages
Architectural patterns and design principles
• Pipeline pattern: discrete stages (read → parse → render → write)
• Single-process, modular design: each component is a clear, replaceable module
• Extensibility via config.json, config.py hooks, and pluggable templates/themes