pidgy
magics¤
pidgy
provides magics to introspect parts of the literate computing process.
-
%%parse
- parse markdown in
markdown-it-py
tokens
-
%%tangle
- parse then translate markdown to python
-
%%weave
- display the markdown as an interactive, templating display
-
%%pidgy
- executed the
%%tangle
python code and display the%%weave
of the markdown
activate the magic extension¤
the magics are automatically activated in pidgy
mode. the pidgy.magics
extension can be used to partially opt-in to pidgy
.
%reload_ext pidgy.magics
cell magics are an IPython
convention not generally available in python
that help with interactive computing.
%%parse
`%%parse` helps to peek at the tokens that make up the markdown.
markdown as python¤
%%tangle
class tangle:
the `%%tangle` magic exists to interrogate how markdown transforms to python using `pidgy`s heuristics.
when this magic is used, none of the code is executed.
assert "tangle" not in locals(), F"{tangle} is registered"
weave
magics¤
it is possible to use pidgy
s interactive display features without going full on.
displays in weave
are interactive jinja2
templates.
interactively displaying the markdown¤
%%weave
<hr/>
def pidgy():
`%%pidgy` is parts of `%%tangle` and `%%weave`.
<hr/>
def pidgy():
%%pidgy
is parts of %%tangle
and %%weave
.
pidgy
without the extension¤
%%pidgy
<hr/>
def pidgy():
`%%pidgy` is parts of `%%tangle` and `%%weave`.
<hr/>
def pidgy():
%%pidgy
is parts of %%tangle
and %%weave
.