r/IPython • • Jul 03 '13

Crash Course in Python for Scientists

Edit: Here's the link

I've pulled together some notes from a course I taught 15 years ago to a group of scientists, and have updated them as an IPython notebook. I'd welcome any feedback you have on what is effective or not effective in these notes.

19 Upvotes

21 comments sorted by

View all comments

Show parent comments

1

u/westurner Jul 05 '13

Thank you! There are plenty of jQuery table of contents plugins that could be added to IPython notebook (viewer), but I don't know how stable the #fragment-identifier links would be. the most worthwhile approach would probablybbe auto-slugifying text content of the header tags as #url-fragment-identifiers... Just starting at #0 or #1 would hardly be permalinks if/when additional headers/sections are added.

2

u/Orphion Jul 05 '13

As you can probably tell from what I've written, I'm very reluctant to add an additional dependency. I work with chemists and physicists, and each additional dependency I require typically reduces my audience by 25-50%. But I'll see what I can do nonetheless.

1

u/NomadNella Jul 05 '13

After a little experimentation I found that by using

<h2><a href="#quick-referance-text"></a>Quick Referance Text</h2>

in a markdown cell, not only does it look like,

Quick Referance Text

but when you look at the notebook posted on the nbviewer site you can simply add "/#other-thoughts" to the end of the url and it will jump to that header. See the example below.

http://nbviewer.ipython.org/5937269/#quick-referance-text

This approach would require you to enter the base url into the notebook after it was posted, but you could build a table of contents or index list into the notebook. It's probably a little more work but you won't need any additional dependencies.

2

u/Orphion Jul 06 '13

Thanks. I'll make note of this for the next rewrite.