Add README and simplify ViewEngine API
- ViewEngine.init() no longer requires allocator - render() and renderTpl() accept allocator parameter - Remove deinit() - no resources to clean up - Remove unused parse/renderDoc methods - Add memory management guidance to runtime.zig - Clean up unused imports and options
This commit is contained in:
30
src/benchmarks/templates/friends.pug
Normal file
30
src/benchmarks/templates/friends.pug
Normal file
@@ -0,0 +1,30 @@
|
||||
doctype html
|
||||
html(lang="en")
|
||||
head
|
||||
meta(charset="UTF-8")
|
||||
title Friends
|
||||
body
|
||||
div.friends
|
||||
each friend in friends
|
||||
div.friend
|
||||
ul
|
||||
li Name: #{friend.name}
|
||||
li Balance: #{friend.balance}
|
||||
li Age: #{friend.age}
|
||||
li Address: #{friend.address}
|
||||
li Image:
|
||||
img(src=friend.picture)
|
||||
li Company: #{friend.company}
|
||||
li Email:
|
||||
a(href=friend.emailHref) #{friend.email}
|
||||
li About: #{friend.about}
|
||||
if friend.tags
|
||||
li Tags:
|
||||
ul
|
||||
each tag in friend.tags
|
||||
li #{tag}
|
||||
if friend.friends
|
||||
li Friends:
|
||||
ul
|
||||
each subFriend in friend.friends
|
||||
li #{subFriend.name} (#{subFriend.id})
|
||||
13
src/benchmarks/templates/if-expression.pug
Normal file
13
src/benchmarks/templates/if-expression.pug
Normal file
@@ -0,0 +1,13 @@
|
||||
each account in accounts
|
||||
div
|
||||
if account.status == "closed"
|
||||
div Your account has been closed!
|
||||
if account.status == "suspended"
|
||||
div Your account has been temporarily suspended
|
||||
if account.status == "open"
|
||||
div
|
||||
| Bank balance:
|
||||
if account.negative
|
||||
span.negative= account.balanceFormatted
|
||||
else
|
||||
span.positive= account.balanceFormatted
|
||||
11
src/benchmarks/templates/projects-escaped.pug
Normal file
11
src/benchmarks/templates/projects-escaped.pug
Normal file
@@ -0,0 +1,11 @@
|
||||
doctype html
|
||||
html
|
||||
head
|
||||
title #{title}
|
||||
body
|
||||
p #{text}
|
||||
each project in projects
|
||||
a(href=project.url) #{project.name}
|
||||
p #{project.description}
|
||||
else
|
||||
p No projects
|
||||
33
src/benchmarks/templates/search-results.pug
Normal file
33
src/benchmarks/templates/search-results.pug
Normal file
@@ -0,0 +1,33 @@
|
||||
.search-results-container
|
||||
.searching#searching
|
||||
.wait-indicator-icon Searching...
|
||||
#resultsContainer
|
||||
.hd
|
||||
span.count
|
||||
span#count= totalCount
|
||||
| results
|
||||
.view-modifiers
|
||||
.view-select
|
||||
| View:
|
||||
.view-icon.view-icon-selected#viewIconGallery
|
||||
i.icon-th
|
||||
.view-icon#viewIconList
|
||||
i.icon-th-list
|
||||
#resultsTarget
|
||||
.search-results.view-gallery
|
||||
each searchRecord in searchRecords
|
||||
.search-item
|
||||
.search-item-container.drop-shadow
|
||||
.img-container
|
||||
img(src=searchRecord.imgUrl)
|
||||
h4.title
|
||||
a(href=searchRecord.viewItemUrl)= searchRecord.title
|
||||
| #{searchRecord.description}
|
||||
if searchRecord.featured
|
||||
div Featured!
|
||||
if searchRecord.sizes
|
||||
div
|
||||
| Sizes available:
|
||||
ul
|
||||
each size in searchRecord.sizes
|
||||
li= size
|
||||
1
src/benchmarks/templates/simple-0.pug
Normal file
1
src/benchmarks/templates/simple-0.pug
Normal file
@@ -0,0 +1 @@
|
||||
h1 Hello, #{name}
|
||||
14
src/benchmarks/templates/simple-1.pug
Normal file
14
src/benchmarks/templates/simple-1.pug
Normal file
@@ -0,0 +1,14 @@
|
||||
.simple-1(style="background-color: blue; border: 1px solid black")
|
||||
.colors
|
||||
span.hello Hello #{name}!
|
||||
strong You have #{messageCount} messages!
|
||||
if colors
|
||||
ul
|
||||
each color in colors
|
||||
li.color= color
|
||||
else
|
||||
div No colors!
|
||||
if primary
|
||||
button(type="button" class="primary") Click me!
|
||||
else
|
||||
button(type="button" class="secondary") Click me!
|
||||
10
src/benchmarks/templates/simple-2.pug
Normal file
10
src/benchmarks/templates/simple-2.pug
Normal file
@@ -0,0 +1,10 @@
|
||||
div
|
||||
h1.header #{header}
|
||||
h2.header2 #{header2}
|
||||
h3.header3 #{header3}
|
||||
h4.header4 #{header4}
|
||||
h5.header5 #{header5}
|
||||
h6.header6 #{header6}
|
||||
ul.list
|
||||
each item in list
|
||||
li.item #{item}
|
||||
Reference in New Issue
Block a user