.. _jupytercustommagicsrst: =================================== 2A.soft - Custom Magics for Jupyter =================================== .. only:: html **Links:** :download:`notebook `, :downloadlink:`html `, :download:`python `, :downloadlink:`slides `, :githublink:`GitHub|_doc/notebooks/2a/jupyter_custom_magics.ipynb|*` The following example shows how to define custom logic to your notebooks. You will find more details here: `Defining your own magics `__. It works pretty simple. I just defined the magic commands ``%ENSAEl``, ``%%ENSAEb`` and both ``%ENSAE``, ``%%ENSAE``. .. code:: ipython3 %load_ext ensae_teaching_cs.td_2a.custom_magics The code of ``ENSAEl`` is available on `ensae_teaching_cs/td_2a/custom_magics.py `__. .. code:: ipython3 %ENSAEl site .. raw:: html ENSAE TD The code of ``ENSAE`` is also available on `ensae_teaching_cs/td_2a/custom_magics.py `__. .. code:: ipython3 %ENSAE blog .. raw:: html blog You can download a file: .. code:: ipython3 %ENSAE download stations.txt .. parsed-literal:: 'stations.txt' Will you be able to make yours?