summaryrefslogtreecommitdiff
path: root/docs/conf.py
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-07-02 18:18:52 +0700
committerhathach <[email protected]>2025-07-02 18:18:52 +0700
commitcf3966efd9fc552d641ea1e76e5aaad3ace3afd2 (patch)
treed59add439dcbfcd6e2cd9fec9aaecc413e5b5509 /docs/conf.py
parentf10467e711017fb05a6e0ee496e451e2e8834549 (diff)
parent963971c6aa14411f0cc6f0c4f727d199c738e2a5 (diff)
Merge branch 'master' into fork/HiFiPhile/dcd_notif
Diffstat (limited to 'docs/conf.py')
-rwxr-xr-xdocs/conf.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/docs/conf.py b/docs/conf.py
index af44b7339..4249d41f7 100755
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -5,13 +5,16 @@
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
+import re
+from pathlib import Path
+
# -- Path setup --------------------------------------------------------------
# -- Project information -----------------------------------------------------
project = 'TinyUSB'
-copyright = '2021, Ha Thach'
+copyright = '2024, Ha Thach'
author = 'Ha Thach'
@@ -40,3 +43,16 @@ html_theme_options = {
}
todo_include_todos = True
+
+# pre-process path in README.rst
+def preprocess_readme():
+ """Modify figure paths in README.rst for Sphinx builds."""
+ src = Path(__file__).parent.parent / "README.rst"
+ tgt = Path(__file__).parent.parent / "README_processed.rst"
+ if src.exists():
+ content = src.read_text()
+ content = re.sub(r"docs/", r"", content)
+ content = re.sub(r".rst", r".html", content)
+ tgt.write_text(content)
+
+preprocess_readme()