Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
df12c1b9
Unverified
Commit
df12c1b9
authored
Oct 25, 2021
by
Nikita Titov
Committed by
GitHub
Oct 24, 2021
Browse files
[docs] fix R API link to point to the current version of docs (#4691)
* fix R API link to point to the current version of docs
parent
dc02dcaf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
docs/_static/js/script.js
docs/_static/js/script.js
+24
-4
No files found.
docs/_static/js/script.js
View file @
df12c1b9
...
@@ -2,12 +2,32 @@ $(function() {
...
@@ -2,12 +2,32 @@ $(function() {
/* Use wider container for the page content */
/* Use wider container for the page content */
$
(
'
.wy-nav-content
'
).
each
(
function
()
{
this
.
style
.
setProperty
(
'
max-width
'
,
'
none
'
,
'
important
'
);
});
$
(
'
.wy-nav-content
'
).
each
(
function
()
{
this
.
style
.
setProperty
(
'
max-width
'
,
'
none
'
,
'
important
'
);
});
/* Point to the same version of R API as the current docs version */
var
current_version_elems
=
$
(
'
.rst-current-version
'
);
if
(
current_version_elems
.
length
!==
0
)
{
var
current_version
=
$
(
current_version_elems
[
0
]).
contents
().
filter
(
function
()
{
return
this
.
nodeType
==
3
;
}).
text
().
trim
().
split
(
'
'
).
pop
();
if
(
current_version
!==
'
latest
'
)
{
$
(
'
a.reference.external[href$="/latest/R/reference/"]
'
).
each
(
function
()
{
$
(
this
).
attr
(
'
href
'
,
function
(
_
,
val
)
{
return
val
.
replace
(
'
/latest/
'
,
'
/
'
+
current_version
+
'
/
'
);
});
});
}
}
/* Collapse specified sections in the installation guide */
/* Collapse specified sections in the installation guide */
if
(
window
.
location
.
pathname
.
toLocaleLowerCase
().
indexOf
(
'
installation-guide
'
)
!=
-
1
)
{
if
(
window
.
location
.
pathname
.
toLocaleLowerCase
().
indexOf
(
'
installation-guide
'
)
!=
-
1
)
{
$
(
'
<style>.closed, .opened {cursor: pointer;} .closed:before, .opened:before {font-family: FontAwesome; display: inline-block; padding-right: 6px;} .closed:before {content: "
\\
f078";} .opened:before {content: "
\\
f077";}</style>
'
).
appendTo
(
'
body
'
);
$
(
'
<style>.closed, .opened {cursor: pointer;} .closed:before, .opened:before {font-family: FontAwesome; display: inline-block; padding-right: 6px;} .closed:before {content: "
\\
f078";} .opened:before {content: "
\\
f077";}</style>
'
).
appendTo
(
'
body
'
);
var
collapsable
=
[
'
#build-threadless-version-not-recommended
'
,
'
#build-mpi-version
'
,
'
#build-gpu-version
'
,
var
collapsable
=
[
'
#build-cuda-version-experimental
'
,
'
#build-hdfs-version
'
,
'
#build-java-wrapper
'
,
'
#build-c-unit-tests
'
];
'
#build-threadless-version-not-recommended
'
,
$
.
each
(
collapsable
,
function
(
i
,
val
)
{
'
#build-mpi-version
'
,
'
#build-gpu-version
'
,
'
#build-cuda-version-experimental
'
,
'
#build-hdfs-version
'
,
'
#build-java-wrapper
'
,
'
#build-c-unit-tests
'
];
$
.
each
(
collapsable
,
function
(
_
,
val
)
{
var
header
=
val
+
'
> :header:first
'
;
var
header
=
val
+
'
> :header:first
'
;
var
content
=
val
+
'
:not(:header:first)
'
;
var
content
=
val
+
'
:not(:header:first)
'
;
$
(
header
).
addClass
(
'
closed
'
);
$
(
header
).
addClass
(
'
closed
'
);
...
@@ -19,7 +39,7 @@ $(function() {
...
@@ -19,7 +39,7 @@ $(function() {
});
});
/* Uncollapse parent sections when nested section is specified in the URL or before navigate to it from navbar */
/* Uncollapse parent sections when nested section is specified in the URL or before navigate to it from navbar */
function
uncollapse
(
section
)
{
function
uncollapse
(
section
)
{
section
.
parents
().
each
((
i
,
val
)
=>
{
$
(
val
).
children
(
'
.closed
'
).
click
();
});
section
.
parents
().
each
((
_
,
val
)
=>
{
$
(
val
).
children
(
'
.closed
'
).
click
();
});
}
}
uncollapse
(
$
(
window
.
location
.
hash
));
uncollapse
(
$
(
window
.
location
.
hash
));
$
(
'
.wy-menu.wy-menu-vertical li a.reference.internal
'
).
click
(
function
()
{
$
(
'
.wy-menu.wy-menu-vertical li a.reference.internal
'
).
click
(
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment