[IPython-dev] custom web notebook cells

Matthias BUSSONNIER bussonniermatthias at gmail.com
Sat Dec 15 16:42:56 EST 2012


Le 15 déc. 2012 à 22:31, Jason Grout a écrit :

> On 12/15/12 1:37 PM, Brian Granger wrote:
> 
>> I have started to become very concerned about the metadata.  Our
>> thinking so far has been: that metadata is complete unstructured.
>> IOW, users can write to the metadata section whatever they want.  When
>> nobody is doing that it works fine, but as more people start to use
>> the metadata, it is going to turn into the wild west.  There will be
>> conflicting metadata.  There will backwards incompatibilties.  We will
>> allow this for a while, but when users start to complain that there
>> notebooks don't work as expected, we will have to become extremely
>> conservative about the metadata.
>> 
>> Case in point: we are about to add a slideshow section to the cell
>> level metadata.  And the notebook UI will rely on this metadata being
>> in a very particular format.  If we *ever* change that metadata in the
>> future, we will have to increment the notebook document format version
>> to reflect it.  Some changes (adding a new attribute) won't be
>> backwards incompatible, but some might be and it will affect the
>> entire notebook document format.
> 
> Is the solution (to quote python zen): "Namespaces are one honking great 
> idea -- let's do more of those!"?
> 
> Suppose the metadata dictionary is actually a key-value store where the 
> key is the namespace for the metadata.  You reserve the "ipython" key, 
> so that it is safe to make rigid rules and assumptions about anything in 
> metadata['ipython'].  Allow others to make arbitrary other metadata 
> namespaces and values.

I suppose we could also do that, but the difference is, we don't yet expose official way for plugins to manipulate 
what is not in metadata, whereas this IPython namespace would be accessible, so will became a de-facto standard 
link to the notebook format version number, and people will try to mess with it.

Also we are currently writing the doc and we already strongly encourage people to use namespace, 
still we do not enforce it as we are actually building 2 project that would be using the same metadata structure. 
-- 
Matthias


> Thanks,
> 
> Jason
> 
> 
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev




More information about the IPython-dev mailing list