Skip to content
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
4 changes: 1 addition & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,8 @@ jobs:
# ensuring proper scaping of the variable
docs_dir="${DOCS_DIR}"
mkdir -p $docs_dir/site
cp -r docs/examples/kitchen-sink $docs_dir/site/kitchen-sink
printf "Test\n====\n\n.. toctree::\n\n kitchen-sink/index\n" > $docs_dir/site/index.rst
Comment on lines -104 to -105
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting that this was working without any globbing before.
Good catch tho.

cp -r docs/examples/kitchen-sink/* $docs_dir/site/
echo 'html_theme = "pydata_sphinx_theme"' > $docs_dir/site/conf.py
echo '.. toctree::\n :glob:\n\n *' >> $docs_dir/site/index.rst

# build docs without checking for warnings
python -Im tox run -e docs-no-checks
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/lighthouserc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"ci": {
"collect": {
"staticDistDir": "./audit/_build/kitchen-sink/",
"staticDistDir": "./audit/_build/",
"autodiscoverUrlBlocklist": [
"/genindex.html",
"/search.html",
"/_static/webpack-macros.html"
],
"settings": {
"skipAudits": ["canonical"]
}
Expand Down
2 changes: 1 addition & 1 deletion docs/community/inspiration.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ When making new decisions about design and UI/UX, we often consult these themes
image: ../_static/inspiration/docker-mark-blue.svg
- title: "**PyTorch**"
link: https://pytorch.org/docs/stable/index.html
image: https://pytorch.org/assets/images/pytorch-logo.png
image: https://docs.pytorch.org/docs/stable/_static/images/logo-dark.svg
- title: "**Docasaurus**"
link: https://docusaurus.io/docs
image: https://d33wubrfki0l68.cloudfront.net/c088b7acfcf11100903c44fe44f2f2d7e0f30531/47727/img/docusaurus.svg
Expand Down
2 changes: 0 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,6 @@ def setup(app: Sphinx) -> Dict[str, Any]:
# The crawler gets "Anchor not found" for various anchors
r"https://github.com.+?#.*",
r"https://www.sphinx-doc.org/en/master/*/.+?#.+?",
# Known broken links in kitchen sink
r"https://source.unsplash.com/.+",
# sample urls
"http://someurl/release-0.1.0.tar-gz",
"http://python.py",
Expand Down
7 changes: 7 additions & 0 deletions src/pydata_sphinx_theme/assets/styles/abstracts/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
color: var(--pst-color-table);
border: 1px solid var(--pst-color-table-outer-border);

// Our tables are zebra striped: header rows and odd-numbered rows have an
// off-white background, or off-black in dark mode. So they require a
// higher contrast link color.
a {
color: var(--pst-color-link-higher-contrast);
}

th,
td {
~ th,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ div.versionremoved {
margin-bottom: 0.6rem;
margin-top: 0.6rem;
}

// fix color contrast failures (accessibility)
a {
color: var(--pst-color-link-higher-contrast);
}
}

