Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design outline #2

Open
agoose77 opened this issue Sep 13, 2021 · 1 comment
Open

Design outline #2

agoose77 opened this issue Sep 13, 2021 · 1 comment

Comments

@agoose77
Copy link
Owner

agoose77 commented Sep 13, 2021

My current approach is to use a two-pronged approach:

  1. A "passive" markdown renderer that expands {{ expr }} calls into <input type="hidden" value="expr"> nodes. This is done using a jupyterlab-markup renderer. These nodes are then replaced by the Markdown cell with the result of rendering mime-bundles stored in the cell attachments. There are issues here with formatting etc, but we can work out the details later!
  2. An executor that stores the result of these expressions into the cell attachments.

There are going to be some tricky issues w.r.t to UX to sort out here, but for now this is quick to get up and running.

@agoose77
Copy link
Owner Author

This design has been further delineated into separate components:

graph LR;

markup[Markdown Source]-->markup_expr[jupyterlab-markup-expr*]
markup_expr-->html[HTML Output]
html-->imarkdown[Interactive Markdown]
Loading

There is now an optional jupyterlab-markup-expr extension that parses the Markdown for {{ expr }} syntax, and outputs special HTML input nodes of the form

<input type=hidden class=eval-expr value=" expr ">

jupyterlab-imarkdown only concerns itself with rendering these HTML elements, meaning that you can bring your own parser for different syntax variants without needing to disable the built-in extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant