Pi66

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

← back to log

feat: add Extras dataclass and load_extras_config

author: pi66
date: 2026-06-27 11:37
hash: a58b305392c78f1d3f90a969e0db30eec286b0f7

Diffstat:

M

src/config.py
10 ++++++++++++++++++++++++++++++

M

src/modules.py
6 ++++++++++++++++++
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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