From 15d3031929b185aeb9448189c6762ad8c1fb7dc9 Mon Sep 17 00:00:00 2001 From: Simon Bowly Date: Fri, 15 Nov 2024 12:41:54 +1100 Subject: [PATCH] Adjust logo placement in docs (#94) - Use no-logo theme branch - Add footer icons - Tidy up conf.py --- docs/requirements.txt | 2 +- docs/source/conf.py | 59 ++++++++++++++++++++++--------------------- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 616c7e1..a991785 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,4 @@ -gurobi-sphinxtheme @ git+https://github.com/Gurobi/gurobi-sphinxtheme.git@main +gurobi-sphinxtheme @ git+https://github.com/Gurobi/gurobi-sphinxtheme.git@no-logo # Pinned packages for documentation builds # Note: upgrading nbconvert leads to formatting issues diff --git a/docs/source/conf.py b/docs/source/conf.py index 00ec346..9586eb4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -4,18 +4,14 @@ import gurobipy_pandas -# -- Project information ----------------------------------------------------- - - project = "gurobipy-pandas" author = "Gurobi Optimization, LLC" copyright = "Gurobi Optimization, LLC" -html_title = "gurobipy-pandas documentation" version = gurobipy_pandas.__version__ release = version -# -- General configuration --------------------------------------------------- +html_title = f"gurobipy-pandas documentation v{release}" extensions = [ "nbsphinx", @@ -63,8 +59,7 @@ "ghsrc": ("https://github.com/Gurobi/gurobipy-pandas/tree/main/%s", "%s"), } -# -- numpydoc magic linking - +# Add shorthand and keyword ignores for numpydoc numpydoc_xref_param_type = True numpydoc_xref_aliases = { "DataFrame": "pandas.DataFrame", @@ -74,12 +69,7 @@ numpydoc_xref_ignore = {"optional", "or", "of"} numpydoc_class_members_toctree = False -# -- Options for EPUB output - -epub_show_urls = "footnote" - -# -- Note pointing to notebook downloads - +# Add a note pointing to notebook downloads in notebook headers nbsphinx_prolog = """ .. note:: @@ -89,22 +79,8 @@ """ -# Customisation for Furo/gurobi-sphinxtheme - -html_sidebars = { - "**": [ - "sidebar/brand.html", - "sidebar/search.html", - "sidebar/scroll-start.html", - "sidebar/navigation.html", - "sidebar/scroll-end.html", - ], -} - -# Customisation for readthedocs - if os.environ.get("READTHEDOCS", "") == "True": - # Date needed by Furo theme to enable icons/links/etc + # Data needed by Furo theme to enable icons/links/etc html_context = { "READTHEDOCS": True, "github_user": "Gurobi", @@ -114,7 +90,32 @@ "conf_py_path": "/docs/source/", } - # Set the canonical URL to point to the stable version docs + # Set the canonical URL to always point to the stable version docs rtd_version = os.environ.get("READTHEDOCS_VERSION") rtd_url = os.environ.get("READTHEDOCS_CANONICAL_URL") html_baseurl = rtd_url.replace(rtd_version, "stable") + + +html_theme_options = { + # Add Gurobi and Github icons to the footer + "footer_icons": [ + { + "name": "GitHub", + "url": "https://www.gurobi.com", + "html": """ + + """, + "class": "", + }, + { + "name": "GitHub", + "url": "https://github.com/Gurobi/gurobipy-pandas", + "html": """ + + + + """, + "class": "", + }, + ], +}