Allow to output either raw or transformed AST, fix several transformation bugs with...
[jst.git] / test_interpolate.jst
1 _out = []
2 _out.push('<!doctype html>')
3 html(lang="en") {
4   head {
5     _out.push('<!-- Required meta tags -->')
6     meta(charset="utf-8") {}
7     meta(name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no") {}
8     _out.push('<!-- Bootstrap CSS -->')
9     link(rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous") {}
10     title {
11       'Hello, world!'
12     }
13   }
14   body {
15     h1 {
16       'Hello, world!'
17     }
18     _out.push('<!-- Optional JavaScript -->')
19     _out.push('<!-- jQuery first, then Popper.js, then Bootstrap JS -->')
20     script(src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous") {}
21     script(src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous") {}
22     script(src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous") {}
23     let hello1 = 'HELLO'
24     let world1 = 'WORLD'
25     script {
26       let hello = ${JSON.stringify(hello1)}
27       let world = ${JSON.stringify(world1)}
28       console.log(`oh, ${hello}, \${world}`)
29     }
30   }
31 }
32 console.log(_out.join(''))