You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-17Lines changed: 12 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
8
8
</div>
9
9
10
-
This plugin allows you to execute code snippets in code blocks in your notes. The plugin adds a 'run' button for code blocks in supported languages. Clicking them results in the code of the block being executed locally. After the execution the result of the execution is showed. An interactive input element is created when your code snippets reads expects user input.
10
+
This plugin allows you to execute code snippets in code blocks in your notes. The plugin adds a 'run' button for code blocks in supported languages. Clicking them results in the code of the block being executed locally. After the execution the result of the execution is shown. An interactive input element is created when your code snippets reads expects user input.
11
11
12
12
The result is shown only after the execution is finished. It is not possible to enter text on the command line into the executed program now.
13
13
@@ -33,7 +33,7 @@ Take a look at the [changelog](CHANGELOG.md) to see what has changed in recent v
33
33
<br>
34
34
<divalign='center'>
35
35
36
-
If you like this plugin and use it a lot, please consider supporting me in continuing the development of this plugin. You can also sponsor a new feature or language integration directly, if you want to speed-up the development for a specific feature you need.
36
+
If you like this plugin and use it a lot, please consider supporting me in continuing the development of this plugin. You can also sponsor a new feature or language integration directly, if you want to speedup the development for a specific feature you need.
37
37
38
38
[](https://github.com/sponsors/twibiral)[](https://www.buymeacoffee.com/timwibiral)
39
39
@@ -76,8 +76,8 @@ hello("Bob")
76
76
<details>
77
77
<summary>TypeScript</summary>
78
78
79
-
- Requirements: Node.js installed then run in command line `npm install typescript -g` and `npm install ts-node -g`. (`-g` means global install)
80
-
- Problems: If you use your global node.js installation and it doesn't work try to set your `ts-node` path in the settings to `npx ts-node` instead of `ts-node`.
79
+
- Requirements: Node.js installed then run in command line `npm install typescript -g` and `npm install ts-node -g`. (`-g` means global installation)
80
+
- Problems: If you use your global node.js installation, and it doesn't work try to set your `ts-node` path in the settings to `npx ts-node` instead of `ts-node`.
81
81
82
82
```ts
83
83
let message:string='Hello, World!';
@@ -373,7 +373,7 @@ ls -la
373
373
<summary>Powershell</summary>
374
374
375
375
- Requirements: Used to execute shell commands on Windows. Default is Powershell but can be set to your preferred shell in the settings.
376
-
- On MacOS: You probably need to change the command to use from `powershell` to `pwsh` in the plugin settings. Make sure you set the right path.
376
+
- On macOS: You probably need to change the command to use from `powershell` to `pwsh` in the plugin settings. Make sure you set the right path.
377
377
378
378
```powershell
379
379
echo "Hello World!"
@@ -713,17 +713,17 @@ This code block is added before each python block you define below in the note a
713
713
714
714
`post` blocks work the same way, but the code in post blocks is executed _after_ your other code blocks.
715
715
716
-
Pre/Post blocks will only apply to code blocks defined below them, and will only apply to code blocks from the same language.
716
+
Pre-/post-blocks will only apply to code blocks defined below them, and will only apply to code blocks from the same language.
717
717
718
-
You can also have a pre and postblock at the same time by specifying `{pre, post}`
718
+
You can also have a pre- and post-block at the same time by specifying `{pre, post}`
719
719
720
720
Note, the `pre`/`post` arguments are special in that you don't need to explicitly state a key/value pair, however you can do so if you wish:
721
721
722
722
`{pre}` is equivalent to `{export='pre'}`, `{pre, post}` is equivalent to `{export=['pre', 'post']}`.
723
723
724
724
### Labelled Code Blocks
725
725
726
-
You can label specific code blocks with the `label='string'` argument, then import them explicitly in other blocks with the `import='string'` or `import=['string1', 'string2', ...]` argument so they aren't automatically imported as with pre / postblocks:
726
+
You can label specific code blocks with the `label='string'` argument, then import them explicitly in other blocks with the `import='string'` or `import=['string1', 'string2', ...]` argument so they aren't automatically imported as with pre-/post-blocks:
727
727
728
728
`````
729
729
```python {label='block 1'}
@@ -791,7 +791,7 @@ preview mode.
791
791
To enable this feature, you have to enable the setting `Persistent Output` in the plugin settings.
792
792
We recommend reopening open notes that contain code blocks after enabling this feature.
793
793
794
-
This feature is still experimental and may not work as expected in all cases.
794
+
⚠ This feature is still experimental and may not work as expected in all cases!
795
795
We recommend that you disable this feature if you encounter any problems.
796
796
797
797
@@ -848,19 +848,14 @@ Do not execute code from sources you don't know or code you don't understand. Ex
848
848
849
849
- On Linux, Snap/Flatpak/AppImage installations of Obsidian run in an isolated environment. As such, they will not have access to any of your installed programs. If you are on Linux, make sure to install the `.deb` version of Obsidian. If your distro isn't compatible with `.deb` files, you may see issues.
850
850
- Missing when `run` button after switching the theme: Try to close and reopen your notes and wait for a few minutes. It seems like obsidian doesn't call the postprocessors after the theme switch.
851
-
- Pre- / Post-blocks may not be executed if the file contains duplicate code blocks.
851
+
- Pre-/Post-blocks may not be executed if the file contains duplicate code blocks.
852
852
- In Python, Embed Plots may not be off while Notebook Mode is on
853
853
854
-
## Future Work 📑
855
-
856
-
- Error warning when the execution fails (e.g. when python isn't installed)
857
-
- Test if this plugin works in combination with dataview.
858
-
859
854
## Contribution 🤝
860
855
861
-
All contributions are welcome. Just create a merge request or email me: tim.wibiral(at)uni-ulm.de
856
+
All contributions are welcome. Just create a merge request or email me: contact(at)tim-wibiral.de
862
857
863
-
The bullet points in Future Work are a good starting point if you want to help.
858
+
The [open issues](https://github.com/twibiral/obsidian-execute-code/issues)are a good starting point to find something to work on. Some are marked as ["good first issue"](https://github.com/twibiral/obsidian-execute-code/labels/good%20first%20issue) and are easier to solve.
0 commit comments