-
A line must start with a magic in order to be interpreted as a magic.
-
Magics can be nested within a line
-
Magics can return any object they like (but it should be JSON-dumpable)
-
If no valid magic is found, the block will be considered code and handled by the kernel.
-
Help magic is special:
- It can be at the end of the line and takes precedence.
- No code is executed when a help magic is present.
How do we handle mixed cells, like this:
a = 1;
%download somefile.txt
b = 2;
!ls -a
%%octave
a = 1;
%set b !ls -a
c = 2;