Skip to content

Instantly share code, notes, and snippets.

@Buildstarted
Last active October 11, 2015 09:18
Show Gist options
  • Select an option

  • Save Buildstarted/3837145 to your computer and use it in GitHub Desktop.

Select an option

Save Buildstarted/3837145 to your computer and use it in GitHub Desktop.
Parrot vs other view engines
new {
Header = "Parrot",
Features = new [] {
"Familiar syntax",
"Extensible output",
"Simple model binding"
}
}
doctype
html {
head > title |This is Parrot!
body {
h1#header |:Header
p#tagname.small |All new Asp.Net View Engine
div#description.rounded-corners {
h2 |Features
ul(Features) > li |:this
}
}
}
<!DOCTYPE html>
<html>
<head>
<title>This is Parrot!</title>
</head>
<body>
<h1 id="header"><%:Model.Header%></h1>
<p id="tagname" class="small">All new Asp.Net View Engine</p>
<div id="description" class="rounded-corners">
<h2>Features</h2>
<ul>
<%foreach(var item in Model.Features) {%>
<li><%:item%></li>
<% } %>
</ul>
</div>
</body>
</html>
!!!
%html
%head
%title This is Parrot!
%body
%h1#header = Model.Header
%p#tagName.small All new Asp.Net View Engine
%div#description.rounded-corners
%h2 Features
%ul
- foreach (var item in Model.Features)
%li
=item
<!DOCTYPE html>
<html>
<head>
<title>This is Parrot!</title>
</head>
<body>
<h1 id="header">@Model.Header</h1>
<p id="tagname" class="small">All new Asp.Net View Engine</p>
<div id="description" class="rounded-corners">
<h2>Features</h2>
<ul>
@foreach(var item in Model.Features) {
<li>@item</li>
}
</ul>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>This is Parrot!</title>
</head>
<body>
<h1 id="header">${Model.Header}</h1>
<p id="tagname" class="small">All new Asp.Net View Engine</p>
<div id="description" class="rounded-corners">
<h2>Features</h2>
<ul>
<li each='var p in Model.Features'>${p}</li>
</ul>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment