Skip to content

Instantly share code, notes, and snippets.

@stonean
Created October 8, 2009 19:00
Show Gist options
  • Save stonean/205276 to your computer and use it in GitHub Desktop.
Save stonean/205276 to your computer and use it in GitHub Desktop.
<h1><%= header %></h1>
<% if not item.empty? %>
<ul>
<% for i in item %>
<% if i[:current] %>
<li><strong><%= i[:name] %></strong></li>
<% else %>
<li><a href="<%= i[:url] %>"><%= i[:name] %></a></li>
<% end %>
<% end %>
</ul>
<% end %>
<% if item.empty? %>
<p>The list is empty.</p>
<% end %>
<strong>Mustache</strong>
<h1>{{header}}</h1>
{{#list}}
<ul>
{{#item}}
{{#current}}
<li><strong>{{name}}</strong></li>
{{/current}}
{{#link}}
<li><a href="{{url}}">{{name}}</a></li>
{{/link}}
{{/item}}
</ul>
{{/list}}
{{#empty?}}
<p>The list is empty.</p>
{{/empty?}}
<strong>RuHL</strong>
<h1 data-ruhl="header"></h1>
<ul data-ruhl="_if: items?">
<li data-ruhl="_use: list">
<strong data-ruhl="_if: current?, name"></strong>
<a data-ruhl="_unless: current?, href: url, name"></a>
</li>
</ul>
<p data-ruhl="_unless: items?">The list is empty.</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment