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

🔨 Add support for user-expressions #742

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

agoose77
Copy link

@agoose77 agoose77 commented Apr 17, 2024

@flying-sheep nice to stumble across you in a different context!

We've had a couple of requests from our users for user-expressions support in the MyST space (Jupyter Book or MyST-MD):

I'm sure there are more that I've been unable to find.

We use this little-known part of the Jupyter kernel protocol to execute "expressions" (c.f. https://mystmd.org/guide/quickstart-jupyter-lab-myst#inline-expressions), e.g.

The result of 1 + 2 is {eval}`1 + 2`.

In the context of the R kernel, given that R doesn't have statements (only expressions), this distinction is not that useful, but there are additional differences between code execution and user-expressions, such as ignoring display outputs (only taking object formatter display messages).

I'm not an R user, but I've hacked together a prototype that I think works for basic text/plain interpolation. Do you have any spare cycles to help me tidy this up for merging? I'm not au-fait with e.g. linters/formatters, good-practice in R code, etc. I wouldn't consider this code production ready given my R credentials.

Thanks!

Closes #678

@agoose77 agoose77 changed the title wip: hacky support for expressions WIP: add hacky support for user-expressions Apr 17, 2024
@agoose77 agoose77 force-pushed the agoose77/wip-user-expressions branch from ae9f2b9 to 1348a94 Compare April 17, 2024 14:18
@agoose77 agoose77 changed the title WIP: add hacky support for user-expressions 🔨 Add support for user-expressions Apr 17, 2024
R/execution.r Outdated Show resolved Hide resolved
@flying-sheep
Copy link
Member

Hmm, I’m not sure if I have those cycles actually! I haven’t worked on R for a long time and forgot a lot of things about this code base.

Maybe I’ll get around to it, but it would be best if someone actually still doing R could look at this.

@agoose77
Copy link
Author

agoose77 commented May 7, 2024

Thanks @flying-sheep! Do you know of anyone off-hand to recommend following this up with? Perhaps @MichaelChirico?

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

Successfully merging this pull request may close these issues.

KernelClient.execute() does not seem to process user expressions
2 participants