[IPython-dev] notebook %magic

Brian Granger ellisonbg at gmail.com
Thu May 31 14:15:37 EDT 2012


On Thu, May 31, 2012 at 11:13 AM, Ralf Hemmecke <hemmecke at gmail.com> wrote:
> I learnt about this "magic" first time from the sage-notebook.
> Sage-notebook has/had a way to allow fricas to be running natively.
>
> It's now some time ago that I modified the underlying code in such a way
> that all cells would be of fricas type. In fact, the %magicword got into
> the way. In fricas %pi is an way to input a symbolic \pi. And that
> should not be considered something magic.
>
> Since at that time the magic was unimportant for me, I changed the magic
> % into %%% and that allowed me to switch to a sage type cell by putting
> %%%sage at the beginning of a cell.
>
> What I want to say by this is that sticking to % as the magic prefix is
> totally bad for my use case.
>
> 1) Is there a way to change the magic prefix from % to something user
> defined? It would be OK for me if this is done at startup of the
> notebook. I'm not sure for the ipython notebook, but I remember that in
> the sage-notebook the % prefix was actually stored inside the notebook
> itself without having a global setting at the beginning of the notebook
> to set this prefix character.

Because of how we implement magics in the kernel, this would not be possible.

> 2) What the default cell type is could maybe set at start time of the
> notebook server and then have (similar to the sage-notebook (as I knew
> it)) a menu that allows to select the default cell type.

I think these things will have to be set in the frontend, not the kernel/server.

Cheers,

Brian

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



-- 
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu and ellisonbg at gmail.com



More information about the IPython-dev mailing list