I've been trying to sell Leo-as-a-notebook for some time now. I glad to
see you are starting to get the idea at last! Remember, with VR3 you can
render an entire tree starting with the current node; by locking the view
you can navigate to and edit a node without having the rendered view jump
out from under you.
Jupyter has many strengths and capabilities that I don't see Leo ever
getting. Perhaps they aren't needed for your use.
On Friday, December 13, 2024 at 7:36:48 AM UTC-5 Edward K. Ream wrote:
> The conversion script shows the power of Leo's scripting API. Here are the
> lines that clean newly imported files:
>
> def is_pure_python(p) -> bool:
> return not any(
> line.startswith('# %% [markdown]')
> for p2 in p.self_and_subtree()
> for line in g.splitLines(p2.b)
> )
> ...
> # Delete the useless Jupyter boilerplate.
> for child in p.children():
> if child.h == g.angleBrackets(' prefix '):
> child.doDelete()
> break
> p.b = p.b.replace(g.angleBrackets(' prefix ') + '\n', '')
> if is_pure_python(p):
> # Change the language and remove all jupytext comments.
> p.b = p.b.replace('@language jupytext', '@language python')
> for child in p.children():
> child.b = child.b.replace('# %%\n\n', '').replace('# %%\n', '')
>
> Disable these lines to retain two-way compatibility with Jupyter Notebooks.
>
> Onward to studying math!
>
> Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/leo-editor/9040e29e-f6db-451f-bf0a-251585c43610n%40googlegroups.com.