Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs/theme-updates #1897

Merged
merged 13 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/1897.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
updates docs theme to be consistent with asdf subprojects
9 changes: 9 additions & 0 deletions docs/_static/css/globalnav.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* Top Banner Navigation
-------------------------------------------------- */
.announcement-content a {
padding-right: 1em;
}

.announcement-content a:hover {
color: fuchsia;
}
Binary file added docs/_static/images/favicon.ico
Binary file not shown.
Binary file added docs/_static/images/logo-dark-mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/images/logo-light-mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/_static/logo.ico
Binary file not shown.
Binary file removed docs/_static/logo.pdf
Binary file not shown.
Binary file removed docs/_static/logo.png
Binary file not shown.
76 changes: 73 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
# -- Project information ------------------------------------------------------
project = configuration["name"]
author = f"{configuration['authors'][0]['name']} <{configuration['authors'][0]['email']}>"
copyright = f"{datetime.datetime.now().year}, {configuration['authors'][0]['name']}"
copyright = f"{datetime.datetime.now().year}, {author}"

release = distribution(configuration["name"]).version
# for example take major/minor
version = ".".join(release.split(".")[:2])

# -- Options for HTML output ---------------------------------------------------
html_title = f"{project} v{release}"
html_title = f"{project} v{version}"

# Output file base name for HTML help builder.
htmlhelp_basename = project + "doc"
Expand Down Expand Up @@ -63,4 +63,74 @@
intersphinx_mapping["stdatamodels"] = ("https://stdatamodels.readthedocs.io/en/latest/", None)
intersphinx_mapping["pytest"] = ("https://docs.pytest.org/en/latest/", None)

extensions += ["sphinx_inline_tabs"]
# Docs are hosted as a "subproject" under the main project's domain: https://www.asdf-format.org/projects
# This requires including links to main project (asdf-website) and the other asdf subprojects
# See https://docs.readthedocs.io/en/stable/guides/intersphinx.html#using-intersphinx
subprojects = {
# main project
"asdf-website": ("https://www.asdf-format.org/en/latest", None),
# other subprojects
"asdf-standard": ("https://www.asdf-format.org/projects/asdf-standard/en/latest/", None),
"asdf-coordinates-schemas": ("https://www.asdf-format.org/projects/asdf-coordinates-schemas/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),
}

intersphinx_mapping.update(subprojects) # noqa: F405

extensions += ["sphinx_inline_tabs", "sphinx.ext.intersphinx", "sphinx.ext.extlinks"] # noqa: F405

html_theme = "furo"
html_static_path = ["_static"]
# Override default settings from sphinx_asdf / sphinx_astropy (incompatible with furo)
html_sidebars = {}
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
html_favicon = "_static/images/favicon.ico"
html_logo = ""

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"<a href={link}>{text}</a>"

html_theme_options = {
"light_logo": "images/logo-light-mode.png",
"dark_logo": "images/logo-dark-mode.png",
"announcement": topbanner,
}

pygments_style = "monokai"
# NB Dark style pygments is furo-specific at this time
pygments_dark_style = "monokai"
# Render inheritance diagrams in SVG
graphviz_output_format = "svg"

graphviz_dot_args = [
"-Nfontsize=10",
"-Nfontname=Helvetica Neue, Helvetica, Arial, sans-serif",
"-Efontsize=10",
"-Efontname=Helvetica Neue, Helvetica, Arial, sans-serif",
"-Gbgcolor=white",
"-Gfontsize=10",
"-Gfontname=Helvetica Neue, Helvetica, Arial, sans-serif",
]

# -- Options for LaTeX output --------------------------------------------------

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [("index", project + ".tex", project + " Documentation", author, "manual")]

latex_logo = "_static/images/logo-light-mode.png"


def setup(app):
app.add_css_file("css/globalnav.css")
1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,3 @@ Index

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
2 changes: 1 addition & 1 deletion docs/rtd_environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ dependencies:
- python=3.11
- pip
- graphviz
- sphinx_rtd_theme>1.2.0
- furo
- towncrier
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ docs = [
"graphviz",
"sphinx-inline-tabs",
'tomli; python_version < "3.11"',
"furo",
]
tests = [
"fsspec[http]>=2022.8.2",
Expand All @@ -49,7 +50,7 @@ tests = [
"pytest-remotedata",
]
[project.urls]
'documentation' = 'https://asdf.readthedocs.io/en/stable'
'documentation' = 'https://www.asdf-format.org/projects/asdf/en/latest'
'repository' = 'https://github.com/asdf-format/asdf'
'tracker' = 'https://github.com/asdf-format/asdf/issues'
[project.entry-points]
Expand Down
Loading