From 5f39a0a6204b4ca1b21c7232c9fcc0067ef8ccfc Mon Sep 17 00:00:00 2001 From: alphasentaurii Date: Mon, 27 Jan 2025 14:00:19 -0500 Subject: [PATCH 1/5] added global nav, fix version name, update asdf link --- docs/_static/custom.css | 10 ++++++++++ docs/conf.py | 20 ++++++++++++++++++-- docs/index.rst | 7 ------- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/docs/_static/custom.css b/docs/_static/custom.css index 3b01e4b..a48f84d 100644 --- a/docs/_static/custom.css +++ b/docs/_static/custom.css @@ -41,3 +41,13 @@ div.highlight-python { div.highlight-python:active { width: 150% } + +/* Top Banner Navigation +-------------------------------------------------- */ +.announcement-content a { + padding-right: 1em; + } + +.announcement-content a:hover { + color: fuchsia; +} diff --git a/docs/conf.py b/docs/conf.py index e0632aa..e2097d9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -31,6 +31,7 @@ copyright = f"{datetime.datetime.now().year}, {author}" release = get_distribution(configuration["name"]).version +# The short X.Y version version = ".".join(release.split(".")[:2]) # If your documentation needs a minimal Sphinx version, state it here. @@ -44,7 +45,7 @@ # main project "asdf-website": ("https://www.asdf-format.org/en/latest", None), # other subprojects - "asdf": ("https://asdf.readthedocs.io/en/latest/", None), + "asdf": ("https://www.asdf-format.org/projects/asdf/en/latest/", None), "asdf-standard": ("https://asdf-standard.readthedocs.io/en/latest/", None), "asdf-transform-schemas": ("https://www.asdf-format.org/projects/asdf-transform-schemas/en/latest/", None), "asdf-wcs-schemas": ("https://www.asdf-format.org/projects/asdf-wcs-schemas/en/latest/", None), @@ -52,6 +53,17 @@ intersphinx_mapping.update(subprojects) # noqa +# Adds a global navigation in the topbar - consistent across subprojects +globalnavlinks = { + "Projects": "https://www.asdf-format.org", + "Tutorials": "https://www.asdf-format.org/en/latest/tutorials/index.html", + "Community": "https://www.asdf-format.org/en/latest/community/index.html", + "Installation": "https://www.asdf-format.org/en/latest/applications/index.html", +} +topbanner = "" +for text, link in globalnavlinks.items(): + topbanner += f"{text}" + # To perform a Sphinx version check that needs to be more specific than # major.minor, call `check_sphinx_version("x.y.z")` here. # check_sphinx_version("1.2.1") @@ -98,6 +110,7 @@ html_theme_options = { "light_logo": "images/logo-light-mode.png", "dark_logo": "images/logo-dark-mode.png", + "announcement": topbanner, } pygments_style = "monokai" @@ -111,7 +124,7 @@ # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". -html_title = f"{project} v{release}" +html_title = f"{project.replace('_', ' ')} v{version}" # Output file base name for HTML help builder. htmlhelp_basename = project + "doc" @@ -158,3 +171,6 @@ def setup(app): asdf_schema_path = "../resources" # This is the prefix common to all schema IDs in this repository asdf_schema_standard_prefix = "schemas" + +def setup(app): + app.add_css_file("custom.css") diff --git a/docs/index.rst b/docs/index.rst index 72276dd..3bd2c49 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -42,10 +42,3 @@ Developer Resources contributing.rst changes.rst - -Index -===== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` From a3a7107136c0540b55d0ade5fc6d349f09bcce63 Mon Sep 17 00:00:00 2001 From: alphasentaurii Date: Mon, 3 Feb 2025 12:24:46 -0500 Subject: [PATCH 2/5] update asdf subproject url --- docs/conf.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index e2097d9..b8ab97f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -45,7 +45,7 @@ # main project "asdf-website": ("https://www.asdf-format.org/en/latest", None), # other subprojects - "asdf": ("https://www.asdf-format.org/projects/asdf/en/latest/", None), + "asdf": ("https://www.asdf-format.org/projects/asdf/en/stable/", None), "asdf-standard": ("https://asdf-standard.readthedocs.io/en/latest/", None), "asdf-transform-schemas": ("https://www.asdf-format.org/projects/asdf-transform-schemas/en/latest/", None), "asdf-wcs-schemas": ("https://www.asdf-format.org/projects/asdf-wcs-schemas/en/latest/", None), @@ -55,10 +55,9 @@ # Adds a global navigation in the topbar - consistent across subprojects globalnavlinks = { - "Projects": "https://www.asdf-format.org", + "ASDF Projects": "https://www.asdf-format.org", "Tutorials": "https://www.asdf-format.org/en/latest/tutorials/index.html", "Community": "https://www.asdf-format.org/en/latest/community/index.html", - "Installation": "https://www.asdf-format.org/en/latest/applications/index.html", } topbanner = "" for text, link in globalnavlinks.items(): @@ -94,7 +93,6 @@ # a list of builtin themes. To override the custom theme, set this to the # name of a builtin theme or the name of a custom theme in html_theme_path. html_theme = "furo" -html_theme_options = {} html_static_path = ["_static"] From 5511bfd2b43768005295d5eeb0885531739ffb96 Mon Sep 17 00:00:00 2001 From: alphasentaurii Date: Mon, 3 Feb 2025 13:16:49 -0500 Subject: [PATCH 3/5] hide dev release suffix --- docs/conf.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index b8ab97f..3b10687 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -122,7 +122,7 @@ # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". -html_title = f"{project.replace('_', ' ')} v{version}" +html_title = f"{project.replace('_', ' ')} v{'.'.join(release.split('.')[:3])}" # Output file base name for HTML help builder. htmlhelp_basename = project + "doc" @@ -159,10 +159,6 @@ extensions += ["sphinx_asdf", "sphinx.ext.intersphinx", "sphinx.ext.extlinks"] # noqa -def setup(app): - app.add_css_file("custom.css") - - # -- sphinx_asdf configuration --------------------------------------------- # Top-level directory containing ASDF schemas (relative to current directory) @@ -170,5 +166,6 @@ def setup(app): # This is the prefix common to all schema IDs in this repository asdf_schema_standard_prefix = "schemas" + def setup(app): app.add_css_file("custom.css") From 78adf86e6aa84034347ea44c019a700f86dcad08 Mon Sep 17 00:00:00 2001 From: alphasentaurii Date: Mon, 3 Feb 2025 13:19:39 -0500 Subject: [PATCH 4/5] revert html title change --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 3b10687..3d7d55c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -122,7 +122,7 @@ # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". -html_title = f"{project.replace('_', ' ')} v{'.'.join(release.split('.')[:3])}" +html_title = f"{project.replace('_', ' ')} v{release}" # Output file base name for HTML help builder. htmlhelp_basename = project + "doc" From a52a3e469f68fce906b30ca2b7e693d1879b9da0 Mon Sep 17 00:00:00 2001 From: alphasentaurii Date: Mon, 3 Feb 2025 13:21:28 -0500 Subject: [PATCH 5/5] update changelog --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index fbbe92f..2a1401c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -3,6 +3,7 @@ - Changes documentation configuration settings to make this consistent with other asdf-related projects [#61] - Fix typo in latex logo path [#62] +- Adds global navigation in docs top bar [#63] 0.3.0 (2024-03-09) ------------------