[IPython-dev] set_next_input() multiple times

Doug Blank doug.blank at gmail.com
Sat Feb 14 12:18:50 EST 2015


On Sat, Feb 14, 2015 at 11:55 AM, Anton Akhmerov <anton.akhmerov at gmail.com>
wrote:

> Hi everyone,
>
> I need the same functionality (programmatic access of the notebook)
> for the following: I want to make an auto-toc function, which would
> generate toc inside the notebook (so not like min's extension). The
> reason why an extension doesn't suit me, is because I want everything
> to work in e.g. nbviewer. Do I understand correctly that I need to
> communicate with Javascript?
>

Yes, you probably want to do this with Javascript. But there is probably
nothing that needs to be done after you create the TOC, if you create
standard markdown cells.

Here is an extension that creates (or updates) the TOC when you click on
it. It doesn't auto-update as you change headings, but you could probably
easy make such an extension. Also shown numbering, and section moving. Has
been updated to work with IPython 3.

https://www.youtube.com/watch?v=YbM8rrj-Bms

-Doug



>
> Thanks,
> Anton
>
>
> On Sat, Feb 14, 2015 at 4:40 PM, John Omernik <john at omernik.com> wrote:
> > Basically, I am trying to have some helper magic functions that fill
> > in code for me.  I've bene able to achieve this through putting two
> > lines into one cell :) Thanks though, (I feel kinda silly that I had
> > to ask :)
> >
> > On Fri, Feb 13, 2015 at 4:48 PM, Thomas Kluyver <takowl at gmail.com>
> wrote:
> >> On 13 February 2015 at 12:22, John Omernik <john at omernik.com> wrote:
> >>>
> >>> So there is not a way to programmatically add a couple of cells in
> >>> iPython Notebook?
> >>
> >>
> >> Not really from the kernel, where the user's code is executed. The idea
> is
> >> that the code in the notebook doesn't know about the notebook document.
> >>
> >> What are you trying to achieve, in a larger sense? We may be able to
> suggest
> >> another way to do it.
> >>
> >> Thomas
> >>
> >> _______________________________________________
> >> IPython-dev mailing list
> >> IPython-dev at scipy.org
> >> http://mail.scipy.org/mailman/listinfo/ipython-dev
> >>
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev at scipy.org
> > http://mail.scipy.org/mailman/listinfo/ipython-dev
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150214/dd369ad5/attachment.html>


More information about the IPython-dev mailing list