[IPython-dev] A thought about nbconvert

Matthias BUSSONNIER bussonniermatthias at gmail.com
Fri Nov 16 02:48:12 EST 2012


Le 16 nov. 2012 à 00:46, David Warde-Farley a écrit :

Hi David, 

> Hey Paul,
> 
> Hmm. So, two things:
> 
> - If I were to add it to the "simple" metadata editor (as is currently the case with slideshow stuff, I think?) wouldn't that force a key name?

This is one of the reason the Metadata UI is not moving forward right now. it is not made only for slideshow.
I would like to make it easily extendable. 
My first thought was that you could register a callback that get the current cell as first argument, and the div of the clicked button as second. 
So that you can do whatever you want (just toggle a value) or completely open a jQuery dialog.

The problem is  when does the metadata extension append ? is it through a Js plugin, or anytime a notebook is launched. 
The main problem with the second one is that it is hard to extend both already instantiated  metadata UI toolbar and class prototype.

Also if the metadata is modified by something else than the button, how is the button state updated ?

Eventually this UI might be used for touch device (cut, copy, past, run)... so we surely want to be able to at least partially load it. (hence jsplugin is hard) 
unless you only hide part with css.
(this is also something I want to talk to brian, because right now js plugin are always loaded and you might want to load them only at some point) 


As for the key name, you could use your own prefix. 
like stuff things in `nbconvert.conversionOption.whatever`, `nbconvert.conversionOption.anotherStuff`


> - similarly, fine-grained behaviour (code but not output, output but not code) seems hard to accomplish in a generic way.
You can also use 'notebook' and 'worksheet' level metadata.
this can be a global flag, which is 'merged' into each cell metadata at convert time to avoid all the 
`if metadata.nooutput or worksheet.metadata.nooutput :`

But if there is no global flag from command line, I'm fine with it, it could be a done programatically. As I wrote on the other PR let's build a good module, and having command line tool will be convenience.
-- 
Matthias


> 
> Thoughts?
> 
> David
> 




More information about the IPython-dev mailing list