div.versionadded {
Expand All @@ -33,6 +38,14 @@ div.versionadded {
div.versionchanged {
border-color: var(--pst-color-warning);
background-color: var(--pst-color-warning-bg);

html[data-theme="dark"] & {
// This is a one-off because `--pst-color-link-higher-contrast` works for
// all of the other admonitions except this one in dark mode.
a {
color: map-deep-get($color-palette, "teal", "300");
}
}
}

div.deprecated,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ aside.topic {
color: var(--pst-color-on-surface) !important;
}

a {
color: var(--pst-color-link-higher-contrast);
}

// Over-ride large default padding
ul.simple {
padding-left: 1rem;
Expand Down
2 changes: 1 addition & 1 deletion src/pydata_sphinx_theme/assets/styles/content/_code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ code.literal {
}

a > code {
color: var(--pst-color-inline-code-links);
color: var(--pst-color-link-higher-contrast);

&:hover {
color: var(--pst-color-link-hover);
Expand Down
2 changes: 1 addition & 1 deletion src/pydata_sphinx_theme/assets/styles/content/_quotes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ blockquote {

// Ensure there is enough contrast against the background
a {
color: var(--pst-color-inline-code-links);
color: var(--pst-color-link-higher-contrast);
}

// hack to make the text in the blockquote selectable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

// Ensure there is enough contrast against the background
a {
color: var(--pst-color-inline-code-links);
color: var(--pst-color-link-higher-contrast);
}

// The "Switch to stable version" link (styled like a button)
Expand Down
8 changes: 5 additions & 3 deletions src/pydata_sphinx_theme/assets/styles/variables/_color.scss
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,12 @@ $pst-semantic-colors: (
"light": #{map-deep-get($color-palette, "pink", "600")},
"dark": #{map-deep-get($color-palette, "pink", "300")},
),
"inline-code-links": (
// need to make sure there is enough contrast against the code bg
"link-higher-contrast": (
// teal-600 provides higher contrast than teal-500 (our regular light mode
// link color) for off-white or non-white backgrounds
"light": #{map-deep-get($color-palette, "teal", "600")},
// keep primary color for dark mode
// teal-400 is actually the same color already used for links in dark mode,
// but it actually works for most of our other dark mode backgrounds
"dark": #{map-deep-get($color-palette, "teal", "400")},
),
"target": (
Expand Down
3 changes: 2 additions & 1 deletion tests/intermittent_warning_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ WARNING: Cell printed to stderr:
Matplotlib is building the font cache; this may take a moment.
WARNING: failed to reach any of the inventories with the following issues:
intersphinx inventory
# THESE 3 WILL GO AWAY WHEN OUR MIN SPHINX VERSION IS 7.3 OR HIGHER
# THE FOLLOWING 4 LINES WILL GO AWAY WHEN OUR MIN SPHINX VERSION IS 7.3 OR HIGHER (because 7.3 introduces the versionremoved directive)
We also support *italic*, **bold**, ``code``, `links <https://www.sphinx-doc.org/en/master/>`_, and more.
Here's a version removed message.
.. versionremoved:: v0.1.1
ERROR: Unknown directive type "versionremoved".
3 changes: 3 additions & 0 deletions tests/sites/base/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@

# Base options, we can add other key/vals later
html_sidebars = {"section1/index": ["sidebar-nav-bs.html"]}

# see https://github.com/sphinx-doc/sphinx/issues/13462
linkcheck_allowed_redirects = {}
3 changes: 3 additions & 0 deletions tests/sites/breadcrumbs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@
"secondary_sidebar_items": ["breadcrumbs"],
"article_header_start": ["breadcrumbs"],
}

# see https://github.com/sphinx-doc/sphinx/issues/13462
linkcheck_allowed_redirects = {}
3 changes: 3 additions & 0 deletions tests/sites/colors/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@
html_theme = "pydata_sphinx_theme"
html_copy_source = True
html_sourcelink_suffix = ""

# see https://github.com/sphinx-doc/sphinx/issues/13462
linkcheck_allowed_redirects = {}
3 changes: 3 additions & 0 deletions tests/sites/deprecated/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@
}

html_sidebars = {"section1/index": ["sidebar-nav-bs.html"]}

# see https://github.com/sphinx-doc/sphinx/issues/13462
linkcheck_allowed_redirects = {}
3 changes: 3 additions & 0 deletions tests/sites/sidebars/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
html_sidebars = {
"section2/no-sidebar": [], # Turn off primary/left sidebar
}

# see https://github.com/sphinx-doc/sphinx/issues/13462
linkcheck_allowed_redirects = {}
3 changes: 3 additions & 0 deletions tests/sites/test_included_toc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
# -- Options for HTML output -------------------------------------------------

html_theme = "pydata_sphinx_theme"

# see https://github.com/sphinx-doc/sphinx/issues/13462
linkcheck_allowed_redirects = {}
3 changes: 3 additions & 0 deletions tests/sites/test_navbar_no_in_page_headers/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@

html_copy_source = True
html_sourcelink_suffix = ""

# see https://github.com/sphinx-doc/sphinx/issues/13462
linkcheck_allowed_redirects = {}
3 changes: 3 additions & 0 deletions tests/sites/version_switcher/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@
},
"navbar_start": ["navbar-logo", "version-switcher"],
}

# see https://github.com/sphinx-doc/sphinx/issues/13462
linkcheck_allowed_redirects = {}
Loading