Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdc12270

Browse files
committed
Add a version warning to each HTML file
1 parent99eaeb8 commitdc12270

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

‎versionwarning.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
(()=>{
2+
varlatestStable='0.21';
3+
vargoodPaths=['stable','dev',latestStable];
4+
varshowWarning=(msg)=>{
5+
$('.header').append(
6+
'<p style="'+
7+
[
8+
'padding: 1em',
9+
'font-size: 1.5em',
10+
'border: 1px solid red',
11+
'background: pink',
12+
'width: 100%',
13+
].join('; ')+
14+
'">'+msg+'</p>')
15+
};
16+
/// if (location.hostname == 'scikit-learn.org') {
17+
varversionPath=location.pathname.split('/')[1];
18+
if(!goodPaths.includes(versionPath)){
19+
showWarning('You are looking at documentation for an old release of '+
20+
'Scikit-learn (version '+versionPath+'). Try the '+
21+
'<a href="https://scikit-learn.org">latest release</a> or '+
22+
'<a href="https://scikit-learn.org/dev">development</a> '+
23+
'versions.')
24+
}elseif(versionPath=='dev'){
25+
showWarning('You are looking at documentation for the unstable '+
26+
'development version of Scikit-learn. See also the '+
27+
'<a href="https://scikit-learn.org">latest release</a> '+
28+
'version.')
29+
}
30+
///}
31+
})()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp