Giter VIP home page Giter VIP logo

jupyter_contrib_nbextensions's Introduction

Jupyter notebook extensions

Join the chat at https://gitter.im/ipython-contrib/jupyter_contrib_nbextensions Documentation Status Documentation Status GitHub issues
Travis-CI Build Status Appveyor Build status Coveralls python test coverage Codecov python test coverage
GitHub tag PyPI Anaconda cloud

This repository contains a collection of extensions that add functionality to the Jupyter notebook. These extensions are mostly written in Javascript and will be loaded locally in your browser.

The IPython-contrib repository is maintained independently by a group of users and developers and not officially related to the IPython development team.

The maturity of the provided extensions varies, so please create an issue at the project's github repository if you encounter any problems.

IPython/Jupyter version support

For Jupyter version 4 or 5, use the master branch of the repository. Most nbextensions have been updated to work with both Jupyter 4.x and 5.x, but occasionally things get missed, or the Jupyter API changes in a minor version update, so if anything doesn't work as you'd expect/hope, please do check the issues, or open a new one as necessary!

This repo is pretty much all in the main master branch, although there remain vestigial branches for IPython notebook versions 2.x and 3.x.

JupyterLab

Due to major differences between the Jupyter Notebook and JupyterLab, the extensions in this repository will not work in JupyterLab. You will find a list of alternative extensions for JupyterLab on jupyterlab-contrib.

Documentation

Documentation for all maintained extensions can be found at jupyter-contrib-nbextensions.readthedocs.io

All extensions that are maintained and active have at least a yaml file to allow them being configured using the jupyter_nbextensions_configurator server extension, which is installed as a dependency of this package. Most also have a markdown readme file for documentation. The jupyter_nbextensions_configurator server extension shows an nbextensions tab on the main notebook dashboard (file tree page) from which you can see each nbextension's markdown readme, and configure its options. To view documentation without installing, you can check the list at jupyter-contrib-nbextensions.readthedocs.io/en/latest/nbextensions.html, or browse the nbextensions directory to read markdown readmes on github at github.com/ipython-contrib/jupyter_contrib_nbextensions/tree/master/src/jupyter_contrib_nbextensions/nbextensions.

Some extensions are not documented. We encourage you to add documentation for them.

Installation

To install the jupyter_contrib_nbextensions notebook extensions, three steps are required. First, the Python pip package needs to be installed. Then, the notebook extensions themselves need to be copied to the Jupyter data directory. Finally, the installed notebook extensions can be enabled, either by using built-in Jupyter commands, or more conveniently by using the jupyter_nbextensions_configurator server extension, which is installed as a dependency of this repo.

The Python package installation step is necessary to allow painless installation of the nbextensions together with additional items like nbconvert templates, pre-/postprocessors, and exporters.

1. Install the python package

PIP

All of the nbextensions in this repo are provided as parts of a python package, which is installable in the usual manner using pip or the setup.py script. To install the current version from PyPi, simply type

pip install jupyter_contrib_nbextensions

Alternatively, you can install directly from the current master branch of the repository

pip install https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tarball/master

All the usual pip options apply, e.g. using pip's --upgrade flag to force an upgrade, or -e for an editable install.

Conda

There are conda packages for the notebook extensions and the jupyter_nbextensions_configurator available from conda-forge. You can install both using

conda install -c conda-forge jupyter_contrib_nbextensions

This also automatically installs the Javascript and CSS files (using jupyter contrib nbextension install --sys-prefix), therefore the second installation step below can be skipped.

Installation from cloned Repo

You can also install from a cloned repo, which can be useful for development. You can clone the repo using

git clone https://github.com/ipython-contrib/jupyter_contrib_nbextensions.git

Then perform an editable pip install using

pip install -e jupyter_contrib_nbextensions

2. Install javascript and css files

This step copies the nbextensions' javascript and css files into the jupyter server's search directory, and edits some jupyter config files. A jupyter subcommand is provided for the purpose:

jupyter contrib nbextension install --user

The command does two things: installs nbextension files, and edits nbconvert config files. The first part is essentially a wrapper around the notebook-provided jupyter nbextension install, and copies relevant javascript and css files to the appropriate jupyter data directory. The second part edits the config files jupyter_nbconvert_config.jsonand jupyter_notebook_config.json as noted below in the options. The command can take most of the same options as the jupyter-provided versions, including

  • --user to install into the user's home jupyter directories
  • --system to perform installation into system-wide jupyter directories
  • --sys-prefix to install into python's sys.prefix, useful for instance in virtual environments, such as with conda
  • --symlink to symlink the nbextensions rather than copying each file (recommended on non-Windows platforms).
  • --debug, for more-verbose output

In addition, two further option flags are provided to perform either only the config-editing operations, or only the file-copy operations:

  • --only-files to install nbextension files without editing any config files
  • --only-config to edit the config files without copying/symlinking any nbextension files. This edits the following files in the applicable jupyter config directory:
    • jupyter_nbconvert_config.json to use some of the classes provided in the python module jupyter_contrib_nbextensions.nbconvert_support
    • jupyter_notebook_config.json to enable the serverextension jupyter_nbextensions_configurator.

Finally, the --perform-running-check option flag is provided in order to prevent the installation from proceeding if a notebook server appears to be currently running (by default, the install will still be performed, even if a notebook server appears to be running).

An analogous uninstall command is also provided, to remove all of the nbextension files from the jupyter directories.

3. Enabling/Disabling extensions

To use an nbextension, you'll also need to enable it, which tells the notebook interface to load it. To do this, you can use a Jupyter subcommand:

jupyter nbextension enable <nbextension require path>

for example,

jupyter nbextension enable codefolding/main

To disable the extension again, use

jupyter nbextension disable <nbextension require path>

Alternatively, and more conveniently, you can use the jupyter_nbextensions_configurator server extension, which is installed as a dependency of this repo, and can be used to enable and disable the individual nbextensions, as well as configure their options. You can then open the nbextensions tab on the tree (dashboard/file browser) notebook page to configure nbextensions. You will have access there to a dashboard where extensions can be enabled/disabled via checkboxes. Additionally, a short documentation for each extension is displayed, and configuration options are presented.

jupyter_nbextensions_configurator

4. More complex setups

For complex or customized installation scenarios, please look at the documentation for installing notebook extensions, server extensions, nbconvert pre/postprocessors and templates on the Jupyter homepage. Most nbextensions here should work fine with JupyterHub (because JupyterHub spawns regular notebook servers for each individual user), but won't work with JupyterLab (because the Javascript framework of JupyterLab is different from the notebook's, and is still rapidly changing under active development).

See also installing Jupyter

Notebook extension structure

Most of the nbextensions are stored in the repository each as a separate subdirectory of src/jupyter_contrib_nbextensions/nbextensions.

Each notebook extension typically has its own directory named after the extension, containing:

  • thisextension/thisextension.js - javascript implementing the nbextension
  • thisextension/thisextension.yml - file describing the nbextension to the jupyter_nbextensions_configurator server extension
  • thisextension/thisextension.css - optional CSS file, which may be loaded by the javascript
  • thisextension/README.md - readme file describing the nbextension in markdown format

A few (jupyter_highlight_selected_word, jupyter_latex_envs), exist as separate packages on pypi, which are included as dependencies of this package.

For further details, see the documentation at jupyter-contrib-nbextensions.readthedocs.io.

Contributing

To learn how to setup a development environment and for contribution guidelines, see CONTRIBUTING.md.

Changes

For changes, see the CHANGELOG.md

jupyter_contrib_nbextensions's People

Contributors

adrn avatar andyneff avatar benelot avatar bjanssen avatar bluss avatar brenns10 avatar brunobeltran avatar carreau avatar consideratio avatar damianavila avatar demotu avatar gabyx avatar hiiwave avatar jankatins avatar jcb91 avatar jcjaskula avatar jfbercher avatar jspenced avatar juhasch avatar kevin-mcisaac avatar kukanya avatar luckylsk34 avatar minrk avatar moble avatar shingo78 avatar soamaven avatar stanwest avatar tadaboody avatar tautvis avatar yacchin1205 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jupyter_contrib_nbextensions's Issues

How to vertically center cells in slidemode

The slidemode is working great and I have customized the CSS to increase the font size, etc. However, there is one thing that I can't figure out how to fix - is there a way to make sure the content of a slide is vertically centered

screen shot 2013-12-10 at 10 11 47 pm

Above you can see that for the title slide I have, the content is flushed to the top (like it is in the regular notebook). Is there an easy way to change that?

Issue with extensions assigning keyboard shortcuts

Has the location where the hotkeys are stored changed at all recently?

I'm getting errors from several of the extensions which attempt to assign keyboardcuts:

Uncaught TypeError: Cannot set property 'Alt-PGUP' of undefined navigation-hotkeys.js:11
Uncaught TypeError: Cannot set property 'Alt-C' of undefined comment-uncomment.js:11
Uncaught TypeError: Cannot set property 'Shift-Tab' of undefined

It looks like "IPython.hotkeys" doesn't exist when the extensions attempt to index into it.

Tested on IPython 1.1.0 and git (2013/11/26) on Arch Linux.

Codefolding silently failing

I have the codefolding files present:

$ls .ipython/profile_default/static/custom/codefolding/
codefolding.js  codefolding.py  firstline-fold.js  foldgutter.css  indent-fold.js

This is at the bottom of my custom.js:

$([IPython.events]).on('app_initialized.NotebookApp', function(){
    require(['/static/custom/codefolding/codefolding.js'])
    });

And yet starting a new notebook yields no new behavior. This is IPython 2.2. The python-markdown extension is also not working for me, so I suspect I'm doing something wrong. The executetime extension is working, but only if I load it in as an extension as a within the notebook.

Behavior doesn't change if I use the custom.example.js, uncommenting codefolding, executetime and python-markdown.


Profile directory: /home/jeffrey_alstott/.ipython/profile_default
Testing path /home/jeffrey_alstott/.ipython/profile_default/static/custom/custom.js
Found custom.js here: /home/jeffrey_alstott/.ipython/profile_default/static/custom/custom.js
And http://localhost:8888/static/custom/custom.js shows the correct custom.js file.


Update: Actually it looks like exectutetime is also giving incorrect results frequently.

printview-button not working

Hi,

I installed the printview_button.js extension and changed my custom.js file per the instructions.

Upon opening an ipython notebook, I see the new button, but pressing it has no effect.

Using nbconvert from the command line works fine.

OS: Windows 7

$: git rev-parse HEAD
1317d5e2a15b613ef41bb883cccda011826205cd
$: python
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import IPython
>>> IPython.version_info
(2, 0, 0, 'dev')
>>>
$: ipython nbconvert --to html .\test.ipynb
[NbConvertApp] Using existing profile dir: u'C:\\...\\profile_default'
[NbConvertApp] Converting notebook .\test.ipynb to html
[NbConvertApp] Support files will be in test_files\
[NbConvertApp] Loaded template html_full.tpl
[NbConvertApp] Writing 234944 bytes to test.html

Also, for my version of ipython, the attribute IPython.version in printview_button.js should probably be IPython.version_info.

read-only cell is not working

I don't know if this is the right place to report this. I am using IPython 2.X and I downloaded the read only extension from the 2.x branch and installed it. But the promised tool bar is never shown.

I managed to successfully install other extensions, so I don't know what can be the cause for this.

Issue with js syntax error in codefolding.js in 2.x branch

Hey,

Just wanted to let you know that there a couple of syntax errors that initially prevented me from properly loading codefolding.js in the 2.x branch. They're in line 29 (missing 'var' in front of 'p') and another missing 'var' on lines 91 and 102. After I fixed these lines it seemed to work fine. Hope this helps.

J

Some extension now need events

in particular SWC and init_cell need to be passed "base/js/events" and the call to register_preset updated. assigning me.

slidemode shows hidden cells when navigating backwards

When I run forward in a presentation using the "Next" button or the right arrow key, cells marked as "Notes" or "Skip" using the "Slide Type" cell toolbar are not shown.

But when I run backward using the left arrow key and cross a slide boundary, the whole previous slide is shown, including notes and skipped cells.

Cannot autoload extension

I can load an extension just fine in the notebook:

%%javascript
IPython.load_extensions('usability/autoscroll');

However, when I try to autoload (using the custom.example.js), It fails to load, and I get the following error in the JavaScript Console in my browser:

Uncaught TypeError: Cannot read property 'on' of undefined                custom.js:57

which points me to the lines in custom.js

require(["base/js/events"], function (events) {
    events.on("app_initialized.NotebookApp", function () {

Any thoughts? I'm currently using IPython 2.3.0-74.5, and using the notebooks in Chrome 36.0.1985.143

Can one copy/paste an entire section?

My notebooks are easily growing too large. I want to split part of it to another notebook. Currently I can only cut/paste per cell using the chrome_clipboard extension. Is multiple cell or section operation supported?

Hierarchical_Collapse collapses on IPython-specific shortcuts

The "x" cut-cell hotkey in IPython also triggers the collapse of a group of cells with the hierarchical_collapse extension running. Details:

On Windows machine, running Python 2.7.3, IPython 2.2, running notebooks extensions from the 2.x branch. Hierarchical_collapse is the only enabled extension.

slidemode feature request: global navigation shortcuts

I like to interact with the notebook while in slideshow mode. It's cumbersome to toggle between presentation mode and interactive mode using the mouse. It would be convenient if there were global shortcuts for navigating the slideshow in interactive mode.

I've used this Javascript cell as a work-around, but it would be nice to have this built in:

    %%javascript

    IPython.keyboard_manager.command_shortcuts.add_shortcut('left', {
        help : 'Slideshow back',
        help_index : 'slidemode',
        handler : function (event) {
            IPython.slideshow.prev();
            return false;
        }}
    );

    IPython.keyboard_manager.command_shortcuts.add_shortcut('right', {
        help : 'Slideshow forward',
        help_index : 'slidemode',
        handler : function (event) {
            IPython.slideshow.next();
            return false;
        }}
    );

    IPython.keyboard_manager.command_shortcuts.add_shortcut('space', {
        help : 'Slideshow forward',
        help_index : 'slidemode',
        handler : function (event) {
            IPython.slideshow.next();
            return false;
        }}
    );

codefolding incorrect path?

codefolding.js has includes loaded in from:

'/nbextensions/usability/codefolding/indent-fold.js',
'/nbextensions/usability/codefolding/firstline-fold.js'

and

load_css("/nbextensions/usability/codefolding/foldgutter.css");

but the documentation suggests locating codefolding dir as /static/custom/codefolding/ ?

Slidemode issues

From @fperez by mail

For certain notebooks, even if we mark cells as 'no type' after a 'slide' cell type, the 'no type' cells still get revealed only one at a time as if they were marked 'fragment'. Do you have any idea of what could be going on?

I was able to replicate it with an empty notebook and just adding a few cells, the first marked 'slide' and the others unmarked...

Save pasted images to file instead of base64 blob?

I'm new to IPython Notebook, but stumbled over this extension because of the image copy/paste support.
So my question is, would it be an idea to save the images to disk, to overcome the big fat blob issue? I saw "writefile" magic, wouldn't this be an available technique?
Or is this a security thing, because of running in a browser?

Thank you very much for sharing this work!
regards
Peter
(=PA=)

Extensions using notebook_loaded event are broken

for example: split-combine does not currently work.

The fix is easy, as it says in custom.js:

// do not use notebook loaded event as it is re-triggerd on
// revert to checkpoint but this allow extesnsion to be loaded
// late enough to work.

so just call init_keyevent() ie take it out of the event;

a couple of lines should change- this way it works with me

python-markdown pymdpreprocessor barfs when given a nonexistent variable

pymdpreprocessor.py fails with the following error when given a notebook where a markdown cell refers to a nonexistent variable:

  File "/home/unix/hussein/.ipython/nbextensions/pymdpreprocessor.py", line 44, in preprocess_cell
    cell.source = self.replace_variables(cell.source, variables)
  File "/home/unix/hussein/.ipython/nbextensions/pymdpreprocessor.py", line 23, in replace_variables
    replaced = re.sub("{{(.*?)}}", lambda m: variables[m.group(1)] , source)
  File "/python2.7/lib/python2.7/re.py", line 151, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: sequence item 3: expected string or Unicode, NotebookNode found

I'm running:
ipython nbconvert --profile=myprofile fail.ipynb

I'm using IPython 2.x. An example failing notebook is here.

Ipython can't find custom.js

I can't get Ipython to find my custom.js

When I start the Ipython notebook, and visits http://127.0.0.1:8888/static/custom/custom.js in my browser, I get the default file (located in /Users/allan/Library/Python/2.7/lib/python/site-packages/IPython/html/static/custom/custom.js on my system).

To sum up what I did to install these plugins, I think the command line actions will be the most efficent way to describe it ($ is my prompt):

$ ipython locate profile
/Users/allan/.ipython/profile_default

$ cd /Users/allan/.ipython/profile_default

$ git clone https://github.com/ipython-contrib/IPython-notebook-extensions.git ./static/custom
Cloning into './static/custom'...
[... some output here – cloning was a success ...]

Then I put this custom.js in /Users/allan/.ipython/profile_default, /Users/allan/.ipython/profile_default/static and /Users/allan/.ipython/profile_default/static/custom, just to be sure it's picked up (which location is the right one?).

Please help – where did I go wrong?

python-markdown doesn't work

I tried installing the python-markdown extnsions as the wiki suggested:

  • Copied the python-markdown.js and pymdpreprocessor.py to C:\Users\jschulz\.ipython\nbextensions
  • loaded a new notebook and put the following into the first cell
%%javascript
IPython.load_extensions('python-markdown');
  • got the following error in the javascript console:
    Failed to load extension(s): TypeError: message: "Cannot read property 'security' of undefined"

Afterwards my notebook is not useable anymore: I can't get into edit mode anymore (at least and starting to write 'import' omits 'i' and if a write something with 'a' I get a new cell above). This issue was also present after reloading the notebook and only went away after deleting the %%javascript cell.

I use the notebook from anaconda (ipython-notebook 2.1.0) and chrome.

Potential issue on returning Python string containing URL

Hey,

I'm really enjoying the NB extensions ... keep up the great work. I had a potential issue/question with python-markdown (2.7 series, using most recent version in that branch). I figured I'd post here (not sure if this is the "appropriate" place.)

I'd like to have a Python string variable that contains a URL turn into a clickable link in Markdown. If the python cell contains:

  URL = "[Google](http://www.google.com)"

and the Markdown cell contains

  {{URL}}

The link is rendered in the Markdown cell as:

  'Google'

but when I click the link, it asks to close the current Notebook page rather than opening Google in a new tab (If I put the raw markdown in the cell with no "{{}}"" then clicking 'Google' DOES open in a new tab as expected). Also the single quotes around the string also seem wrong. I'd like to just have the word appear as a hyperlink, if possible.

I notice in the python-markdown.js code that it appears that a "_blank" value is attached to the HTML target key (Line 106), but this doesn't seem to work. I'm not a javascript expert so rather than monkey around I thought I'd ask. Hopefully it's something simply I'm doing wrong.

Thanks for any help, and, again, I appreciate the effort.

~Zach

adding cell navigation (up, down)

in hotkeys.js this does the job if you insert them at the beginning of the document_keydown function (so pgup/down are not consumed by goto top/bottom of page):

    if (event.which == key.PGUP && event.altKey) {
        IPython.notebook.select_prev();
        IPython.notebook.scroll_to_cell(IPython.notebook.get_selected_cell());
        return false;
    };

    if (event.which == key.PGDOWN && event.altKey) {
        IPython.notebook.select_next();
        IPython.notebook.scroll_to_cell(IPython.notebook.get_selected_cell());
        return false;
    };

Live slideshow only shows cells marked as Slide or Sub-Slide

I'm trying to create a live slideshow using the slidemode extension. However, for some reason only cells marked as Slide or Sub-Slide are shown, all other cells are skipped. This means I can only have a single cell on each slide.

What I did:

  • Cloned this repo, as per instruction

  • Un-commented the following lines in custom.js:

    require(['custom/slidemode/main'],function(slidemode){
    // do stuff
    })

  • Created a notebook with the structure Slide, Fragment, Slide

  • Started the slideshow

Result: Only the Slide cells are shown. I can also mark the Fragment as - with the same result.

I'm using IPython 1.1.0, tried the slideshow on Chrome, Chromium, and Firefox.

Any help with getting this to work is highly appreciated. I was hoping to use the slide mode for a talk I'm giving tomorrow.

Not possible to install hierarchical_collapse

I am almost sure this is not the correct place to ask for help. However, I cannot find other. I want to have the functionality of hierarchical_collapse. However after fighting for several days I only have vague idea of what should be done. Unfortunately I am also new in ipython. I have successfully loaded gist, acording to the console log in chrome, after following the instructions in
https://github.com/ipython-contrib/IPython-notebook-extensions/wiki

I cloned the [email protected]:ipython-contrib/IPython-notebook-extensions.git repository, and copied the
but, once I try to do something similar with hierarchical_collapse, it says there is nothing to download. Moreover, in the console, I get a very simple message:

Failed to load extension(s): ["nbextensions/testing/hierarchical_collapse/main.js"]
Error: Script error for: nbextensions/testing/hierarchical_collapse/main.js http://requirejs.org/docs/errors.html#scripterror {requireType: "scripterror", requireModules: Array[1], originalError: Event, stack: (...), message: "Script error for: nbextensions/testing/hierarchica…http://requirejs.org/docs/errors.html#scripterror"}

although its there.
A similar behaviour with a simpler extension, namely cellstate.js:

Failed to load extension(s): ["nbextensions/testing/cellstate.js"]
Error: Script error for: nbextensions/testing/cellstate.js http://requirejs.org/docs/errors.html#scripterror {requireType: "scripterror", requireModules: Array[1], originalError: Event, stack: (...), message: "Script error for: nbextensions/testing/cellstate.j…http://requirejs.org/docs/errors.html#scripterror"}

If you cannot help me here, could you point me to a better place to seek help? Thanks!

Makeing extensions work in 2.x and 3.x

From 2.x to 3.x there were several changes, that mandate changes to notebook extensions:

  • require.js
  • Codemirror: mode-> mode.name , python->ipython
  • Fontawesome: ìcon-->fa-`

It seems there will be still some time until 3.0 is released, so we need some way to handle this.
Should we introduce a .2x branch where extensions for 2.x are located and use the master branch for 3.x ?

Feature Request: Commentability

After publishing an ipython notebook, make them side-comment able similar to the comment functionality in Google Docs. This would enable non-technical people to comment on published notebooks.

Support non-default base_url

Currently many of the extensions do not work with non-default base_urls (defaults to /). None of the installation instructions are accurate either. The require lines all need to be something like:

require([IPython.notebook.base_url + 'static/custom/blah.js']);

All paths in the extensions themselves need similar updating, replacing any leading / with IPython.notebook.base_url

A modicum of documentation would be nice

Based on the names of these extensions, they seem very interesting, but there is no documentation at all in any of the extensions, nor in the README.md files. Could someone take a few minutes and explain how you actually use one of these extensions that are in this github repo? There's (https://github.com/ipython/ipython/wiki/Extensions-Index), but that doesn't help for the extensions in this repo.

Thanks. I know documentation is not fun, but its necessary if you want people to use your code!

python-markdown loads but does not change rendering

Ive installed python-markdown as per this instruction. I've edited my custom.js file to load the extension automatically, and this seems to work fine: using the cells from here, the output of code block 8 (uncommenting the print statements) returns

Extensions: ['python-markdown']
Active: [True] 

However, if I write a test I just get the straight text back:

a = 2.2

(markdown cell)

My variable is equal to {{a}}

returns

My variable is equal to {{a}}

rather than the expected 2.2.

I've also tried loading the extension using the javascript magic, and this has the same behaviour.

I'm using an Anaconda installation:

3.3.5 |Anaconda 2.1.0 (x86_64)| (default, Sep 2 2014, 13:57:31)
[GCC 4.2.1 (Apple Inc. build 5577)]

Any ideas why the extension appears to load fine but fail to do anything?

Commited on 2.x :-(

Sorry I wanted to make a PR using github UI who apparently directly commited on 2.x :-(

The commit is small though: de9912e

Sincere apologies.

(closing immediately)

Improve help_panel

So help_panel basically work but should be improved.

  • is visible only for some browser window sizes and disappears if the window is too narrow
  • gets truncated if the window is not high enough. Should there be a scrollbar in this case ?
  • the table looks very plain.
  • invents new dict IPython.hotkeys
  • needs to initialize IPython.hotkeys=[]; in custom.js

Suggestions are welcome :-)

codefolding: Can't install

Hi,

I'm trying to install the codefolding plugin. I've copied into ~/.ipython/nbextensions/usability/codefolding. Afterwards I've added following to /.ipython/profile_default/static/custom.js:

// activate extensions only after Notebook is initialized
require(["base/js/events"], function (events) {
    $([IPython.events]).on("app_initialized.NotebookApp", function () {
        /* load your extension here */
        IPython.load_extension("usability/codefolding/codefolding");
    });
});

But my ipython document doesn't load. In browsers JS console I see:

Failed to load extension(s): ["nbextensions/usability/codefolding/codefolding"]
TypeError: IPython is undefined

Am I missing sth?

Cheers, Victor

Installing Extensions

Are the extension installing instructions up to date?

The instructions for the Miscellaneous IPython extensions use a different syntax:

copy the extension to the $(ipython locate)/nbextensions/ directory and load it by adding IPython.load_extensions('extension_name'); in custom.js

Could this also be applied top the extensions here?

Extra "next" click needed for hidden notes and skipped cells

When hitting the right arrow or clicking on the "Next" button, I see the following message in the JavaScript console:

cannot call methods on button prior to initialization; attempted to call method 'disabled'

In the browser, everything works ok except that whenever there's a "Notes" or "Skip" cell, nothing happens. It seems that the cell "counter" moves to the hidden cell, and only a second click reveals the next (non-hidden) cell.

To fix this, I made the following change to main.js:115:

this.progression = $('<button/>').addClass('btn').text(that.eta());

changed to

this.progression = $('<button/>').addClass('btn').text(that.eta()).button();

I think we need some kind of organization of extensions

Now, we have a lot of js extensions in a big bag... maybe we can split this repo in subgroups where the extensions are related in some way...

As an example, I have Nikola-related (or blog-related) extension to upload... maybe some Styling-related extensions, and so on... what do you think? @Carreau @juhasch

Problem in loading the "2.x/usability/init_cell" extension

Hello, has anyone tried to use the:

https://github.com/ipython-contrib/IPython-notebook-extensions/tree/2.x/usability/init_cell ?

Because it seems really nice but for me it doesn't work, i mean i can see the check box but as i understood another button should be created in the toolbar in order to run upon initialization but its not... and when i rerun/refresh/reopen the notebook/kernel/etc nothing happens.

I cannot find any documentation besides this:
http://nbviewer.ipython.org/github/Carreau/posts/blob/master/04-initialisation-cell.ipynb
Which is actually not very helpful,

P.S.: my env: Anaconda: 2.1.0 (x64) - Python 2.7.8 – IPython 2.3.1

Thank you in advance.

css_selector and zenmode not working

The Styling extensions appear to not be working well for me. css_selector creates a new dropdown menu, I assume to select different css styles, but the only option is "default". Zenmode does nothing; not even a button. Is there another step required to make those work?

Merged all notebook-extensions into one repo.

Hi guys,

I've merge My repo and @juhasch one, in here so that we can update each-other javascript extension.

I'll tried to use a subtree and the a git mv to keep the history and contributions. It seem to have worked.

I haven't fully merged the Readme, but things should still work the same as long as this is clone into the right place.

Files headers mentioning IPython devs...

Despite the fact of some contributors here are IPython core devs... I think is not good to keep the official header in the files mentioning them as part of the IPython project. This is not a real fact. I think we need to remove it to avoid future conflicts.
@juhasch @Carreau thoughts?

Can't get comment-uncomment.js to work

I followed the instructions to install comment-uncomment.js, but nothing seems to happen. Using the same instructions (from https://github.com/ipython-contrib/IPython-notebook-extensions/wiki) I managed to get another extension working (codefolding). The output of firefox js console lists:

"Default extension for cell metadata editing loaded." default.js:48
"Raw Cell Format toolbar preset loaded." rawcell.js:82
"Slideshow extension for metadata editing loaded." slideshow.js:43
"Loaded extension: usability/comment-uncomment" utils.js:26
"Session: kernel_created (d77d5123-b219-4e06-a1d9-0e5d5a598390)" session.js:52
"Starting WebSockets:" "ws://localhost:8888/api/kernels/345353e0-b0f8-416b-8dc5-ee50c49219e2" kernel.js:440
"Loaded extension: usability/codefolding/codefolding" utils.js:26
"Kernel: kernel_connected (345353e0-b0f8-416b-8dc5-ee50c49219e2)" kernel.js:102
"Kernel: kernel_starting (345353e0-b0f8-416b-8dc5-ee50c49219e2)" kernel.js:102
"Kernel: kernel_ready (345353e0-b0f8-416b-8dc5-ee50c49219e2)" kernel.js:102

I tried changind the shortcut to another sequence, as I supected ALT-C could be grabbed by the desktop environment (gnome 3.14.2), but nothing happens. I am following IPython development version (3.0.0-dev-2827-g5af7154).
Initially installed this extension because CTRL-/ didn't work. This a spanish keyboard layout

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.