File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ ( function ( ) {
2
+ var latestStable = '0.21' ;
3
+ var goodPaths = [ 'stable' , 'dev' , latestStable ] ;
4
+ var showWarning = ( msg ) => {
5
+ $ ( '.body[role=main]' ) . prepend (
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
+ var versionPath = location . pathname . split ( '/' ) [ 1 ] ;
18
+ if ( ! goodPaths . includes ( versionPath ) ) {
19
+ showWarning ( 'This is documentation for an old release of ' +
20
+ 'Scikit-learn (version ' + versionPath + '). Try the ' +
21
+ '<a href="https://scikit-learn.org">latest stable ' +
22
+ 'release</a> (version ' + latestStable + ') or ' +
23
+ '<a href="https://scikit-learn.org/dev">development</a> ' +
24
+ '(unstable) versions.' )
25
+ } else if ( versionPath == 'dev' ) {
26
+ showWarning ( 'This is documentation for the unstable ' +
27
+ 'development version of Scikit-learn. (To use it, ' +
28
+ '<a href="https://scikit-learn.org/stable/developers/advanced_installation.html#installing-nightly-builds">install the nightly build</a>.) ' +
29
+ 'The latest stable ' +
30
+ 'release is <a href="https://scikit-learn.org">version ' +
31
+ latestStable + '</a>.' )
32
+ }
33
+ }
34
+ } ) ( )
You can’t perform that action at this time.
0 commit comments