aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/scripts
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2026-01-26 10:44:51 +0800
committerGitHub <noreply@github.com>2026-01-26 10:44:51 +0800
commit73e7cf1a77003d88da8b70934698c49e362304ee (patch)
treea6e312bb98ef0f23c7612b67e1c2235c21c437e9 /scripts
downloadlora-template-73e7cf1a77003d88da8b70934698c49e362304ee.tar.gz
lora-template-73e7cf1a77003d88da8b70934698c49e362304ee.zip
Initial commit
Diffstat (limited to 'scripts')
-rw-r--r--scripts/hooks.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/hooks.py b/scripts/hooks.py
new file mode 100644
index 0000000..34c963e
--- /dev/null
+++ b/scripts/hooks.py
@@ -0,0 +1,10 @@
+import logging, re
+import mkdocs.plugins
+
+log = logging.getLogger('mkdocs')
+
+@mkdocs.plugins.event_priority(-50)
+def on_page_markdown(markdown, page, **kwargs):
+ path = page.file.src_uri
+ for m in re.finditer(r'\bhttp://[^) ]+', markdown):
+ log.warning(f"Documentation file '{path}' contains a non-HTTPS link: {m[0]}") \ No newline at end of file