Skip to content

Instantly share code, notes, and snippets.

@rg3915
Created August 30, 2018 00:51
Show Gist options
  • Save rg3915/2c747bc2ee42e6bd22ea295dd2c0d8af to your computer and use it in GitHub Desktop.
Save rg3915/2c747bc2ee42e6bd22ea295dd2c0d8af to your computer and use it in GitHub Desktop.
Pug example pypugjs

https://www.undefinednull.com/pug-to-html/

https://github.com/kakulukia/pypugjs

https://pugjs.org/language/iteration.html

.main
 - for(var i=0; i<data.length; i++)
   .child
    | #{data[i]}
.another #{greet('shidhin')}
.other
  ul
    - for(var i=0; i<data.length; i++)
      li.child
        | #{data[i]}
.other
  table#table.table
    thead
      tr
        th Fruits
    tbody
      tr
        - for(var i=0; i<data.length; i++)
          td.child
            | #{data[i]}
            
.form
  form
    input#fruit.fruit
    
#iter.each-example
  ul
    each fruit in data
      li= fruit
      
table#table.table
  tbody
    tr
      each fruit in data
        td= fruit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment