<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Feb 14, 2015 at 11:55 AM, Anton Akhmerov <span dir="ltr"><<a href="mailto:anton.akhmerov@gmail.com" target="_blank">anton.akhmerov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi everyone,<br>
<br>
I need the same functionality (programmatic access of the notebook)<br>
for the following: I want to make an auto-toc function, which would<br>
generate toc inside the notebook (so not like min's extension). The<br>
reason why an extension doesn't suit me, is because I want everything<br>
to work in e.g. nbviewer. Do I understand correctly that I need to<br>
communicate with Javascript?<br></blockquote><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div><a href="https://www.youtube.com/watch?v=YbM8rrj-Bms">https://www.youtube.com/watch?v=YbM8rrj-Bms</a><br></div><div><br></div><div>-Doug</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Thanks,<br>
Anton<br>
<div class=""><div class="h5"><br>
<br>
On Sat, Feb 14, 2015 at 4:40 PM, John Omernik <<a href="mailto:john@omernik.com">john@omernik.com</a>> wrote:<br>
> Basically, I am trying to have some helper magic functions that fill<br>
> in code for me.  I've bene able to achieve this through putting two<br>
> lines into one cell :) Thanks though, (I feel kinda silly that I had<br>
> to ask :)<br>
><br>
> On Fri, Feb 13, 2015 at 4:48 PM, Thomas Kluyver <<a href="mailto:takowl@gmail.com">takowl@gmail.com</a>> wrote:<br>
>> On 13 February 2015 at 12:22, John Omernik <<a href="mailto:john@omernik.com">john@omernik.com</a>> wrote:<br>
>>><br>
>>> So there is not a way to programmatically add a couple of cells in<br>
>>> iPython Notebook?<br>
>><br>
>><br>
>> Not really from the kernel, where the user's code is executed. The idea is<br>
>> that the code in the notebook doesn't know about the notebook document.<br>
>><br>
>> What are you trying to achieve, in a larger sense? We may be able to suggest<br>
>> another way to do it.<br>
>><br>
>> Thomas<br>
>><br>
>> _______________________________________________<br>
>> IPython-dev mailing list<br>
>> <a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
>> <a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
>><br>
> _______________________________________________<br>
> IPython-dev mailing list<br>
> <a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
> <a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
</div></div></blockquote></div><br></div></div>