twibiral/obsidian-execute-code

[BUG] Code blocks not working

Closed this issue · 7 comments

I just installed obsidian and this plugin on windows 11 and I canno't get the code to run, no run button like in the pics, and there is no output when I hit run all code blocks. Is there some special way to get this to function? I'm just inserting new code blocks but also tried the three backticks way. I have node installed and pythong both functioning well and available from command line.

Windows 11, latest patches. Obsidian latest version. Python 3.10, Node v20.14.0.

Steps to reproduce the behavior:
Install everything like normal and try to run a simple hello world block.

Code block should run and output something OR give an error message with more info.

Screenshot 2024-06-11 133452
Am I doing something wrong? In theory it should just work but I'm new to Obsidian and don't know where to find the logs. It should give some sort of error if it doesn't work though.

You need to add the language name to the code block, like this:

```python
print("Hello World")
```

I feel stupid now. Thank you.

In the top bar isn't there supposed to be a button to run the code? It doesn't show up for me.

I tried you're marking the code type but no change. Where can I see the output of the extensions? Or a log file or something I can check? It isn't loading correctly I think because the button didn't show up in the top bar. The runtime thingy loads but never shoes a runtime so I guess it's loading.

The run button will only appear when you view it in rendered mode (you can switch to the rendered mode using this button in the lower right corner:
image)

What exactly do you mean with top bar? The run button is only supposed to be directly at each code block.

Thank you, I feel stupid.

Don't worry ^^