Giter VIP home page Giter VIP logo

Comments (32)

minrk avatar minrk commented on July 22, 2024

fixed.

from ipython_extensions.

jimaples avatar jimaples commented on July 22, 2024

I just found this and tried it out, I'm not seeing the text from my heading cells (Firefox 22.0 on Windows 7 if it matters)

from ipython_extensions.

minrk avatar minrk commented on July 22, 2024

Try fetching the nbtoc.js again.

from ipython_extensions.

dpsanders avatar dpsanders commented on July 22, 2024

With %install_ext nbtoc?

On Fri, Jul 26, 2013 at 9:26 AM, Min RK [email protected] wrote:

Try fetching the nbtoc.js again.


Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-21631718
.

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

[email protected]
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

from ipython_extensions.

minrk avatar minrk commented on July 22, 2024

%install_ext just downloads the Python file, but the frontend code lives in a javascript file that the Python file downloads from GitHub only if it doesn't exist. To ensure everything is up-to-date, try:

rm ~/.ipython/extensions/nbtoc.js
%load_ext nbtoc

from ipython_extensions.

arsenovic avatar arsenovic commented on July 22, 2024

I have followed the above instructions, but the headings still do not appear in the TOC.

from ipython_extensions.

dpsanders avatar dpsanders commented on July 22, 2024

Confirmed, still broken.
The section numbers are also still broken (after subsections?)
Will send a minimal example and screenshot later.

On Mon, Jul 29, 2013 at 8:55 AM, alex arsenovic [email protected]:

I have followed the above instructions, but the headings still do not
appear in the TOC.


Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-21729360
.

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

[email protected]
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

from ipython_extensions.

arsenovic avatar arsenovic commented on July 22, 2024

screenshot from 2013-07-30 12 02 26

from ipython_extensions.

minrk avatar minrk commented on July 22, 2024

Ha, I keep wondering what you guys are talking about, then I realized that I just forgot to push the fixes. Should be okay now:
screen shot 2013-07-30 at 11 22 45

from ipython_extensions.

arsenovic avatar arsenovic commented on July 22, 2024

just updated, but my side still doesnt seem to be working (although i did notice the toc index has changed to a mix of numbers and letters)

screenshot from 2013-07-30 15 12 13

from ipython_extensions.

dpsanders avatar dpsanders commented on July 22, 2024

Seems to be working great here! Thanks Min!

On Tue, Jul 30, 2013 at 2:13 PM, alex arsenovic [email protected]:

just updated, but my side still doesnt seem to be working (although i did
notice the toc index has changed to a mix of numbers and letters)

[image: screenshot from 2013-07-30 15 12 13]https://f.cloud.github.com/assets/1228240/881307/fdf8bf5c-f94b-11e2-8b73-fae8cd12756c.png


Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-21815297
.

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

[email protected]
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

from ipython_extensions.

arsenovic avatar arsenovic commented on July 22, 2024

@dpsanders , im still trying to get this working. would you describe for me what you did differently than is shown in the notebook above?

from ipython_extensions.

dpsanders avatar dpsanders commented on July 22, 2024

@arsenovic, I did:

cd ~/.ipython/profile_default/
rm nbtoc.*

then from within the notebook did

%install_ext https://raw.github.com/minrk/ipython_extensions/master/nbtoc.py
%load_ext nbtoc
%nbtoc

@minrk, I have recently been writing some long-ish notebooks, and this feature is absolutely essential for moving around them -- many thanks for implementing it! I really believe it should be more widely available, rather than having to know that it exists, find your personal repo, and then install it. Could it be shipped somehow in the core or as an immediately-available extension?

For example, would it be possible to do just %load_ext nbtoc and not have to then do additionally %nbtoc?

One suggestion: Could you add a "Refresh" link next to "Hide", directly on the TOC widget?
Maybe there could also be a way of removing the widget completely until %nbtoc is run again?
E.g. %nbtoc off

from ipython_extensions.

arsenovic avatar arsenovic commented on July 22, 2024

@dpsanders , thank you for your reply.

@minrk, i have tried to reproduce dpsanders instructions and attached a shot illustrating the failure on my end. ( I have hit the refresh button, as well.). Like dpsanders, I also have very long notebooks, and am very excited about getting this feature working.

screenshot from 2013-08-01 11 19 58

from ipython_extensions.

dpsanders avatar dpsanders commented on July 22, 2024

Hmmm, how strange.
Out of interest, which version of IPython are you using?
If you are using an old one, maybe you could try with the 1.0alpha that
just came out:

http://python.6.x6.nabble.com/ANN-IPython-1-0-0a1-td5025537.html

On Thu, Aug 1, 2013 at 10:23 AM, alex arsenovic [email protected]:

@dpsanders https://github.com/dpsanders , thank you for your reply.

@minrk https://github.com/minrk, i have tried to reproduce dpsanders
instructions and attached a shot illustrating the failure on my end. ( I
have hit the refresh button, as well.). Like dpsanders, I also have very
long notebooks, and am very excited about getting this feature working.

[image: screenshot from 2013-08-01 11 19 58]https://f.cloud.github.com/assets/1228240/894716/e29c181c-fabd-11e2-85de-12c84c49770b.png


Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-21944009
.

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

[email protected]
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

from ipython_extensions.

arsenovic avatar arsenovic commented on July 22, 2024

I am using the git master branch.

from ipython_extensions.

arsenovic avatar arsenovic commented on July 22, 2024

i happened to view the same notebook shown in the screenshot within chrome (on a windows pc) and saw that this was working as expected. So it appears to be something on the client side. i am running firefox on linux mint 14.

i have restarted the browser and refreshed the page.

from ipython_extensions.

dpsanders avatar dpsanders commented on July 22, 2024

Ah, so it's a problem with Firefox? Apparently it causes a lot of rendering
headaches. Do people really still use it? ;)

On Fri, Aug 2, 2013 at 7:12 AM, alex arsenovic [email protected]:

i happened to view the same notebook shown in the screenshot within chrome
(on a windows pc) and saw that this was working as expected. So it appears
to be something on the client side. i am running firefox on linux mint 14.

i have restarted the browser and refreshed the page.


Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-22001868
.

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

[email protected]
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

from ipython_extensions.

dpsanders avatar dpsanders commented on July 22, 2024

Confirmed Alex's experience: the problem (no titles displayed in nbtoc)
is present on Firefox 22 on Mac OS Mountain Lion.

At least we have found the solution -- I will be uninstalling Firefox again!

On Fri, Aug 2, 2013 at 8:32 AM, David P. Sanders [email protected]:

Ah, so it's a problem with Firefox? Apparently it causes a lot of
rendering headaches. Do people really still use it? ;)

On Fri, Aug 2, 2013 at 7:12 AM, alex arsenovic [email protected]:

i happened to view the same notebook shown in the screenshot within
chrome (on a windows pc) and saw that this was working as expected. So it
appears to be something on the client side. i am running firefox on linux
mint 14.

i have restarted the browser and refreshed the page.


Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-22001868
.

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

[email protected]
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

[email protected]
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

from ipython_extensions.

arsenovic avatar arsenovic commented on July 22, 2024

installed chrome and confirmed that it works as expected, so its defitely a firefox problem, not OS specific.

also, it would be nice if the TOC was saved with the notebook, so that it would be present when frst opening a notebook, as opposed to forcing %nbtoc to be executed. I am not sure if this is possible. but the main reason would be for this extension to work with read-only mode (although i know its disabled at the moment ipython/ipython#1953 )

from ipython_extensions.

jakobgager avatar jakobgager commented on July 22, 2024

@minrk is there a change you get this running on firefox as well? It works perfectly in chrome but not in firefox (23) (see posts above). It seems as if there is some JS issue. Unfortunately, I have no experience in JS to help here.
Thank you for this great extension!

from ipython_extensions.

jakobgager avatar jakobgager commented on July 22, 2024

A quick hack would be to replace the innerText call (new_a.text(h[0].innerText;) with a textContent
call (new_a.text(h[0].textContent);) in nbtoc.js. This works with FF and Chrome however, both show this ugly new line character (¶) in the rendered toc.
screen
I have no idea how to get rid of this one.

from ipython_extensions.

minrk avatar minrk commented on July 22, 2024

it should now be Firefox friendly.

from ipython_extensions.

jakobgager avatar jakobgager commented on July 22, 2024

Works like a charm! I really wonder, why this is not in the master branch. I use it now for just a few hours and it makes working with notebooks a real pleasure!
Thank again!

from ipython_extensions.

jakobgager avatar jakobgager commented on July 22, 2024

Following your code, it might be a good idea to remove the script part as well:
hclone.find('script').remove();
This way Mathjax items are not doubled (code + rendering).

from ipython_extensions.

arsenovic avatar arsenovic commented on July 22, 2024

+1 to including in the master.
would also be cool if including the extension in the configuration made it active on all notebooks, so you dont have to manually add it to every page..

from ipython_extensions.

untom avatar untom commented on July 22, 2024

Are you sure that this is fixed? It doesn't work for me on Chromium 28:

nbtoc

from ipython_extensions.

jakobgager avatar jakobgager commented on July 22, 2024

@untom You are right! Unfortunately the last change (58599f0) broke it, try this one: 93193cd, maybe with my addition from above.

from ipython_extensions.

minrk avatar minrk commented on July 22, 2024

works fine in master, and I added %update_nbtoc so you can ensure you are up-to-date on its various components.

from ipython_extensions.

untom avatar untom commented on July 22, 2024

Yes, the new version seems to work for me as well, however the links are not clickable (they're plain text, not hyperlinks).... I'm currently testing on a machine that only has IPython 0.13.2 installed, might that be the reason?

from ipython_extensions.

minrk avatar minrk commented on July 22, 2024

it might - I only test on and support >= 1.0.

from ipython_extensions.

jakobgager avatar jakobgager commented on July 22, 2024

Yeah strange! I completely reinstalled the new one, and it works again flawlessly. Guess i had to refresh more thoroughly. Anyway works fine here, with 1.0
Sorry for the noise, and thanks for your efforts!

from ipython_extensions.

Related Issues (20)

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.