Skip to content

Merge main into feature-focus #1586

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

Merged
merged 18 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "pyproject.toml"
# waiting for https://github.com/nikeee/setup-pandoc/pull/8
# using 12rambau fork until then
- uses: 12rambau/setup-pandoc@test
- name: Install dependencies
# if Sphinx version not specified in matrix, the constraints in the
# pyproject.toml file determine Sphinx version
Expand Down
4 changes: 2 additions & 2 deletions docs/_static/switcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"url": "https://pydata-sphinx-theme.readthedocs.io/en/latest/"
},
{
"name": "0.14.3 (stable)",
"version": "v0.14.3",
"name": "0.14.4 (stable)",
"version": "v0.14.4",
"url": "https://pydata-sphinx-theme.readthedocs.io/en/stable/",
"preferred": true
},
Expand Down
2 changes: 1 addition & 1 deletion src/pydata_sphinx_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from . import edit_this_page, logo, pygment, short_link, toctree, translator, utils

__version__ = "0.14.4dev0"
__version__ = "0.14.5dev0"


def update_config(app):
Expand Down
32 changes: 15 additions & 17 deletions src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ var addEventListenerForSearchKeyboard = () => {
!event.shiftKey &&
!event.altKey &&
// On Mac use ⌘, all other OS use Ctrl
(isMac
(useCommandKey
? event.metaKey && !event.ctrlKey
: !event.metaKey && event.ctrlKey) &&
// Case-insensitive so the shortcut still works with caps lock
Expand All @@ -260,28 +260,23 @@ var addEventListenerForSearchKeyboard = () => {
};

/**
* Find out if we're on a Mac
* If the user is on a Mac, use command (⌘) instead of control (ctrl) key
*
* Note: `navigator.platform` is deprecated; however MDN still recommends using
* it for the one specific use case of detecting whether a keyboard shortcut
* should use control or command:
* https://developer.mozilla.org/en-US/docs/Web/API/Navigator/platform#examples
*/
var isMac = (navigator) => {
var platform = "";
if (
typeof navigator.userAgentData !== "undefined" &&
navigator.userAgentData != null
) {
platform = navigator.userAgentData.platform;
} else if (typeof navigator.platform !== "undefined") {
platform = navigator.platform;
}
return /mac.?os/.test(platform.toLowerCase());
};
var useCommandKey =
navigator.platform.indexOf("Mac") === 0 || navigator.platform === "iPhone";

/**
* Change the search hint to `meta key` if we are a Mac
*/

var changeSearchShortcutKey = () => {
let shortcuts = document.querySelectorAll(".search-button__kbd-shortcut");
if (isMac(window.navigator)) {
if (useCommandKey) {
shortcuts.forEach(
(f) => (f.querySelector("kbd.kbd-shortcut__modifier").innerText = "⌘")
);
Expand Down Expand Up @@ -473,7 +468,9 @@ function showVersionWarningBanner(data) {
return;
}
// now construct the warning banner
var outer = document.createElement("div");
var outer = document.createElement("aside");
// TODO: add to translatable strings
outer.setAttribute("aria-label", "Version warning");
const middle = document.createElement("div");
const inner = document.createElement("div");
const bold = document.createElement("strong");
Expand Down Expand Up @@ -509,7 +506,8 @@ function showVersionWarningBanner(data) {
inner.appendChild(bold);
inner.appendChild(document.createTextNode("."));
inner.appendChild(button);
document.body.prepend(outer);
const skipLink = document.getElementById("pst-skip-link");
skipLink.after(outer);
}

/*******************************************************************************
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
~ ul {
display: none;
}
~ label i {
~ label .fa-chevron-down {
transform: rotate(0deg);
}
}
.toctree-checkbox:checked {
~ ul {
display: block;
}
~ label i {
~ label .fa-chevron-down {
transform: rotate(180deg);
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/pydata_sphinx_theme/assets/styles/content/_api.scss
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ span.highlighted {
// the API selector
// from https://github.com/pradyunsg/furo/blob/main/src/furo/assets/styles/content/_api.sass#L6)
dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) {
//increase margin bottom after the dl elements
margin-bottom: 3rem;

dd {
margin-left: 2rem;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{# Displays links to the Sphinx-generated indices (genindex, modindex, py-modindex). #}
<nav class="sidebar-indices-items">
<p class="sidebar-indices-items__title" role="heading" aria-level="1">{{ _("Indices") }}</p>
{%- set indices_navigation_heading_id = unique_html_id("pst-indices-navigation-heading") -%}
<nav class="sidebar-indices-items" aria-labelledby="{{ indices_navigation_heading_id }}">
<p id="{{ indices_navigation_heading_id }}" class="sidebar-indices-items__title" role="heading" aria-level="1">{{ _("Indices") }}</p>
<ul class="indices-link">
{%- for rellink in rellinks %}
{%- if rellink[0] == 'genindex' %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{# Displays the current page's Table of Contents. #}
{% set page_toc = generate_toc_html() %}
{%- if page_toc | length >= 1 %}
<div class="page-toc tocsection onthispage">
{%- set page_navigation_heading_id = unique_html_id("pst-page-navigation-heading") -%}
<div
id="{{ page_navigation_heading_id }}"
class="page-toc tocsection onthispage">
<i class="fa-solid fa-list"></i> {{ _("On this page") }}
</div>
<nav class="bd-toc-nav page-toc">
<nav class="bd-toc-nav page-toc" aria-labelledby="{{ page_navigation_heading_id }}">
{{ page_toc }}
</nav>
{%- endif %}
12 changes: 8 additions & 4 deletions src/pydata_sphinx_theme/theme/pydata_sphinx_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

{# A button hidden by default to help assistive devices quickly jump to main content #}
{# ref: https://www.youtube.com/watch?v=VUR0I5mqq7I #}
<div class="skip-link"><a href="#main-content">{{ _("Skip to main content") }}</a></div>
<div id="pst-skip-link" class="skip-link"><a href="#main-content">{{ _("Skip to main content") }}</a></div>

{%- endblock %}

Expand Down Expand Up @@ -81,14 +81,18 @@
<div class="search-button__overlay"></div>
<div class="search-button__search-container">{% include "../components/search-field.html" %}</div>
</div>

<header>
{%- if theme_announcement -%}
{% include "sections/announcement.html" %}
{%- endif %}
{% block docs_navbar %}
<nav class="bd-header navbar navbar-expand-lg bd-navbar">
<div class="bd-header navbar navbar-expand-lg bd-navbar">
{%- include "sections/header.html" %}
</nav>
</div>
{% endblock docs_navbar %}
</header>

<div class="bd-container">
<div class="bd-container__inner bd-page-width">
{# Primary sidebar #}
Expand All @@ -107,7 +111,7 @@
{% block docs_body %}
{# This is empty and only shows up if text has been highlighted by the URL #}
{% include "components/searchbox.html" %}
<article class="bd-article" role="main">
<article class="bd-article">
{% block body %}{% endblock %}
</article>
{% endblock docs_body %}
Expand Down