pugjs/then-pug

add an insightful example

Opened this issue · 3 comments

I would like to add a more insightful example to the Readme so that people understand better how powerful then-jade is.

do you have ideas on what this example could be ? fetch an external ressource via request ? wait for something ?

thanks

My thoughts

For streaming:

fetch blog posts:

doctype html
html
  head
    title My Blog
  body
    each postId in posts
      - var post = yield getPost(postId);
      article
        h1= post.name
        p= post.body

For non-streaming:

getting list of options for a select:

mixin select(name, optionType)
  - var options = yield getOptions(optionType)
  select(name=name)
    each option in options
      option(value=option.value)= option.name

form
  +select('religion', 'religions')
q2dg commented

+1

savv commented

+1