Skip to content

Commit

Permalink
Update to version 1.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
twibiral authored Feb 27, 2023
2 parents 668089d + 8a4dab3 commit d5995d1
Show file tree
Hide file tree
Showing 11 changed files with 378 additions and 263 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [1.7.1]

### Changed

- Add more examples for magic commands to README.md
- Pass environmental variables to the REPL executors
- Allow language names that are not lower case

## [1.7.0]

### Added
Expand Down
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,44 @@ The following magic commands are supported:
(`@show(...)` and `@html(...)` are only supported for JavaScript and Python yet.)
(The old commands `@note` and `@vault` are still supported, but may be removed in the future.)

Examples for the magic commands with Python:

```python
print("Vault path:", @vault_path)
print("Vault url:", @vault_url)

print("Note path:", @note_path)
print("Note url:", @note_url)

print("Note title:", @title)
```

```python
@show("image.png")
@show("image.png", 100, 100)
@show("https://upload.wikimedia.org/wikipedia/commons/d/de/TestScreen_square.svg", 10%, 10%, "center")
```

```python
@html("<h1>HTML Caption</h1>")
@html('''
<svg width="100%" height="100%" viewBox="0 0 600 600" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<circle cx="300" cy="300" r="250" style="fill:peru;" />
<circle cx="200" cy="250" r="50" style="fill:black;" />
<circle cx="400" cy="250" r="50" style="fill:black;" />
<circle cx="190" cy="230" r="20" style="fill:white;" />
<circle cx="390" cy="230" r="20" style="fill:white;" />
<circle cx="250" cy="400" r="85" style="fill:saddlebrown;" />
<circle cx="350" cy="400" r="85" style="fill:saddlebrown;" />
<ellipse cx="300" cy="380" rx="50" ry="35" style="fill:black;" />
<ellipse cx="130" cy="100" rx="110" ry="70" style="fill:saddlebrown;"/>
<ellipse cx="470" cy="100" rx="110" ry="70" style="fill:saddlebrown;" />
</svg>
''')
```

Try it out yourself!

![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 ⏩
Expand Down
Binary file modified images/magic_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "execute-code",
"name": "Execute Code",
"version": "1.7.0",
"version": "1.7.1",
"minAppVersion": "0.12.0",
"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",
Expand Down
Loading

0 comments on commit d5995d1

Please sign in to comment.