| ... | @@ -7,6 +7,7 @@ const example_document = | ... | @@ -7,6 +7,7 @@ const example_document = |
| 7 | \\ meta[charset="utf-8"] | 7 | \\ meta[charset="utf-8"] |
| 8 | \\ title("Pek Example") | 8 | \\ title("Pek Example") |
| 9 | \\ meta[name="viewport" content="width=device-width,initial-scale=1"] | 9 | \\ meta[name="viewport" content="width=device-width,initial-scale=1"] |
| | 10 | \\ meta[http-equiv="X-UA-Compatible" content="IE=edge"] |
| 10 | \\ ) | 11 | \\ ) |
| 11 | \\ body( | 12 | \\ body( |
| 12 | \\ h1("Pek Example") | 13 | \\ h1("Pek Example") |
| ... | @@ -22,6 +23,22 @@ const example_document = | ... | @@ -22,6 +23,22 @@ const example_document = |
| 22 | \\ /each/ | 23 | \\ /each/ |
| 23 | \\ ) | 24 | \\ ) |
| 24 | \\ p("Spooky text: "{spooky}) | 25 | \\ p("Spooky text: "{spooky}) |
| | 26 | \\ |
| | 27 | // \\ {#if am_i_a_girl} |
| | 28 | // \\ p("#1") |
| | 29 | // \\ /if/ |
| | 30 | // \\ |
| | 31 | // \\ {#ifnot is_it_my_birthday} |
| | 32 | // \\ p("#2") |
| | 33 | // \\ /ifnot/ |
| | 34 | // \\ |
| | 35 | // \\ {#ifequal top_cities.len best_rating} |
| | 36 | // \\ p("#3") |
| | 37 | // \\ /ifequal/ |
| | 38 | // \\ |
| | 39 | // \\ {#ifnotequal favorite.color sky} |
| | 40 | // \\ p("#4") |
| | 41 | // \\ /ifnotequal/ |
| 25 | \\ ) | 42 | \\ ) |
| 26 | \\) | 43 | \\) |
| 27 | ; | 44 | ; |
| ... | @@ -32,6 +49,8 @@ pub fn main() !void { | ... | @@ -32,6 +49,8 @@ pub fn main() !void { |
| 32 | .author = "Meghan D", | 49 | .author = "Meghan D", |
| 33 | .favorite = .{ | 50 | .favorite = .{ |
| 34 | .flower = "Sunflower", | 51 | .flower = "Sunflower", |
| | 52 | .program_lang = "Zig", |
| | 53 | .color = "Pink", |
| 35 | }, | 54 | }, |
| 36 | .top_cities = .{ | 55 | .top_cities = .{ |
| 37 | .{ .name = "New York", .state = .{ .code = "NY" } }, | 56 | .{ .name = "New York", .state = .{ .code = "NY" } }, |
| ... | @@ -41,5 +60,9 @@ pub fn main() !void { | ... | @@ -41,5 +60,9 @@ pub fn main() !void { |
| 41 | .{ .name = "Phoenix", .state = .{ .code = "AZ" } }, | 60 | .{ .name = "Phoenix", .state = .{ .code = "AZ" } }, |
| 42 | }, | 61 | }, |
| 43 | .spooky = "<strong>I better not be in bold.</strong>", | 62 | .spooky = "<strong>I better not be in bold.</strong>", |
| | 63 | .am_i_a_girl = true, |
| | 64 | .sky = "Blue", |
| | 65 | .best_rating = 5, |
| | 66 | .is_it_my_birthday = false, |
| 44 | }); | 67 | }); |
| 45 | } | 68 | } |