Skip to content

Commit 9d00db1

Browse files
committed
whenxuan: create the version of docs
1 parent 811be88 commit 9d00db1

4 files changed

Lines changed: 35 additions & 4 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# PySDKit: signal decomposition in Python
44

55
[![PyPI version](https://badge.fury.io/py/PySDKit.svg)](https://pypi.org/project/PySDKit/)
6+
[![Documentation Status](https://readthedocs.org/projects/pysdkit/badge/?version=latest)](https://pysdkit.readthedocs.io/en/latest/)
67
![License](https://img.shields.io/github/license/wwhenxuan/PySDKit)
78
[![Python](https://img.shields.io/badge/python-3.8+-blue?logo=python)](https://www.python.org/)
89
[![Downloads](https://pepy.tech/badge/pysdkit)](https://pepy.tech/project/pysdkit)

‎docs/source/_static/theme_overrides.css‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ html[data-theme="light"] .sphx-glr-download code {
8686
letter-spacing: 0.02em;
8787
}
8888

89+
html[data-theme="light"] .version-switcher__button {
90+
border-color: rgba(0, 0, 0, 0.22);
91+
font-weight: 600;
92+
}
93+
8994
/* Hide the floating Read the Docs flyout so the header uses our logo.
9095
You can also uncheck Addons → Flyout in the RTD dashboard. */
9196
readthedocs-flyout {
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
[
2+
{
3+
"name": "dev",
4+
"version": "latest",
5+
"url": "https://pysdkit.readthedocs.io/en/latest/"
6+
},
7+
{
8+
"name": "0.4.55 (stable)",
9+
"version": "stable",
10+
"url": "https://pysdkit.readthedocs.io/en/stable/",
11+
"preferred": true
12+
},
213
{
314
"name": "0.4.55",
415
"version": "0.4.55",
5-
"url": "https://pysdkit.readthedocs.io/",
6-
"preferred": true
16+
"url": "https://pysdkit.readthedocs.io/en/0.4.55/"
717
}
818
]

‎docs/source/conf.py‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# https://www.sphinx-doc.org/en/master/usage/configuration.html
55

66
from datetime import date
7+
import os
78
import sys
89
from pathlib import Path
910

@@ -124,15 +125,29 @@
124125

125126
html_css_files = ["theme_overrides.css", "custom.css"]
126127

128+
# All doc versions fetch this URL so old builds pick up new tags.
129+
# READTHEDOCS_VERSION is "latest", "stable", or the git tag (e.g. 0.4.55).
130+
_switcher_json = (
131+
"https://pysdkit.readthedocs.io/en/latest/_static/version_switcher.json"
132+
)
133+
_version_match = os.environ.get("READTHEDOCS_VERSION") or "latest"
134+
127135
html_theme_options = {
128136
"announcement": "",
129137
"logo": {
130138
"image_light": "_static/logo.png",
131139
"image_dark": "_static/logo.png",
132-
"text": "PYSDKIT",
140+
"text": "PySDKit",
133141
"alt_text": "PySDKit",
134142
"link": "https://pysdkit.readthedocs.io/",
135143
},
144+
"switcher": {
145+
"json_url": _switcher_json,
146+
"version_match": _version_match,
147+
},
148+
# First deploy of the JSON on latest would otherwise fail the check.
149+
"check_switcher": False,
150+
"show_version_warning_banner": True,
136151
"header_links_before_dropdown": 6,
137152
"icon_links": [
138153
{
@@ -151,7 +166,7 @@
151166
"navbar_align": "content",
152167
"navbar_start": ["navbar-logo"],
153168
"navbar_center": ["navbar-nav"],
154-
"show_version_warning_banner": False,
169+
"navbar_end": ["version-switcher", "theme-switcher", "navbar-icon-links"],
155170
"secondary_sidebar_items": {
156171
"**": ["page-toc", "sourcelink"],
157172
},

0 commit comments

Comments
 (0)