[IPython-dev] First experiences and usability suggestions for notebook and nbconvert

Jonathan Frederic jon.freder at gmail.com
Tue Jul 16 13:45:33 EDT 2013


Hi David,

The team and I are working on these issues right now.  There is a pull
request (PR), under review, that will alleviate some of the nbconvert
problems you mention (see https://github.com/ipython/ipython/pull/3607)

>From the PR, this is how nbconvert will be called:

"

   ipython nbconvert notebook*.ipynb
   ipython nbconvert notebook1.ipynb notebook2.ipynb
   ipython nbconvert # this will use the config file to fill in the notebooks

"

I don't know all of the details, but I can provide some comments to your
email in-line with regard to nbconvert (as seen below).

Thank you so much for spending the time to send some feedback,
Sincerely,

Jon


On Tue, Jul 16, 2013 at 8:56 AM, David P. Sanders <dpsanders at gmail.com>wrote:

> Hi,
>
> I have been playing with the notebook and nbconvert from master, and have
> some feedback on some basic usability issues, which I hope will be useful.
>
> Note that I am not (yet) a developer, but am rather trying to get a feel
> for things before possibly moving in that direction...
>
> Please let me know if this is not the correct forum for such comments, and
> if I should, for example, instead open issues.
>
>
> 1. Ipython command line invocation
> - Would it be possible to get rid of the hyphens in --pylab and --profile
> in the ipython invocation? I understand that this is to do with
> implementation, but it is neither easy to remember, nor to motivate to
> novices that they should type this!
>
>
Flags like this can be set in config files if you need them every time you
work in a particular environment.



>
> - Is there a good (non-historical) reason to use 'nbconvert' instead of
> just
> ipython convert TARGET FILENAME?
> Or even convertnb,  so that the verb and noun are in the natural order.
>
> Or make nbconvert just a separate binary (which, I understand, it
> basically is anyway, at least on unices):
>
>
It was like this for a long time time prior to being merged into master
recently.


> nbconvert TARGET FILENAME?
>
>
> -  Is it possible / easy to set up bash completion to press <TAB> after
> 'ipython' and have the options displayed?
>
>
> - It would great to be able to type
> ipython notebook odes.ipynb
> and have the relevant ipynb open directly, instead of going via the
> dashboard
>
>
> 2. nbconvert:
> - It would be great (necessary, in my opinion) to have an 'Export as'
> option from within the notebook to run the relevant nbconvert.
>
>
That is planned, but not for 1.0


>
> - PDF converter:
> A direct PDF converter is necessary.
> This is presumably trivial by just running
> pdflatex after the LaTeX converter.
> (Oh, if LaTeX is installed of course... I guess this is the problem?)
>
>
We were think of generating and writing a make file to the output directory
that would build the pdf.


>
> - html converter:
> I tried
> ipython nbconvert html odes.ipynb
>
> but it doesn't work!
>
> I strongly suggest to replace 'full_html' with just 'html'
> and 'simple_html' could be 'basic_html'
>

Ah, good suggestion, I'll see what the others think of this.


>
> - I was expecting that the HTML output would look exactly like on
> nbviewer, which is also a static copy of the notebook, but it looks
> different
> I guess this is a CSS thing -- is there a good solution to have something
> exactly like on nbviewer?
>
>
I don't know the answer to that, Matthias may know.  He is actively
developing nbviewer and I believe he wrote the html templates that exist
now...

- The nbconvert step produced an empty subdirectory 'odes_files' with html
> export and some .txt files for LaTeX output. This seems unnecessary from
> the user point of view.
>
>
This will change with the PR


> - Folding:
> In my notebook, the output of several cells were folded, in particular the
> result of things like
> help(odeint)
> [I am planning on using this for a course, and wanted to record this step
> in the notebook]
> But in the result of nbconvert, the full output of the documentation is
> shown.
>
> This is very bad news -- how can the output folding be respected and not
> shown?
>
>
I don't think a pre-canned feature exists to do this at the moment.  It can
be done by writing a transformer.


>
> - New LaTeX commands:
> I defined various LaTeX shortcuts like
> \newcommand{\yy}{\mathbf{y}}
> inside $$...$$ in markdown cells.
> (Is this the correct / canonical way to do this?)
>
> Markdown seems to respect these in the rest of the document, and in the
> HTML output, but running
> pdflatex on the LaTeX output forgot about them immediately after they were
> defined.
>
>
This will have to be looked into.  I don't know why the Latex isn't being
passed through into the template.


>
> - Suppressing code cells in LaTeX output:
> Towards the reproducible paper goal, how can code cells be suppressed in
> the LaTeX output. I guess with the metadata somehow?
>
>
A transformer or a custom template

______________________________
>
> _________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev



On Tue, Jul 16, 2013 at 10:33 AM, David P. Sanders <dpsanders at gmail.com>wrote:

>
>
>> - It would great to be able to type
>> ipython notebook odes.ipynb
>> and have the relevant ipynb open directly, instead of going via the
>> dashboard
>>
>>
> Further to this comment:
>
> At the moment, my default behaviour is *not* usually to want a list of the
> notebooks in the current directory, but simply to start writing stuff in
> the notebook, just like I would if I ran 'ipython' from the command line.
>
> Maybe there could be an explicit option
>
> ipython notebook dashboard
>
> or
>
> ipython notebook list
>
> to get the dashboard behaviour.
>
>
> [--snip]
>
>
>> - Folding:
>> In my notebook, the output of several cells were folded, in particular the
>> result of things like
>> help(odeint)
>> [I am planning on using this for a course, and wanted to record this step
>> in the notebook]
>> But in the result of nbconvert, the full output of the documentation is
>> shown.
>>
>> This is very bad news -- how can the output folding be respected and not
>> shown?
>>
>
>
> This seems to be a more general problem: if I hide the output of a cell in
> the notebook, save and close, and reopen the same notebook, then the output
> appears in full. This seems to me to be an actual bug. I will (look for
> and) open an issue.
>
> David.
>
>
>
>>
>>
>> - New LaTeX commands:
>> I defined various LaTeX shortcuts like
>> \newcommand{\yy}{\mathbf{y}}
>> inside $$...$$ in markdown cells.
>> (Is this the correct / canonical way to do this?)
>>
>> Markdown seems to respect these in the rest of the document, and in the
>> HTML output, but running
>> pdflatex on the LaTeX output forgot about them immediately after they were
>> defined.
>>
>>
>> - Suppressing code cells in LaTeX output:
>> Towards the reproducible paper goal, how can code cells be suppressed in
>> the LaTeX output. I guess with the metadata somehow?
>>
>>
>> 3. Notebook issues:
>> - Keyboard shortcuts:
>> I am a keyboard person: for me, all functionality which is accessible via
>> menus should be assigned a (preferably modifiable) keyboard shortcut.
>> In particular, it seems that split cell, merge cell, and close and halt
>> are
>> currently missing shortcuts.
>>
>> - Similarly, could there be toolbar icons for split and merge?
>>
>> - Basic find and replace in the notebook:
>> Find and replace, at least a basic one, is a must-have feature for
>> refactoring.
>> This seems to already be available in CodeMirror
>>
>> -  In-place file editing
>> It seems that by combining the %load and %%file magics,
>> one has a kludgy way of editing an arbitrary file.
>> Maybe this could be combined easily into an %%edit magic?
>>
>> - Is there a way of deleting multiple input cells simultaneously, rather
>> than pressing Ctrl M-d several times or clicking the scissors icon several
>> times (which admittedly is easier in this case). This would be very nice
>> to
>> have
>>
>>
>> 4. Notebook styling:
>> - There seems to be much appetite for notebook styling, e.g. xkcdify.
>>
>> Here is a gist I found, referenced from a blog post that Brian commented
>> on
>> at some point, with a very basic interface. Something like this would be
>> great to have, with a user-contributed style database:
>>
>> https://gist.github.com/aflaxman/5707238
>>
>> Maybe this could just be via load_ext?
>>
>> By the way, is there a list of the possible extensions available?
>>
>> - Will Min's nbtoc extension be integrated?
>>
>>
>> Apologies for the long message, but these are the things that have been
>> bugging me for the last few days :)
>>
>> Thanks and best wishes,
>> David.
>>
>>
>> --
>> **************************************************************************
>> Dr. David P. Sanders
>>
>> Profesor Titular A / Associate Professor
>> Departamento de F?sica, Facultad de Ciencias
>> Universidad Nacional Aut?noma de M?xico (UNAM)
>>
>> dpsanders at gmail.com
>> http://sistemas.fciencias.unam.mx/~dsanders
>>
>> Cub?culo / office: #414
>>
>> Tel.: +52 55 5622 4965
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL:
>> http://mail.scipy.org/pipermail/ipython-dev/attachments/20130716/487ab363/attachment-0001.html
>>
>> ------------------------------
>>
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
>> End of IPython-dev Digest, Vol 114, Issue 38
>> ********************************************
>>
>
>
>
> --
> **************************************************************************
> Dr. David P. Sanders
>
> Profesor Titular A / Associate Professor
> Departamento de Física, Facultad de Ciencias
> Universidad Nacional Autónoma de México (UNAM)
>
> dpsanders at gmail.com
> http://sistemas.fciencias.unam.mx/~dsanders
>
> Cubículo / office: #414
> Tel.: +52 55 5622 4965
>
>
> _______________________________________________
> 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/20130716/dab86307/attachment.html>


More information about the IPython-dev mailing list