Skip to content

Commit

Permalink
Version Switcher Part 3 (ray-project#47019)
Browse files Browse the repository at this point in the history
## Why are these changes needed?

A few small follow ups for the version switcher:
- move constants to inside the versions JSON generation function
- updated height of version switcher to be relative so it scales up with
zoom level
- changed `overflow` to `overflow-y` to stop the extra horizontal scroll
from showing up
Before:
![Screenshot 2024-08-08 at 9 56
01 AM](https://github.com/user-attachments/assets/ac94b727-ca20-4c3b-8488-347549d19eca)
After:
![Screenshot 2024-08-08 at 10 02
21 AM](https://github.com/user-attachments/assets/05813997-bee1-480a-bbcb-e4f02ac88a99)

Signed-off-by: cristianjd <cristian.j.derr@gmail.com>
Signed-off-by: Dev <dev.goyal@hinge.co>
  • Loading branch information
cristianjd authored and dev-goyal committed Aug 8, 2024
1 parent 5521609 commit a978710
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions doc/source/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ table.autosummary tr > td:first-child > p > a > code > span {

/* Prevent the the PyData theme Version Switcher from getting too large */
.version-switcher__menu {
max-height: 496px;
overflow: scroll;
max-height: 40rem;
overflow-y: scroll;
}

/* Hide the RTD version switcher since we are using PyData theme one */
Expand Down
15 changes: 7 additions & 8 deletions doc/source/custom_directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -1256,14 +1256,6 @@ def pregenerate_example_rsts(
)


ray_prefix = "ray-"
min_version = "1.11.0"
repo_url = "https://github.com/ray-project/ray.git"
static_dir_name = "_static"
version_json_filename = "versions.json"
dereference_suffix = "^{}"


def generate_version_url(version):
return f"https://docs.ray.io/en/{version}/"

Expand All @@ -1273,6 +1265,13 @@ def generate_versions_json():
and generates the JSON needed for the version switcher
"""

ray_prefix = "ray-"
min_version = "1.11.0"
repo_url = "https://github.com/ray-project/ray.git"
static_dir_name = "_static"
version_json_filename = "versions.json"
dereference_suffix = "^{}"

version_json_data = []

# Versions that should always appear at the top
Expand Down

0 comments on commit a978710

Please sign in to comment.