HTML template layout

2020-08-10 Thread zolo
@xigoi Thank you! I did actually check out Moustachu beofore, but it didn't seem like the thing I was looking for. It doesn't seem like a structured html builder, but rather string interpolation with separation of concerns.

HTML template layout

2020-08-10 Thread zolo
@Araq @juancarlospaco Thanks guys!

HTML template layout

2020-08-10 Thread zolo
@treeform This looks really interesting, thank you! I didn't know about templates.

HTML template engine that keeps code/templates separate?

2020-08-09 Thread zolo
@snej I was looking for the same thing, especially something like Pug.js or Slim (a Ruby thing). Please let me know how Moustachu works for you, if you give it a try. I opted for the stdlib’s **htmlgen** module which looks quite nice, though I do have a thread asking about some ways to improve

HTML template layout

2020-08-09 Thread zolo
👋 I'm trying to come up with a way build an HTML template in the cleanest way possible. I can do: import htmlgen proc layout(view: string): string = result = head(link(rel="stylesheet", href="styles.css")) & h1("In time") & p("yo

Nautilus engine for Nim [wrapper]

2020-08-06 Thread zolo
That README though :D

New blog post: Ray tracing in Nim

2020-08-06 Thread zolo
@mratsim Nice! Would this be beneficial for regular peasants like me how are just writing web apps with Nim? Would swapping the 'regular' Nim runtime with Weave have any advantage?

VSC will have the Nim icon soon

2020-08-06 Thread zolo
I PR I submitted to make the Nim logo appear in VSC for .nim and .nims files got accepted. Hopefully, it will show up in a release soon. [https://github.com/jesseweed/seti-ui/pull/579](https://github.com/jesseweed/seti-ui/pull/579) seti-ui is the default icon set for VSC. IMHO it looks better th

Pass inline expression instead of a proc

2020-08-06 Thread zolo
Thanks @jibal , that does work! I thought I tested it before with that indentation, but apparently not.

Pass inline expression instead of a proc

2020-08-06 Thread zolo
Thanks @Hlaaftana! I kinda like the do notation. There's a visual distinction between the rest of the arguments and when the callback starts and it takes care of the parenthesis' in the first line. I wonder how one can call a procedure with multiple callbacks. 😮 Like: proc animat

Pass inline expression instead of a proc

2020-08-06 Thread zolo
Turns out I was looking for the lambda syntax which is possible with "do". (Although as I hear it's possible in some other way as well) wait_for server.serve(Port(8080)) do (request: Request) {.async.}: discard serve_ile(request, "", "todo.json") Run

Pass inline expression instead of a proc

2020-08-06 Thread zolo
Is it possible to pass an inline expression where a proc is needed? For example, can I do something like: waitFor(server.serve(Port(8080), (request: Request) {.async.} = await request.respond(Http200, "Hello World")) ) Run \--- Á la Swift closures