mirror of
https://github.com/mfontanini/presenterm.git
synced 2026-09-01 23:33:21 -06:00
add code execution examples to code.md presentation
This commit is contained in:
parent
3ce1133c35
commit
e950a12c84
@ -13,6 +13,7 @@ This presentation shows how to:
|
||||
|
||||
* Left-align code blocks.
|
||||
* Have code blocks without background.
|
||||
* Execute code snippets.
|
||||
|
||||
```rust
|
||||
pub struct Greeter {
|
||||
@ -74,3 +75,32 @@ fn main() {
|
||||
println!("{greeting}");
|
||||
}
|
||||
```
|
||||
|
||||
<!-- end_slide -->
|
||||
|
||||
Code execution
|
||||
===
|
||||
|
||||
Run commands from the presentation and display their output dynamically.
|
||||
|
||||
```bash +exec
|
||||
for i in $(seq 1 5)
|
||||
do
|
||||
echo "hi $i"
|
||||
sleep 0.5
|
||||
done
|
||||
```
|
||||
|
||||
<!-- end_slide -->
|
||||
|
||||
Code execution - `stderr`
|
||||
===
|
||||
|
||||
Output from `stderr` will also be shown as output.
|
||||
|
||||
```bash +exec
|
||||
echo "This is a successful command"
|
||||
echo "This message redirects to stderr" >&2
|
||||
echo "This is a successful command again"
|
||||
man # Missing argument
|
||||
```
|
||||
Loading…
x
Reference in New Issue
Block a user