Skip to content

Instantly share code, notes, and snippets.

@hns
Created November 6, 2010 23:28
Show Gist options
  • Save hns/665796 to your computer and use it in GitHub Desktop.
Save hns/665796 to your computer and use it in GitHub Desktop.
<% subskin content %>
<p>Logs for the <a href="irc://irc.freenode.net/ringojs">RingoJS IRC channel</a>,
as logged by <a href="http://github.com/earl/ringobot"><code>ringostarr</code></a>.</p>
<h1><% day %></h1>
<% for record in <% records %> render record %>
<% subskin record %>
<p class="utterance">
<span class="time">[<% record.datetime | substring 11 16 %>]</span>
<% if <% record.is_message %> render message_record %>
<% if <% record.is_action %> render action_record %>
</p>
<% subskin message_record %>
<span class="is_message">
<span class="sender">&lt;<% record.sender %>&gt;</span>
<span class="message"><% record.message %></span>
</span>
<% subskin action_record %>
<span class="is_action">
*
<span class="sender"><% record.sender %></span>
<span class="action"><% record.action %></span>
</span>
function content() {
return html(
["p", "Logs for the ",
["a", {href: "irc://irc.freenode.net/ringojs"}, "RingoJS IRC channel"],
", as logged by ",
["a", {href: "http://github.com/earl/ringobot"}, ["code", "ringostarr"]]],
["h1", day],
records.map(record));
}
function record(r) {
return html(
"p.utterance",
["span.time", "[", r.datetime, "]"],
r.is_message ?
["span.is_message",
["span.sender", "&lt;", r.sender, "&gt;"],
["span.message", r.message]] :
["span.is_action", " * ",
["span.sender", "&lt;", r.sender, "&gt;"],
["span.action", r.action]]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment