Generic script
#!/bin/bash
# Input SVG file
input_svg="$1"
if [ ! -f "$input_svg" ]; then| const std = @import("std"); | |
| const net = std.net; | |
| const Allocator = std.mem.Allocator; | |
| pub const io_mode = .evented; | |
| var client_id_counter: u32 = 0; | |
| var should_server_close: bool = false; | |
| pub fn main() !void { |
| store Application { | |
| property page : String = "" | |
| property pages : Array(Ui.Pager.Item) = { | |
| [ | |
| { | |
| name = "home", | |
| contents = <Home/>, | |
| url = "/home", | |
| icon = "fa-home", | |
| arrangement = 10 |
| # <Araq> I don't know what to say, callbacks are not special. a Nim proc is mapped to a JS function, just pass it around | |
| # <Araq> proc takesCallback(x: proc()) {.importc.} | |
| # <Araq> takesCallback proc = | |
| # <Araq> echo "my code here" | |
| include karax / prelude | |
| from future import `=>` | |
| import karax / errors | |
| type |