【发布时间】:2020-04-27 23:49:33
【问题描述】:
我想知道是否有一种方法可以将指令添加到 sphinx 文档中,其中包含可以通过单击打开的隐藏部分。
基本上你可以找到https://realpython.com/pandas-python-explore-dataset/(搜索显示/隐藏):
【问题讨论】:
标签: python-sphinx
我想知道是否有一种方法可以将指令添加到 sphinx 文档中,其中包含可以通过单击打开的隐藏部分。
基本上你可以找到https://realpython.com/pandas-python-explore-dataset/(搜索显示/隐藏):
【问题讨论】:
标签: python-sphinx
这是来自Mastering Plone Training documentation 的工作示例。
这是source code。
.. admonition:: Solution
:class: toggle
* Go to the dexterity-controlpanel (http://localhost:8080/Plone/@@dexterity-types)
* Click on *Page* (http://127.0.0.1:8080/Plone/dexterity-types/Document)
* Select the tab *Behaviors* (http://127.0.0.1:8080/Plone/dexterity-types/Document/@@behaviors)
* Check the box next to *Lead Image* and save.
commit history 表明自定义 JavaScript 和样式已添加到主题中。
.toggle {
background: none repeat scroll 0 0 #e7f2fa;
}
.toggle .admonition-title {
display: block;
clear: both;
}
.toggle .admonition-title:after {
content: " ▼";
}
.toggle .admonition-title.open:after {
content: " ▲";
}
{% set css_files = css_files + ["_static/custom.css"] %}
{%- block extrahead %}
<script type="text/javascript">
$(document).ready(function() {
//
//
$(".toggle > *").hide();
$(".toggle .admonition-title").show();
$(".toggle .admonition-title").click(function() {
$(this).parent().children().not(".admonition-title").toggle(400);
$(this).parent().children(".admonition-title").toggleClass("open");
})
});
</script>
{% endblock %}
【讨论】: