ipython-contrib / jupyter_contrib_nbextensions

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

Codefolding silently failing #110

Closed jeffalstott closed 10 years ago

jeffalstott commented 10 years ago

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.

Carreau commented 10 years ago

Can you have a look at the javascript console of the browser? Also be sure to use the 2.x branch of this repository.

jeffalstott commented 10 years ago

Ah, but I am using 3.x :-) Is the 3.x stuff likely not working?

Here is the javascript console:

Default extension for cell metadata editing loaded.
Raw Cell Format toolbar preset loaded.
Slideshow extension for metadata editing loaded.
Uncaught TypeError: Cannot read property 'on' of undefined custom.js:8
patching CM for undefined indent
Kernel started:  a2cccb1e-cbb8-492f-b929-625d1b3bc3a6
Starting WebSockets:
ws://localhost:8888/api/kernels/a2cccb1e-cbb8-492f-b929-625d1b3bc3a6
GET http://localhost:8888/static/components/underscore/underscore-min.map
404 (Not Found) :8888/static/components/underscore/underscore-min.map:1
GET http://localhost:8888/static/components/backbone/backbone-min.map 404
(Not Found)

On Thu, Oct 9, 2014 at 6:12 PM, Matthias Bussonnier < notifications@github.com> wrote:

Can you have a look at the javascript console of the browser? Also be sure to use the 2.x branch of this repository.

— Reply to this email directly or view it on GitHub https://github.com/ipython-contrib/IPython-notebook-extensions/issues/110#issuecomment-58488906 .

Carreau commented 10 years ago

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

This is probably the culprit, probably an IPython variable not yet defined.

branch 2.x of this repo is for IPython 2.x and branch 3.x for IPython 3.x, it is likely that one does not work with the other.

jeffalstott commented 10 years ago

Good thing I'm pulling from master, which I understand is 3.x.

"This is probably the culprit, probably an IPython variable not yet defined." Thanks! What would be the next step? I'm just using the custom.example.js.

Carreau commented 10 years ago

Ok, I'm lost. Are you using extension 3.x or IPython 3.x or both ?

jeffalstott commented 10 years ago

Ah, I misunderstood! I'm using PYTHON 3.x. IPython 2.2. I was confused why Python 2.x would matter, and why you'd maintain a separate branch for it. I will try out the 2.x branch tomorrow.

Carreau commented 10 years ago

Ah, ok, sorry for the missunderstanding. Hopefully we will be at IPython 4.0 before Python 4 :-)

damianavila commented 10 years ago

Jajaja

jeffalstott commented 10 years ago

Things are working now, thanks!

A quick question, though: 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?

damianavila commented 10 years ago

They probably got old, I am not using it lately... I will try to look into the zen mode soon...

juhasch commented 10 years ago

Please open a new issue for zen mode. Closing this one.