Pi66

Home | Repos | About | Blog | Gaza

merodi
A markdown-based static site generator.
git clone https://git.pi66.xyz/merodi

About | Files | Commits | Refs | License


feat: add Extras dataclass and load_extras_config

Author: pi66
Date: 2026-06-27 11:37
commit: a58b3053

Stat

A src/config.py 10 +10 -0
A src/modules.py 6 +6 -0

Diff

diff --git a/src/config.py b/src/config.py
index 7d5ccf3..bfa5fa8 100644
--- a/src/config.py
+++ b/src/config.py
@@ -51,6 +51,9 @@ host  = "{config.webview.host}"
 port  = {config.webview.port}
 html_path   = "{config.webview.html_path}"
 static_path = "{config.webview.static_path}"
+
+[extras]
+highlight = "{config.extras}"
 """

def find_project_from_path(project_path: str): @@ -101,3 +104,10 @@ def load_webview_config(project_path:str) -> Webview: html_path = config["webview"]["html_path"], static_path = config["webview"]["static_path"], ) + +def load_extras_config(project_path:str) -> Extras: ...

Show all

diff --git a/src/config.py b/src/config.py
index 7d5ccf3..bfa5fa8 100644
--- a/src/config.py
+++ b/src/config.py
@@ -51,6 +51,9 @@ host  = "{config.webview.host}"
 port  = {config.webview.port}
 html_path   = "{config.webview.html_path}"
 static_path = "{config.webview.static_path}"
+
+[extras]
+highlight = "{config.extras}"
 """

def find_project_from_path(project_path: str): @@ -101,3 +104,10 @@ def load_webview_config(project_path:str) -> Webview: html_path = config["webview"]["html_path"], static_path = config["webview"]["static_path"], ) + +def load_extras_config(project_path:str) -> Extras: + config_raw_content = read_file(path.join(project_path,"config.toml")) + config = loads(config_raw_content) + return Extras( + highlight = config["extras"]["highlight"], + ) diff --git a/src/modules.py b/src/modules.py index 52af1dd..1727055 100644 --- a/src/modules.py +++ b/src/modules.py @@ -20,8 +20,14 @@ class Webview: port : int html_path : str static_path : str + +@dataclass +class Extras: + highlight :str + @dataclass() class Config: project:Project tree:Tree webview:Webview + extras:Extras

// Created by Pi66

// Copyright ©Pi66 2026