mirror of
https://github.com/maaslalani/slides.git
synced 2026-01-14 16:58:00 -05:00
97 lines
835 B
Markdown
97 lines
835 B
Markdown
# Code blocks
|
|
|
|
Slides allows you to execute code blocks directly inside your slides!
|
|
|
|
Just press `ctrl+e` and the result of the code block will be displayed as virtual text in your slides.
|
|
|
|
Currently supported languages:
|
|
|
|
* `bash`
|
|
* `elixir`
|
|
* `go`
|
|
* `javascript`
|
|
* `python`
|
|
* `ruby`
|
|
* `perl`
|
|
* `rust`
|
|
|
|
---
|
|
|
|
### Bash
|
|
|
|
```bash
|
|
ls
|
|
```
|
|
|
|
---
|
|
|
|
### Elixir
|
|
|
|
```elixir
|
|
IO.puts "Hello, world!"
|
|
```
|
|
|
|
---
|
|
|
|
### Go
|
|
|
|
```go
|
|
package main
|
|
|
|
import "fmt"
|
|
|
|
func main() {
|
|
fmt.Println("Hello, world!")
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
### Javascript
|
|
|
|
```javascript
|
|
console.log("Hello, world!")
|
|
```
|
|
|
|
---
|
|
|
|
### Lua
|
|
|
|
```lua
|
|
print("Hello, World!")
|
|
```
|
|
|
|
---
|
|
|
|
### Python
|
|
|
|
```python
|
|
print("Hello, world!")
|
|
```
|
|
|
|
---
|
|
|
|
### Ruby
|
|
|
|
```ruby
|
|
puts "Hello, world!"
|
|
```
|
|
|
|
---
|
|
|
|
### Perl
|
|
|
|
```perl
|
|
print ("hello, world");
|
|
```
|
|
|
|
---
|
|
|
|
### Rust
|
|
|
|
```rust
|
|
fn main() {
|
|
println!("Hello, world!");
|
|
}
|
|
```
|