From a9fc94aab4af4262e44e931ad5598005c4b4395a Mon Sep 17 00:00:00 2001 From: Peter Corke Date: Thu, 3 Sep 2026 19:54:13 +0200 Subject: [PATCH] Match ecosystem-wide Sphinx doc footer convention Per rvc-ecosystem AGENTS.md section 5: footer left side reads exactly "Copyright (c) 20xx-present, Peter Corke: built YYYY-MM-DD", right side is a smaller-font GitHub link back to the repo. Copies bdsim's reference implementation (2026-08-16), the pair this convention was established with: - docs/source/_templates/footer.html: overrides sphinx_rtd_theme's default footer (which reads "(c) Copyright ... Last updated on DD-Mon-YYYY") with the exact left-side text, plus the GitHub link. - docs/source/_static/custom.css: flexbox on the footer's contentinfo div so the GitHub link actually renders on the right -- a plain tag with no CSS just falls inline below the copyright line. Also fixes conf.py to match: copyright was "2020, Peter Corke" (no "-present"), and html_last_updated_fmt was "%d-%b-%Y" instead of "%Y-%m-%d" (the format the new footer template actually expects). As a side effect this also resolves a pre-existing, unrelated build warning: html_static_path already listed "_static" in conf.py, but the directory didn't exist on disk, so every build warned "html_ static_path entry '_static' does not exist" -- creating the directory for custom.css fixes that too. Verified: real Sphinx build renders the exact expected footer text ("Copyright (c) 2020-present, Peter Corke: built 2026-09-03.") with the GitHub link correctly positioned via the loaded custom.css. Co-Authored-By: Claude Sonnet 5 --- docs/source/_static/custom.css | 15 +++++++++++++++ docs/source/_templates/footer.html | 13 +++++++++++++ docs/source/conf.py | 5 +++-- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 docs/source/_static/custom.css create mode 100644 docs/source/_templates/footer.html diff --git a/docs/source/_static/custom.css b/docs/source/_static/custom.css new file mode 100644 index 00000000..c246b87a --- /dev/null +++ b/docs/source/_static/custom.css @@ -0,0 +1,15 @@ +/* Footer layout: copyright on the left, GitHub link on the right in smaller font. */ +div[role="contentinfo"] { + display: flex; + justify-content: space-between; + align-items: baseline; + flex-wrap: wrap; +} + +div[role="contentinfo"] p { + margin: 0; +} + +.footer-github-link { + font-size: 0.85em; +} diff --git a/docs/source/_templates/footer.html b/docs/source/_templates/footer.html new file mode 100644 index 00000000..5c172270 --- /dev/null +++ b/docs/source/_templates/footer.html @@ -0,0 +1,13 @@ +{% extends "!footer.html" %} +{% block contentinfo %} +

+ {%- if show_copyright %} + {%- trans copyright=copyright|e %}Copyright © {{ copyright }}{% endtrans -%} + {%- endif %} + {%- if last_updated %} + {%- trans last_updated=last_updated|e %}: built {{ last_updated }}{% endtrans %} + {%- endif -%} + . +

+
GitHub +{% endblock %} diff --git a/docs/source/conf.py b/docs/source/conf.py index b258a3ba..1080d5d4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -19,7 +19,7 @@ # -- Project information ----------------------------------------------------- project = "Simple graph functionality for Python" -copyright = "2020, Peter Corke" +copyright = "2020-present, Peter Corke" author = "Peter Corke" @@ -80,10 +80,11 @@ # html_theme = "sphinx_rtd_theme" html_show_sourcelink = True -html_last_updated_fmt = "%d-%b-%Y" +html_last_updated_fmt = "%Y-%m-%d" show_authors = True # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] +html_css_files = ["custom.css"]