Skip to content

Commit

Permalink
Add support for versionremoved directive (#2087)
Browse files Browse the repository at this point in the history
Note that I added a snippet in the Kitchen Sink to preview the change. I
have an open PR in
sphinx-themes/sphinx-themes.org#163 to add it
upstream. I can remove this snippet, if you prefer, or you can clobber
it the next time you run a sync.

![Screenshot 2024-12-20 at 3 38 59
AM](https://github.com/user-attachments/assets/8bec8c56-ca63-44b2-8d34-e5988ba69bce)

![Screenshot 2024-12-20 at 3 40 17
AM](https://github.com/user-attachments/assets/bb1a93da-28c4-4152-be28-34f1eea9d98e)

- Closes #2086

---------

Co-authored-by: Daniel McCloy <[email protected]>
  • Loading branch information
stevepiercy and drammock authored Jan 24, 2025
1 parent d5c1265 commit 6345c7d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
7 changes: 7 additions & 0 deletions docs/examples/kitchen-sink/admonitions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,10 @@ Sphinx provides several different types of admonitions.
.. deprecated:: v0.1.1

Here's a deprecation message.

``versionremoved``
==================

.. versionremoved:: v0.1.1

Here's a version removed message.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
div.versionadded,
div.versionchanged,
div.deprecated {
div.deprecated,
div.versionremoved {
vertical-align: middle;
margin: 1.5625em auto;
padding: 0 0.6rem;
Expand Down Expand Up @@ -34,7 +35,8 @@ div.versionchanged {
background-color: var(--pst-color-warning-bg);
}

div.deprecated {
div.deprecated,
div.versionremoved {
border-color: var(--pst-color-danger);
background-color: var(--pst-color-danger-bg);
}
Expand Down Expand Up @@ -70,3 +72,10 @@ span.versionmodified.deprecated {
content: var(--pst-icon-versionmodified-deprecated);
}
}

span.versionmodified.removed {
&::before {
color: var(--pst-color-danger);
content: var(--pst-icon-versionmodified-removed);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ html {
--pst-icon-versionmodified-added: var(--pst-icon-exclamation-circle);
--pst-icon-versionmodified-changed: var(--pst-icon-exclamation-circle);
--pst-icon-versionmodified-deprecated: var(--pst-icon-exclamation-circle);
--pst-icon-versionmodified-removed: var(--pst-icon-exclamation-circle);
}
4 changes: 4 additions & 0 deletions tests/intermittent_warning_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ 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
Here's a version removed message.
.. versionremoved:: v0.1.1
ERROR: Unknown directive type "versionremoved".

0 comments on commit 6345c7d

Please sign in to comment.