IPython Magic for Displaying blockdiag family of diagrams in Jupyter notebooks
Install from PyPy: pip install blockdiagMagic
Install from this repo as:
pip install --upgrade git+https://github.com/innovationOUtside/ipython_magic_blockdiag.git
(Use %pip install --upgrade git+https://github.com/innovationOUtside/ipython_magic_blockdiag.git
from a notebook code cell.)
%load_ext blockdiag_magic
By defaul, PNG is generated.
Higher quality SVG is available, but in this magic, this requires inkscape. (The original blockdiag
package was updated to use imagemagick for SVG rendering so this magic meeds updating to make use of that.)
%setdiagsvg
#Reset to png output with: %setdiagpng
#For inline png
#%setdiagpng
%%blockdiag
A -> B -> C;
B -> D;
Save file:
%%blockdiag -o myfile.svg
top_page -> config -> config_edit -> config_confirm -> top_page;
Then render:
from IPython.display import SVG
SVG('myfile.svg')