Open sisukapalli opened 10 years ago
It's a good idea. I guess I would side with the automatically generated kind, generated from headers like on Wikipedia or some Markdown TOC implementations.
However, as you note, there might have to be some tricks to make the pieces of Markdown in different cells be numbered together. And also as you say, it would either require running the whole notebook or some sort of caching.
We are planning to have some sort of result/output caching like IPython has; perhaps this will help.
I have no idea how to get the numbering right in the face of cell reordering, but where there's a will...
Thanks about result caching note... It will make life very easy (and has additional benefits like publishing notebooks as html with some "representative results").
Fully agree about how hard it is to get numbering after reordering. The IPython stuff is pretty mundane and refreshes after rerunning the TOC generation. It is simple enough if we do not insist on realtime numbering.
I think it would be nice to have a Table of Contents (TOC) feature for a notebook. It will make the notebooks more easy to read and navigate. A user can click on an entry in the TOC and go to that cell. Numbering and sections hierarchy helps in organizing too.
I had to do this to share one messy set of shell scripts, documentation, csv files, python code, hive scripts, etc., and pulling them into a notebook helped me streamline the workflow and having a TOC helped me organize things easily. I had to do minor hacks with two modules in IPython (nbtoc and secnum extensions) to get the piece working. Now, I am able to export it as a static HTML with a reasonable layout...
It would be nice to have the TOC feature in RCloud. I am willing to adapt this logic. However, some logistics issues are present on what approach is best suited for RCloud. Many possible paths:
I included a screen shot from a toy notebook here. The layout is fairly simple but works (there is scope for substantial improvements -- typography, layout, etc.). Please note that I manually shrinked the plots in IPython to make the main cells fit the screen...
.