Plans to support other programming languages?
HunterTParks opened this issue · comments
Question
Is there any interest in supporting other programming languages or is that out of scope for this plugin?
I was able to create a small proof-of-concept that allows the user to create Rust code snippets (see screenshot below). It uses the EvCxR Jupyter Kernel. I would recommend looking for a language-agnostic solution rather than my POC though.
Neat! This sounds like a great idea.
Thanks for adding a prototype implementation. Are you interested in developing this further into a generic implementation that can support arbitrary kernels? If not, I can have a go over the coming weeks.
Sure! I'd like to take a crack at it. I'll let you know soon what I come up with.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This is a really cool idea, did anything come from this?
There's some work in #26 but it's still work in progress.
This definitely will be a great feature! Super useful for learning languages. Markdown Preview Enhanced, a VSCode extension, does a great job on this. Please take a look at this doc: code-chunk, and this video showing what it can do
Screen.Recording.2022-03-21.at.21.44.57.mov
There is another Obsidian plugin called Snippets Plugin. It can execute any language and can execute in the edit view/live preview. However it cannot use variables defined in other blocks.
If you're feeling adventurous you can hop into the obsidian-jupyter.py file and add the kwarg kernel_name
to the kernel manager.
# Create a notebook and kernel.
cell = nbformat.v4.new_code_cell()
nb = nbformat.v4.new_notebook(cells=[cell])
// Start of change
km = KernelManager(kernel_name="java")
// End of change
client = NotebookClient(nb, km)
It'd be better to select from available kernels from the command jupyter kernelspec list
. I'll raise a PR if I can get something working. The above is a simple workaround though.