Pi66

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

← back to log

feat: add advanced markdown extensions

author: pi66
date: 2026-06-27 00:16
hash: 98bc72e1b9e6573f91e1977f5d5c1195a03f57fc

Diffstat:

M

pyproject.toml
1 ++

M

src/build.py
20 ++++++++++++++++++++++--------
 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
diff --git a/pyproject.toml b/pyproject.toml
index e02f737..a7777c8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -10,6 +10,7 @@ dependencies = [
     "pywebview",
     "watchdog",
    "PyGObject",
+   "pymdown-extensions",
 ]

 [project.scripts]
diff --git a/src/build.py b/src/build.py
index 49dec37..ee1c8db 100644
--- a/src/build.py
+++ b/src/build.py
@@ -68,11 +68,21 @@ def compile_md_to_html(md_file:str, html_dest:str, config =None):
     md_content = read_file(md_file)
     raw_html_content = markdown(
         md_content,
-        extensions=[
-            "extra",
-            "toc",
-            "codehilite",
-        ]
+extensions = [
+    "extra",
+    "pymdownx.highlight",
+    "pymdownx.inlinehilite",
+    "pymdownx.superfences",
+    "pymdownx.tilde",
+    "pymdownx.mark",
+    "pymdownx.betterem",
+    "pymdownx.magiclink",
+    "pymdownx.keys",
+    "pymdownx.arithmatex",
+    "pymdownx.details",
+    "pymdownx.tabbed",
+    "pymdownx.critic",
+]
     )
     filtered_html = html_filter(raw_html_content)
     html_content = jinja_handler(md_file, filtered_html, config)