Skip to content

Commit 27902d4

Browse files
authored
[misc][doc] try to add warning for latest html (#5979)
1 parent 56b325e commit 27902d4

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<style>
2+
.notification-bar {
3+
width: 100vw;
4+
display: flex;
5+
justify-content: center;
6+
align-items: center;
7+
font-size: 16px;
8+
}
9+
.notification-bar p {
10+
margin: 0;
11+
}
12+
.notification-bar a {
13+
font-weight: bold;
14+
text-decoration: none;
15+
}
16+
17+
/* Light mode styles (default) */
18+
.notification-bar {
19+
background-color: #fff3cd;
20+
color: #856404;
21+
}
22+
.notification-bar a {
23+
color: #d97706;
24+
}
25+
26+
/* Dark mode styles */
27+
html[data-theme=dark] .notification-bar {
28+
background-color: #333;
29+
color: #ddd;
30+
}
31+
html[data-theme=dark] .notification-bar a {
32+
color: #ffa500; /* Brighter color for visibility */
33+
}
34+
</style>
35+
36+
<div class="notification-bar">
37+
<p>You are viewing the latest developer preview docs. <a href="https://docs.vllm.ai/en/stable/">Click here</a> to view docs for the latest stable release.</p>
38+
</div>

docs/source/conf.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@
6969
'use_edit_page_button': True,
7070
}
7171

72+
# see https://docs.readthedocs.io/en/stable/reference/environment-variables.html # noqa
73+
READTHEDOCS_VERSION_TYPE = os.environ.get('READTHEDOCS_VERSION_TYPE')
74+
if READTHEDOCS_VERSION_TYPE == "tag":
75+
# remove the warning banner if the version is a tagged release
76+
header_file = os.path.join(os.path.dirname(__file__),
77+
"_templates/sections/header.html")
78+
os.remove(header_file)
79+
7280
# Add any paths that contain custom static files (such as style sheets) here,
7381
# relative to this directory. They are copied after the builtin static files,
7482
# so a file named "default.css" will overwrite the builtin "default.css".

0 commit comments

Comments
 (0)