mirror of
https://github.com/wassname/jupyter_contrib_nbextensions.git
synced 2026-08-09 12:10:23 +08:00
The ToC is mostly a direct copy from https://github.com/minrk/ipython_extensions/ with minor edits (filenames) and the addition of readme, icon and the yaml activations. @minrk was fine with copying it here: https://github.com/minrk/ipython_extensions/issues/50 This script has a problem when two more occurences of the same headline appear in the notebook (e.g. multiple "Plots" headlines in different analyis steps). The resulting ToC will link to the same anchor and the browser will always move to the first version of this headline. See https://github.com/jupyter/notebook/issues/77 for more information on this problem.
64 lines
1022 B
CSS
64 lines
1022 B
CSS
/*extracted from https://gist.github.com/magican/5574556*/
|
|
|
|
#toc {
|
|
overflow-y: auto;
|
|
max-height: 300px;
|
|
padding: 0px;
|
|
|
|
ol.nested {
|
|
counter-reset: item;
|
|
list-style: none;
|
|
}
|
|
li.nested {
|
|
display: block;
|
|
}
|
|
li.nested:before {
|
|
counter-increment: item;
|
|
content: counters(item, ".")" ";
|
|
}
|
|
}
|
|
|
|
#toc-wrapper {
|
|
position: fixed;
|
|
top: 120px;
|
|
max-width:230px;
|
|
right: 20px;
|
|
border: thin solid rgba(0, 0, 0, 0.38);
|
|
border-radius: 5px;
|
|
padding:10px;
|
|
background-color: #fff;
|
|
opacity: .8;
|
|
z-index: 100;
|
|
}
|
|
|
|
#toc-wrapper.closed {
|
|
min-width: 100px;
|
|
width: auto;
|
|
transition: width;
|
|
}
|
|
#toc-wrapper:hover{
|
|
opacity: 1;
|
|
}
|
|
#toc-wrapper .header {
|
|
font-size: 18px;
|
|
font-weight: bold;
|
|
}
|
|
#toc-wrapper .hide-btn {
|
|
font-size: 14px;
|
|
font-family: monospace;
|
|
}
|
|
|
|
#toc-wrapper .reload-btn {
|
|
font-size: 14px;
|
|
font-family: monospace;
|
|
}
|
|
|
|
|
|
/* don't waste so much screen space... */
|
|
#toc-wrapper .toc-item{
|
|
padding-left: 20px;
|
|
}
|
|
|
|
#toc-wrapper .toc-item .toc-item{
|
|
padding-left: 10px;
|
|
} |