Skip to content

Commit

Permalink
Include code sample
Browse files Browse the repository at this point in the history
  • Loading branch information
udoprog committed Oct 10, 2023
1 parent 67efd28 commit f1d7725
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion site/content/posts/2023-10-10-rune-0.13.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,19 @@ the way rust works and is structured. A common way to describe it is "Rust
without types".

{% rune(footnote = "Hello World!") %}
fn fizzbuzz(up) {
for n in 1..=up {
match (n % 3, n % 5) {
(0, 0) => yield "FizzBuzz",
(0, _) => yield "Fizz",
(_, 0) => yield "Buzz",
_ => yield n,
}
}
}

pub fn main() {
println!("Hello World!");
fizzbuzz(15).iter().collect::<Vec>()
}
{% end %}

Expand Down
2 changes: 1 addition & 1 deletion site/templates/shortcodes/rune.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
rune-instructions="{% if instructions %}{{instructions}}{% endif %}""
rune-config="{% if rune_config %}{{rune_config}}{% endif %}""
>
<div class="rune-editor">{{body | safe}}</div>
<div class="rune-editor">{{body}}</div>
<div class="rune-console">
<div class="rune-control">
<button class="rune-button rune-run">Run</button>
Expand Down

0 comments on commit f1d7725

Please sign in to comment.