from jyquickhelper import add_notebook_menu
add_notebook_menu(menu_id="main_menu")

"""
Explanation: Example of a notebook with a javascript menu
It is sometimes difficult to navigate through long notebooks. Regular ways to navigate in a HTML page are not available when the cursor is stuck in a cell. Here is a simple trick with two sections. Links remains at the same place anytime just by adding HTML in the notebook.
<div style="position:absolute; top:10px; right:5px; width:100px; height:90px; margin:10px;">

[Section 1](#Section-1) -- [Section 2](#Section-2) -- [This is the end](#This-is-the-end.)

</div>

The code in the markdown cell looks like the following, it is a mix between HTML and markdown. The combination is not perfect but that works somehow. The outcome can be shown on the left.
This trick does not work very well with IPython 3+. So I created a simple function which automaticallt adds a menu to all sections within the notebook.
End of explanation
"""


for i in range(0,30):
    # just making space
    print ("line",i)

"""
Explanation: Section 1
End of explanation
"""


for i in range(0,30):
    # making space again
    print("line2",i)

"""
Explanation: Section 2
End of explanation
"""


from jyquickhelper import set_notebook_name_theNotebook
set_notebook_name_theNotebook()

theNotebook

from jyquickhelper import add_notebook_menu
add_notebook_menu()

"""
Explanation: This is the end.
We end up by using some functionalities from pyquickhelper.
End of explanation
"""


