@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.
@Araq @juancarlospaco Thanks guys!
@treeform This looks really interesting, thank you! I didn't know about
templates.
@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
👋
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
That README though :D
@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?
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
Thanks @jibal , that does work! I thought I tested it before with that
indentation, but apparently not.
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
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
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
12 matches
Mail list logo