Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
ecfc65ec
提交
ecfc65ec
authored
11月 09, 2016
作者:
Frédéric Bastien
提交者:
GitHub
11月 09, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5199 from slefrancois/doc_move_vswitch
add doc version switcher to top of sidebar
上级
cea45e8b
e512d7a8
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
34 行增加
和
2 行删除
+34
-2
fix_rtd.css
doc/.static/fix_rtd.css
+7
-0
version_switch.js
doc/.static/version_switch.js
+19
-1
layout.html
doc/.templates/layout.html
+8
-1
没有找到文件。
doc/.static/fix_rtd.css
浏览文件 @
ecfc65ec
...
@@ -2,3 +2,10 @@
...
@@ -2,3 +2,10 @@
.rst-content
table
.field-list
.field-body
{
.rst-content
table
.field-list
.field-body
{
padding-top
:
8px
;
padding-top
:
8px
;
}
}
.rst-versions-up
{
cursor
:
pointer
;
display
:
inline
;
}
.wy-side-nav-search
>
div
.version
{
color
:
white
;
}
doc/.static/version_switch.js
浏览文件 @
ecfc65ec
...
@@ -68,10 +68,27 @@
...
@@ -68,10 +68,27 @@
return
vswitch
.
join
(
''
);
return
vswitch
.
join
(
''
);
}
}
function
build_vswitch_up
()
{
// Build HTML string for version selector, based on ReadTheDocs theme's versions.html
var
vlabel
=
current_version
.
replace
(
"theano_versions/"
,
""
);
if
(
vlabel
==
'theano'
)
{
vlabel
=
'release'
;
}
var
vswitch
=
[
'<div class="rst-versions-up" data-toggle="rst-versions" role="note" aria-label="versions" align=center>'
];
vswitch
.
push
(
'<span class="rst-current-version" data-toggle="rst-current-version">'
);
vswitch
.
push
(
vlabel
);
vswitch
.
push
(
'<span class="fa fa-caret-down"></span>'
);
vswitch
.
push
(
'</span>'
);
vswitch
.
push
(
'</div>'
);
return
vswitch
.
join
(
''
);
}
// Create HTML for version switcher and assign to placeholder in layout.html.
// Create HTML for version switcher and assign to placeholder in layout.html.
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
// Build default switcher
// Build default switcher
$
(
'.version_switcher_placeholder'
).
html
(
build_vswitch
());
$
(
'.version_switcher_placeholder'
).
html
(
build_vswitch
());
$
(
'.version_switcher_placeholder_up'
).
html
(
build_vswitch_up
());
// Check server for other doc versions and update switcher.
// Check server for other doc versions and update switcher.
if
(
url
.
startsWith
(
'http'
))
{
if
(
url
.
startsWith
(
'http'
))
{
...
@@ -79,7 +96,8 @@
...
@@ -79,7 +96,8 @@
$
.
each
(
data
,
function
(
version
,
dir
)
{
$
.
each
(
data
,
function
(
version
,
dir
)
{
versions_dir
[
version
]
=
dir
;
versions_dir
[
version
]
=
dir
;
});
});
$
(
'.version_switcher_placeholder'
).
html
(
build_vswitch
());
$
(
'.version_switcher_placeholder'
).
html
(
build_vswitch
());
$
(
'.version_switcher_placeholder_up'
).
html
(
build_vswitch_up
());
});
});
}
}
});
});
...
...
doc/.templates/layout.html
浏览文件 @
ecfc65ec
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
})();
})();
</script>
</script>
<!--Insert version switcher at bottom of sidebar-->
<!--Insert version switcher at bottom
and top
of sidebar-->
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
span
=
document
.
createElement
(
"SPAN"
)
var
span
=
document
.
createElement
(
"SPAN"
)
var
span_class
=
document
.
createAttribute
(
"class"
);
var
span_class
=
document
.
createAttribute
(
"class"
);
...
@@ -24,6 +24,13 @@
...
@@ -24,6 +24,13 @@
div
.
appendChild
(
span
);
div
.
appendChild
(
span
);
var
nav_div
=
document
.
getElementsByClassName
(
"wy-nav-side"
)[
0
];
var
nav_div
=
document
.
getElementsByClassName
(
"wy-nav-side"
)[
0
];
nav_div
.
appendChild
(
div
);
nav_div
.
appendChild
(
div
);
var
span_up
=
document
.
createElement
(
"SPAN"
)
var
span_class_up
=
document
.
createAttribute
(
"class"
);
span_class_up
.
value
=
"version_switcher_placeholder_up"
;
span_up
.
setAttributeNode
(
span_class_up
);
var
nav_div_up
=
document
.
getElementsByClassName
(
"version"
)[
0
];
nav_div_up
.
appendChild
(
span_up
);
</script>
</script>
<script
type=
"text/javascript"
<script
type=
"text/javascript"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论