Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
twibiral committed Dec 28, 2022
2 parents a55313a + 7cfbfe9 commit 24d7c10
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ You can create code blocks that are executed before or after each code block of
Take a look at the [changelog](CHANGELOG.md) to see what has changed in recent versions.


## Supported programming languages
[![Obsidian Downloads](https://img.shields.io/badge/dynamic/json?color=1e1e1e&labelColor=8572db&label=Downloads&query=$['execute-code'].downloads&url=https://raw.githubusercontent.com/obsidianmd/obsidian-releases/master/community-plugin-stats.json&)](obsidian://show-plugin?id=execute-code)

## Supported programming languages 💻

<details>
<summary>JavaScript</summary>
Expand Down Expand Up @@ -397,7 +399,7 @@ Support for the following is planned:

Open for suggestions.

## Magic Commands
## Magic Commands 🪄

Magic commands are some meta commands that can be used in the code block. They are processed by the plugin before the source code is executed.

Expand All @@ -418,7 +420,7 @@ The following magic commands are supported:

![Example how to use the magic commands.](https://github.com/twibiral/obsidian-execute-code/blob/master/images/magic_example.png?raw=true)

## Running in Preview
## Running in Preview

Adding `run-` before the language name in the code blocks (as in the example below) renders the code block in the preview already.
This allows you to execute the code in the preview.
Expand All @@ -432,7 +434,7 @@ print("Hello", name)
hello("Eve")
``````

## Code Block Arguments
## Code Block Arguments 🏷

Code blocks support specifying additional arguments in the form `{key='value', otherkey=['val1', 'val2']}`. Add them to code blocks like so:

Expand All @@ -442,7 +444,7 @@ print('my labelled code block')
```
`````

## Global Code Injection and Reusing Code Blocks
## Global Code Injection and Reusing Code Blocks 📘

Sometimes it is helpful to have code that is executed before or after each other block of the same language. This plugin supports this in a few ways:

Expand Down Expand Up @@ -532,42 +534,42 @@ undefined
To manage the open runtimes for Notebook Mode, you can use the `Open Code Runtime Management` command in the command palette. From this sidebar window, you can stop kernels. **Note: force-stopping requires `taskkill` on Windows and `pkill` on Unix. 99% of systems should have these preinstalled: if yours doesn't, please [file an issue](https://github.com/twibiral/obsidian-execute-code/issues/new/choose)**


## Style Settings
## Style Settings 🎨

This plugin supports customising styles using the [Style Settings plugin](https://github.com/mgmeyers/obsidian-style-settings). It's possible to customise the color of code block outputs and errors.

## Installation
## Installation 💾

In your vault go to Settings > Community plugins > Browse and search for "Execute Code". Select the plugin, install it and activate it.

or

Follow [this link](https://obsidian.md/plugins?search=execute%20code#) and click "Open in Obsidian".

## Warning
## Warning

Do not execute code from sources you don't know or code you don't understand. Executing code can cause irreparable damage.

## Known Problems
## Known Problems 🛠

- 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.
- 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.
- Pre- / Post-blocks may not be executed if the file contains duplicate code blocks.
- In Python, Embed Plots may not be off while Notebook Mode is on

## Future Work
## Future Work 📑

- Notebook Mode similar to Jupyter
- Error warning when the execution fails (e.g. when python isn't installed)
- Test if this plugin works in combination with dataview.

## Contribution
## Contribution 🤝

All contributions are welcome. Just create a merge request or email me: tim.wibiral(at)uni-ulm.de

The bullet points in Future Work are a good starting point if you want to help.

## Contributors
## Contributors

<a href="https://github.com/twibiral/obsidian-execute-code/graphs/contributors">
<img alt="List of contributors to this project." src="https://contrib.rocks/image?repo=twibiral/obsidian-execute-code" />
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"name": "Execute Code",
"version": "1.6.1",
"minAppVersion": "0.12.0",
"description": "Allows to execute code snippets within a note.",
"description": "Allows to execute code snippets within a note. Supported programming languages: C, CPP, Dart, Golang, Groovy, Kotlin, Java, JavaScript, TypeScript, Lean, Lua, CSharp, Prolog, Rust, Python, R, Ruby, Wolfram Mathematica, Haskell, Scala, Racket, F#, Batch, Shell & Powershell.",
"author": "twibiral",
"authorUrl": "https://github.com/twibiral",
"isDesktopOnly": true
}
}

0 comments on commit 24d7c10

Please sign in to comment.