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

Inline expr w/kernel and images wo/kernel #64

Open
memeplex opened this issue Feb 2, 2024 · 1 comment
Open

Inline expr w/kernel and images wo/kernel #64

memeplex opened this issue Feb 2, 2024 · 1 comment

Comments

@memeplex
Copy link

memeplex commented Feb 2, 2024

Hi, this is not a report but just two questions. Sorry if this is not the place to ask, I didn't find any better place.

  1. Is it possible to achieve the effect of cb-expr when running through a kernel? cb-nb with inlines does almost the same but the output is formatted verbatim, I would like to get it as is instead.

  2. For simple cases, I prefer to avoid the kernel, but I'm not sure about how to produce a figure as output. I could write it to a file and then print the path as a markdown image link, but that would be dependant on the output format (or perhaps not? will markdown output at this stage still be converted to the output format?). Is it a way of making codebraid interpret the output as an image path?

Thanks in advance.

@gpoore
Copy link
Owner

gpoore commented Feb 2, 2024

  1. At the moment, something like show=rich_output:plain:raw should work. I probably should look into enabling cb-expr for Jupyter kernels, using show=rich_output:plain:raw, but I think there still may be a few edge cases.

  2. You have the right idea. Save the image to file, then print the Markdown code to create an image/figure/etc. This will need to be in a code block or other context where show includes stdout:raw. The Markdown will be interpreted and converted into the output format to the extent that Pandoc supports this for the output format.

    I've gradually been working toward adding support for rich output to the built-in code execution system to provide capabilities closer to a Jupyter kernel. So someday I hope it will be possible to have images appear automatically, or create figures with something like codebraid.add_figure(<image_path>, <caption>).

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

2 participants