executablebooks / myst-vs-code

A syntax highlighter for the MyST Markdown format
https://marketplace.visualstudio.com/items?itemName=ExecutableBookProject.myst-highlight
MIT License
35 stars 15 forks source link

Add Code Execution capability for MyST #16

Open teonbrooks opened 4 years ago

teonbrooks commented 4 years ago

Is your feature request related to a problem? Please describe. It would be great if we could adapt the code execution for Python chunks using the similar implement as vscode-python. With that extension, you could press Cmd+Enter to run the code within the kernel in the editor. This would give a great level of interactivity while writing in MyST.

Describe the solution you'd like Add code execution capability to MyST extension.

Describe alternatives you've considered It may be more desirable to add this directly vscode-python. It currently supports jupyter notebook and python scripts with percent sign code chunk delimiters (%%). perhaps the addition of ```python syntax there would be more applicable.

chrisjsewell commented 4 years ago

thanks @teonbrooks 100% agree, and actually I have wrote a much more "in-depth" language server extension, using python-language-server., for rST that I would like to port more of into here: https://github.com/chrisjsewell/rst-language-server. Just have to find the time!

amichuda commented 3 years ago

It may be more desirable to add this directly vscode-python

I opened an issue in vscode-python about this, but haven't received a lot of attention.

https://github.com/microsoft/vscode-python/issues/13568

I think it would be a lot nicer if the preview included the executed code, though, although not sure if that's the same as this issue.

teonbrooks commented 3 years ago

@amichuda I created an issue and we've had some conversation in the thread here https://github.com/microsoft/vscode-python/issues/14226. I started to tinker around with it but i haven't had any spare cycles yet to work on it. we could probably collapse this down to one issue and i identify the steps needed to make it happen

amichuda commented 3 years ago

This looks really promising. Thank you! But is your vision here that it would just run the code in the interactive window? If the markdown were to be rendered in the interactive window as well, it would need to interpret myst markdown right?

In any case, this is looking really good!