twibiral / obsidian-execute-code

Obsidian Plugin to execute code in a note.
MIT License
1.18k stars 71 forks source link

Sagemath Support #127

Open cervera-queiroz opened 2 years ago

cervera-queiroz commented 2 years ago

Hey guys,

Is there any possibility to include Sagemath as one of the supported languages?

Thanks

chlohal commented 2 years ago

Sure!

From a quick look at their docs, it seems like Sage doesn't have any way to execute a file non-interactively. Is there any way to do this, or would most Sagemath users prefer for it to only be available in Notebook Mode?

chlohal commented 2 years ago

Hi! I just wanted to follow up on this. Sagemath seems really interesting, and it's definitely something that I would like to contribute support for. The only issue is the requirement for interactive code: if sage could run a script file, then it would be very easy; do you know if that's possible?

pelegm commented 8 months ago

Yes, it is possible. E.g., test.sage may contain print(3), and then running sage test.sage prints 3.

pelegm commented 8 months ago

The main (or only?) difficulty should arise when someone wishes to plot. The only solution I've found for plotting from the command line is this workaround: https://ask.sagemath.org/question/37719/how-can-i-display-a-plot-from-a-script/