Javascript extension for a notebook¶

Links: notebook, html, PDF, python, slides, slides(2), GitHub

Play with Javascript extensions.

from pyquickhelper.ipythonhelper import install_notebook_extension, get_installed_notebook_extension

We install extensions in case it was not done before:

install_notebook_extension()
''

We check the list of installed extensions (from IPython-notebook-extensions):

from pyquickhelper.ipythonhelper.notebook_helper import get_jupyter_extension_dir
path = get_jupyter_extension_dir()
path
'C:\ProgramData\jupyter\nbextensions'
get_installed_notebook_extension()
['jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/addbefore/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/autosavetime/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/autoscroll/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/chrome-clipboard/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/codefolding/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/codemirror_mode_extensions/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/collapsible_headings/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/comment-uncomment/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/contrib_nbextensions_help_item/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/css_selector/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/datestamper/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/dragdrop/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/equation-numbering/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/exercise/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/exercise2/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/export_embedded/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/freeze/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/gist_it/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/hide_header/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/hide_input/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/hide_input_all/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/init_cell/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/keyboard_shortcut_editor/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/limit_output/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/load_tex_macros/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/move_selected_cells/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/navigation-hotkeys/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/nbTranslate/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/printview/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/python-markdown/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/rubberband/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/ruler/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/runtools/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/scratchpad/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/scroll_down/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/search-replace/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/select_keymap/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/skill/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/skip-traceback/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/snippets/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/snippets_menu/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/spellchecker/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/table_beautifier/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/toc2/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/toggle_all_line_numbers/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/varInspector/main',
 'jupyter_contrib_nbextensions-master/src/jupyter_contrib_nbextensions/nbextensions/zenmode/main']
import notebook
notebook.nbextensions.check_nbextension('autosavetime', user=True)
False

And then, we load one of them:

%%javascript

require(['base/js/utils'],
function(utils) {
    utils.load_extensions('autosavetime/main');
});
<IPython.core.display.Javascript object>
print(3)
3

Does not really work as it is now.