diff options
| author | hathach <[email protected]> | 2024-12-27 17:14:03 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2024-12-27 17:48:45 +0700 |
| commit | de38e53271038d67812715a2086966ec84d6b540 (patch) | |
| tree | b953b303b8295fa3b0043288f24794c0e58937ca /docs/conf.py | |
| parent | 29f226c2fb09baa9b618a5bb7f390ff51882ae32 (diff) | |
update docs, remove uses.rst, structure.rst. Refactor docs, use README.rst for docs index.rst
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() |
