ipython-contrib / jupyter_contrib_nbextensions

A collection of various notebook extensions for Jupyter
http://jupyter-contrib-nbextensions.readthedocs.io/en/latest
Other
5.2k stars 805 forks source link

Fix Table of Contents (2) not showing top part of table #1662

Open coatless opened 1 month ago

coatless commented 1 month ago

This adds a top margin of 10em to ensure the table of contents initial section is visible and not cutoff/inaccessible.

Before:

Screenshot showing the inaccessible portion of the table of contents generate by ToC (2)

After:

Screenshot showing the top portion of the ToC (2) with the committed change now being accessible

This can quickly be explored by adding a Python cell with:

from IPython.display import display, HTML
display(HTML("""
<style>
#toc-wrapper { 
z-index: 90; 
position: fixed !important;
display: flex;
flex-direction: column;
overflow: hidden;
padding: 10px;
border-style: solid;
border-width: thin;
background-color: #fff;
/* default - alterable via nbextension-configurator */
top: 10em;}
</style>"""))

Close #1651