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
If you are new to MarkDown or Obsidian.md, you can go to the [Quickstart Guide](#quickstart-guide-) or take a look in to [some blogs and videos that feature this plugin](#featured-in)
22
22
23
-
Python, Rust, and Octave support embedded plots. All languages support ["magic" commands](#magic-commands-) that help you to access paths in obsidian or show images in your notes.
23
+
Python, R, and Octave support embedded plots. All languages support ["magic" commands](#magic-commands-) that help you to access paths in obsidian or show images in your notes.
24
24
25
25
You can create code blocks that are executed before or after each code block of the same language and define [global code injections](#global-code-injection-and-reusing-code-blocks-).
26
26
@@ -54,7 +54,7 @@ In blogs:
54
54
<small>Are you featuring this plugin in your content? Let me know and I will add it here.</small>
55
55
56
56
57
-
## Supported programming, typesetting languages 💻
57
+
## Supported programming languages 💻
58
58
59
59
<details>
60
60
<summary>JavaScript</summary>
@@ -85,28 +85,6 @@ console.log(message);
85
85
```
86
86
</details>
87
87
88
-
<details>
89
-
<summary>CSharp</summary>
90
-
91
-
- Requirements: install dotnet core sdk and run in command line `dotnet tool install -g dotnet-script`, then config dotnet-script fullpath.
92
-
93
-
```cs
94
-
Console.WriteLine("Hello, World!");
95
-
```
96
-
</details>
97
-
98
-
<details>
99
-
<summary>Dart</summary>
100
-
101
-
- Requirements: dart sdk is installed and the correct path is set in the settings.
102
-
103
-
```dart
104
-
void main() {
105
-
print("Hello World");
106
-
}
107
-
```
108
-
</details>
109
-
110
88
<details>
111
89
<summary>Python</summary>
112
90
@@ -121,7 +99,7 @@ if __name__ == "__main__":
121
99
```
122
100
123
101
- By default, Python runs in Notebook Mode. You can turn this off in the settings.
124
-
- Plots with matplotlib/seaborn are embedded in the note by default. You can turn this off in the settings.
102
+
- Plots with matplotlib/seaborn are embedded in the note by default. You can turn this off in the settings. Note that plots are only embedded when `plt.show()` is called.
125
103
126
104
```python
127
105
import seaborn as sns
@@ -159,6 +137,61 @@ plot(x, y, type="l")
159
137
```
160
138
</details>
161
139
140
+
<details>
141
+
<summary>C++</summary>
142
+
143
+
- Requirements: [Cling](https://github.com/root-project/cling) is installed and correct path is set in the settings.
144
+
- Code will be executed line-by-line without needing a main function.
145
+
146
+
```cpp
147
+
#include<iostream>
148
+
#include<string>
149
+
150
+
usingnamespacestd;
151
+
152
+
voidhello(string name) {
153
+
cout << "Hello " << name << "!\n";
154
+
}
155
+
156
+
hello("Alice);
157
+
```
158
+
159
+
- Main functions can be used as an entrypoint by toggling the option in settings.
160
+
161
+
```cpp
162
+
#include <iostream>
163
+
164
+
void main() {
165
+
std::cout << "Hello, World!" << std::endl;
166
+
}
167
+
```
168
+
</details>
169
+
170
+
<details>
171
+
<summary>C</summary>
172
+
173
+
- Requirements: [Cling](https://github.com/root-project/cling) is installed and correct path is set in the settings.
174
+
- Code will be executed line-by-line without needing a main function.
175
+
176
+
```c
177
+
#include<stdio.h>
178
+
179
+
printf("Hello, World!");
180
+
```
181
+
182
+
- Main functions can be used as an entrypoint by toggling the option in settings.
183
+
184
+
```c
185
+
#include <stdio.h>
186
+
187
+
int main() {
188
+
printf("Hello, World!");
189
+
return 0;
190
+
}
191
+
```
192
+
193
+
</details>
194
+
162
195
<details>
163
196
<summary>Java</summary>
164
197
@@ -173,6 +206,15 @@ public class HelloWorld {
173
206
```
174
207
</details>
175
208
209
+
<details>
210
+
<summary>SQL</summary>
211
+
- Requirements: Have some SQL database installed and the correct path is set in the settings. The default is set to PostgreSQL (`psql`).
212
+
- Make sure you adapt the settings to your database (`-d mydatabase -U myuser -f`)The default is set to .
Squiggle: For Squiggle support take a look at the [Obsidian Squiggle plugin](https://github.com/jqhoogland/obsidian-squiggle) by @jqhoogland.
592
607
593
-
Support for the following is planned:
594
-
595
-
- Matlab
596
-
- Julia Lang
597
608
598
-
Open for suggestions.
599
609
600
610
## Magic Commands 🪄
601
611
@@ -612,6 +622,7 @@ The following magic commands are supported:
612
622
-`@show(ImagePath, Width, Height)`: Displays an image at the given path in the note.
613
623
-`@show(ImagePath, Width, Height, Alignment[center|left|right])`: Displays an image at the given path in the note.
614
624
-`@html(HtmlSource)`: Displays HTML in the note
625
+
-`@content`: Inserts the html content of the note in the code block. ([Here you find a nice example for the usage of this command.](https://github.com/twibiral/obsidian-execute-code/pull/390))
615
626
616
627
(`@show(...)` and `@html(...)` are only supported for JavaScript and Python yet.)
617
628
(The old commands `@note` and `@vault` are still supported, but may be removed in the future.)
0 commit comments