Skip to content
Open
Show file tree
Hide file tree
Changes from 9 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 doc/changelog.d/798.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cleanup \`\`js\`\`
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
<div id="announcement_msg"></div>

<!--
Announcement Version Loader
Dynamically loads the announcement.html content into the announcement_msg div.
-->
<div id="announcement_msg" aria-live="polite"></div>
<script>
// Fetch and inject the announcement HTML content
fetch("announcement.html")
.then((response) => {
if (response.status === 404) {
// No announcement available, leave empty and do not log error
return "";
}
if (!response.ok) {
throw new Error(`HTTP error: ${response.status}`);
}
return response.text();
})
.then(
(text) => (document.getElementById("announcement_msg").innerHTML = text),
)
.catch((error) => console.error(`Fetch problem: ${error.message}`));
.then((text) => {
var msgDiv = document.getElementById("announcement_msg");
if (msgDiv) {
msgDiv.innerHTML = text;
}
})
.catch((error) => {
// Log only unexpected fetch errors
if (!(error.message && error.message.startsWith("HTTP error: 404"))) {
console.error(`Fetch problem: ${error.message}`);
}
});
</script>
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@

{#
Cheatsheet Sidebar
Displays a cheatsheet link and thumbnail in the sidebar if configured.
Uses <div> for compatibility as requested.
#}
{% if theme_cheatsheet %}
{% set theme_cheatsheet_title = theme_cheatsheet.get('title', 'Cheatsheet') %}
<div class="sidebar-cheatsheets">
{% set theme_cheatsheet_output_dir = theme_cheatsheet.get('output_dir') %}
{% set theme_cheatsheet_thumbnail = theme_cheatsheet.get('thumbnail') %}
{% set theme_cheatsheet_output = pathto(theme_cheatsheet_output_dir, 1) %}
{% set theme_cheatsheet_thumbnail = pathto(theme_cheatsheet_thumbnail, 1) %}
<div class="sidebar-cheatsheets" aria-label="Cheatsheet">
<h4>{{ theme_cheatsheet_title }}</h4>
{% set theme_cheatsheet_output_dir = theme_cheatsheet.get('output_dir') %}
{% set theme_cheatsheet_thumbnail = theme_cheatsheet.get('thumbnail') %}
{% set theme_cheatsheet_output = pathto(theme_cheatsheet_output_dir, 1) %}
{% set theme_cheatsheet_thumbnail = pathto(theme_cheatsheet_thumbnail, 1) %}
<a href="{{ theme_cheatsheet_output }}">
<img src="{{ theme_cheatsheet_thumbnail }}" alt="{{ theme_cheatsheet_title }}" />
<a href="{{ theme_cheatsheet_output }}" target="_blank" rel="noopener noreferrer">
<img src="{{ theme_cheatsheet_thumbnail }}" alt="{{ theme_cheatsheet_title }} thumbnail" loading="lazy" />
</a>
</div>
{% endif %}
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
{% if sourcename is defined and theme_use_edit_page_button==true and
page_source_suffix %} {% set src = sourcename.split('.') %}
<div class="tocsection editthispage">
<a href="{{ fix_edit_link_page(get_edit_provider_and_url()[1]) }}">
<i class="fa-solid fa-pencil"></i>
{% set provider = get_edit_provider_and_url()[0] %} {% block
edit_this_page_text %} {% if provider %} {% trans provider=provider %}Edit
on {{ provider }}{% endtrans %} {% else %} {% trans %}Edit{% endtrans %} {%
endif %} {% endblock %}
</a>
</div>

{#
Edit This Page Button
Shows a button to edit the current page on the documentation's source provider.
Falls back to the PyData theme's button if not available.
#}
{% if sourcename is defined and theme_use_edit_page_button==true and page_source_suffix %}
{% set src = sourcename.split('.') %}
<nav class="tocsection editthispage" aria-label="Edit this page">
<a href="{{ fix_edit_link_page(get_edit_provider_and_url()[1]) }}" rel="noopener noreferrer">
<i class="fa-solid fa-pencil" aria-hidden="true"></i>
{% set provider = get_edit_provider_and_url()[0] %}
{% block edit_this_page_text %}
{% if provider %}
{% trans provider=provider %}Edit on {{ provider }}{% endtrans %}
{% else %}
{% trans %}Edit{% endtrans %}
{% endif %}
{% endblock %}
</a>
</nav>
{% else %}
<!-- If there is no fix edit button function, use the PyData edit-this-button-->
{%- include "pydata_sphinx_theme/components/edit-this-page.html" -%} {% endif %}
{# Fallback: Use the PyData theme's edit-this-page button #}
{%- include "pydata_sphinx_theme/components/edit-this-page.html" -%}
{% endif %}
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
<p class="theme-version">
{% 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 %} <br />Last updated on
<span id="ast_build_date"></span>
</p>

<!--
Theme Version Footer
Displays the Sphinx theme version and the last updated date.
Accessibility and semantic improvements included.
-->
<footer class="theme-version" aria-label="Theme version and last update">
<span>
{% trans theme_version=ansys_sphinx_theme_version|e %}
Built with the
<a href="https://sphinxdocs.ansys.com/version/stable/index.html" target="_blank" rel="noopener noreferrer">
Ansys Sphinx Theme
</a>
{{ ansys_sphinx_theme_version }}.
{% endtrans %}
</span>
<br />
<span>Last updated on <time id="ast_build_date"></time></span>
</footer>
<script>
var options = { day: "numeric", month: "long", year: "numeric" };
var ast_lastModifiedDate = new Date(document.lastModified);
var ast_build_date = ast_lastModifiedDate.toLocaleDateString("en-US", options);
document.getElementById("ast_build_date").innerHTML = ast_build_date;
// Set the last updated date in a readable format
(function() {
var options = { day: "numeric", month: "long", year: "numeric" };
var ast_lastModifiedDate = new Date(document.lastModified);
var ast_build_date = ast_lastModifiedDate.toLocaleDateString("en-US", options);
var dateElem = document.getElementById("ast_build_date");
if (dateElem) {
dateElem.textContent = ast_build_date;
}
})();
</script>
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
{% if whatsnew %}
<div class="whatsnew-sidebar">
<ul>
{% for whatsnew in whatsnew %}
{% set title = whatsnew.get('title') %}
{% set url = whatsnew.get('url') %}
{% set title_url = whatsnew.get('title_url') %}
{% set children = whatsnew.get('children') %}
<h2><strong><a href="{{ title_url }}">{{ title }}</a></strong></h2> <!-- Display title as a link -->
<!-- current link -->
<ui>
<!-- child element is dictionary -->
{% for child in children %}
<li><a href="{{ url }}">{{ child }}</a></li> <!-- Display child element as a link -->
{% endfor %}
</ui>
{% endfor %}
</ul>
</div>
<!-- add style file -->
<link rel="stylesheet" href="{{ pathto('_static/css/whatsnew.css', 1) }}">
<ul>
{% for whatsnew in whatsnew %}
{% set title = whatsnew.get('title') %}
{% set url = whatsnew.get('url') %}
{% set title_url = whatsnew.get('title_url') %}
{% set children = whatsnew.get('children') %}
<h2>
<strong>
<a href="{{ title_url }}">{{ title }}</a>
</strong>
</h2>
<!-- current link -->
<ui>
<!-- child element is dictionary -->
{% for child in children %}
<li><a href="{{ url }}">{{ child }}</a></li> <!-- Display child element as a link -->
{% endfor %}
</ui>
{% endfor %}
</ul>
</div>

<!-- add style file -->
<link rel="stylesheet" href="{{ pathto('_static/css/whatsnew.css', 1) }}">

{% endif %}
Loading
Loading