diff options
| author | hathach <[email protected]> | 2025-02-07 16:37:51 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2025-02-07 16:37:51 +0700 |
| commit | cd0ca4832d0247dea0457e791ffc071ceaf43bce (patch) | |
| tree | d7909fa3eb7fc1b33d7f7299c674e47cb81f1f19 /docs/conf.py | |
| parent | 5c4e4b1bc273b771411660e1b6fbe81c2e8fd90b (diff) | |
| parent | 2a3025eaa5ed59e49218eb5460b8831a76945cf2 (diff) | |
Merge branch 'refs/heads/master' into fork/jay94ks/styluspen
Diffstat (limited to 'docs/conf.py')
| -rwxr-xr-x | docs/conf.py | 18 |
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() |
