Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add an insightful example #8

Open
jeromew opened this issue Mar 23, 2014 · 3 comments
Open

add an insightful example #8

jeromew opened this issue Mar 23, 2014 · 3 comments

Comments

@jeromew
Copy link
Contributor

jeromew commented Mar 23, 2014

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

@ForbesLindesay
Copy link
Member

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
Copy link

q2dg commented Jan 18, 2015

+1

1 similar comment
@savv
Copy link

savv commented Oct 30, 2015

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants