Skip to content

Commit edce8d3

Browse files
ver: bump version 0.9.8
1 parent b535bf0 commit edce8d3

File tree

4 files changed

+43
-5
lines changed

4 files changed

+43
-5
lines changed

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ classifiers = [
2525
"Programming Language :: Python :: 3",
2626
]
2727
dependencies = [
28-
"Sphinx>=4.2.0,<6",
28+
"Sphinx>=4.2.0",
2929
"pydata-sphinx-theme==0.13.3",
3030
"Jinja2>=3.1.2",
3131
]
3232

3333
[project.optional-dependencies]
3434
doc = [
3535
"numpydoc==1.5.0",
36-
"Sphinx==5.3.0",
37-
"sphinx-copybutton==0.5.1",
36+
"Sphinx==6.1.3",
37+
"sphinx-copybutton==0.5.2",
3838
"sphinx-notfound-page==0.8.3",
3939
"sphinx-design==0.3.0",
4040
"bs4==0.0.1",

src/ansys_sphinx_theme/__init__.py

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
"""This is the ansys-sphinx-theme module."""
22
import pathlib
3-
from typing import Dict
3+
from typing import Any, Dict
44

5+
from docutils.nodes import document
56
from sphinx.application import Sphinx
67

78
from ansys_sphinx_theme.latex import generate_404 # noqa: F401
89

9-
__version__ = "0.9.7"
10+
__version__ = "0.9.8"
1011

1112
# Declare the fundamental paths of the theme
1213
THIS_PATH = pathlib.Path(__file__).parent.resolve()
@@ -84,6 +85,31 @@ def setup_default_html_theme_options(app):
8485
app.config.html_theme_options.setdefault("collapse_navigation", True)
8586

8687

88+
def update_footer_theme(
89+
app: Sphinx, pagename: str, templatename: str, context: Dict[str, Any], doctree: document
90+
) -> None:
91+
"""Update the version number of the Ansys Sphinx theme in the footer.
92+
93+
Connect to the Sphinx application instance for rendering the documentation,
94+
and add the current version number of the Ansys Sphinx theme to the page context.
95+
This allows the theme to update the footer with the current version number.
96+
97+
Parameters
98+
----------
99+
app : ~sphinx.application.Sphinx
100+
Application instance for rendering the documentation.
101+
pagename : str
102+
The name of the current page.
103+
templatename : str
104+
The name of the template being used.
105+
context : dict
106+
The context dictionary for the page.
107+
doctree : ~docutils.nodes.document
108+
The document tree for the page.
109+
"""
110+
context["ansys_sphinx_theme_version"] = __version__
111+
112+
87113
def setup(app: Sphinx) -> Dict:
88114
"""Connect to the sphinx theme app.
89115
@@ -113,6 +139,7 @@ def setup(app: Sphinx) -> Dict:
113139
app.add_js_file(str(JS_FILE.relative_to(STATIC_PATH)))
114140
app.add_js_file("https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js")
115141
app.add_css_file("https://cdn.datatables.net/1.10.23/css/jquery.dataTables.min.css")
142+
app.connect("html-page-context", update_footer_theme)
116143
# Add templates for autosummary
117144
app.config.templates_path.append(str(TEMPLATES_PATH))
118145

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<p class="theme-version">
2+
{% trans theme_version=ansys_sphinx_theme_version|e %}Built with the <a href="https://sphinxdocs.ansys.com/version/stable/index.html">Ansys Sphinx Theme</a> {{ ansys_sphinx_theme_version }}.{% endtrans %}
3+
<br>Last updated on <span id="date"></span></br>
4+
</p>
5+
<script>
6+
var options = { day: 'numeric', month: 'long', year: 'numeric' };
7+
var lastModifiedDate = new Date(document.lastModified);
8+
var date = lastModifiedDate.toLocaleDateString('en-US', options);
9+
document.getElementById("date").innerHTML = date;
10+
</script>

src/ansys_sphinx_theme/theme/ansys_sphinx_theme/theme.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ use_edit_page_button = True
1414
switcher =
1515
use_meilisearch =
1616
article_header_start =
17+
footer_end = theme-version.html

0 commit comments

Comments
 (0)