-
Notifications
You must be signed in to change notification settings - Fork 0
Home
The IPython notebook allows extending the html frontend functionality (i.e. what you do in the Browser) using extensions written in Javascript. This repository contains a collection of such extensions. The maturity of the provided extensions may vary, please create an issue if you encounter any problems.
The repository is organized in several directories:
| File or Directory | Description |
|---|---|
| publishing/nbconvert-button | Add a toolbar button to call nbconvert --to html for current the notebook (deprecated) |
| publishing/printview-button | Add a toolbar button to call nbconvert --to html for current the notebook and display html in new browser tab (deprecated) |
| publishing/printviewmenu-button | Add a toolbar button to call menu entry File->Print Preview directly (V2 only) |
| publishing/gist_it | Publish notebook as a gist |
| publishing/nbviewer_theme | |
| js_highlight.py | A python tool to customize the css classes of nbconvert's html code blocks to fit your favourite JS syntax highlighter |
| slidemode | Make slide creation for reveal.js easier |
| styling/css_selector | |
| styling/zenmode | |
| testing | Alpha-level extensions, not for general use |
| usability/breakpoints | Allow setting of breakpoints to stop execution of notebook cells |
| usability/codefolding | Fold code blocks using Alt-F or clicking on gutter |
| usability/comment-uncomment.js | Toggle comments in selected lines using Alt-C |
| usability/help_panel.js | Display panel with hotkey help |
| usability/linenumbers.js | Add line numbers to code cells |
| usability/read-only.js | Allow codecells to be set read-only, so no editing is possible |
| usability/shift-tab.js | Assign "shift-tab" key to dedent tabulator |
| usability/chrome_clipboard | Add system clipboard actions with crome |
| usability/drag-and-drop | Allow dragging of images into a notebook |
| usability/aspell | Spellchecker using aspell |
| usability/hide_input_all | Hide all codecells in a notebook |
Extensions can be installed by copying the corresponding javascript extension and it's accompanying files to the static/custom directory of your IPython profile and adding it to custom.js.
You can find out your profile directory directly from the commandline
ipython locate
Or by starting the IPython notebook and executing
import IPython
ip=IPython.get_ipython()
ip.config.ProfileDir This will give you something like
{'location': u'C:\\Users\\me\\.ipython\\profile_dev'}
or for Unix
{'location': u'/home/you/.ipython/profile_default'}
So your path to copy the extensions into will be
/home/you/.ipython/profile_default/static/custom
Next, you copy the extension file or complete directory to the custom directory.
Finally, you have to add the extensions to the file custom.js in order to load them.
This can be done best using the require command:
require(['/static/custom/styling/css-selector/main.js']) Your custom.js file might now look like this:
$([IPython.events]).on('app_initialized.NotebookApp', function(){
require(['/static/custom/clean_start.js']);
require(['/static/custom/styling/css-selector/main.js']);
})It is also possible to add additional locations where extensions can be placed.
This can be configured in the ipython_notebook_config.py file. To find out if
you have configured an extra path type:
ip.config.NotebookApp.extra_static_pathsIf the extension does not work, here is how you can check what is wrong:
- Verify your
custom.jsis the one the IPython notebook is seeing, by opening it in the browser:
http://127.0.0.1:8888/static/custom/custom.js
- Verify the extension can be loaded by the IPython notebook, for example:
http://127.0.0.1:8888//static/custom/styling/css-selector/main.js
- Check for error messages in the Javascipt console.
Aspell
Breakpoints
Chrome Clipboard
Codefolding
Comment Uncomment
Drag and Drop
Execute Timings
Help Panel
Hide Input All
Hierarchical Collapse
International Keymap
Javascript Highlighter
LaTeX Environments
Limit Output
Linenumbers
Navigation Hotkeys
Nbconvert Button
Printview Button
Printviewmenu Button
Python Markdown
Readonly
Rubberband
Runtools
Search & Replace
Search
Shift-Tab 3.x
Skip Traceback