CodeSaga

Last week Torkel Ödegaard announced the first version of a new project CodeSaga based on several technologies including Asp.Net MVC and Spark.

In CodeSaga – The TFS & Subversion Storyteller he says:

CodeSaga is a source code repository web analysis app, very similar to FishEye. I have been working on this as a hobby project for a while now. It basically grew out of frustration with the existing TFS web tools and the need to have something fun to work on.

For more screenshots, feature descriptions and download info: www.codesaga.com, there is also live demo site for it, have a look: demo.codesaga.com

CodeSaga screenshot

I think it looks great. Ah – I didn’t even notice you could ajax fold-open any individual file’s changes when you’re looking at a history. Very convenient.

He was kind enough to provide a downloadable version of CodeSaga and I’ve enjoyed looking around in the spark files for interesting tricks. One of the things that caught my eye was the use of a named content for the page title.

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title><use:title>CodeSaga</use:title></title>

This is taking advantage of the fact that a <use> element will render it’s contents as a fallback if the named content doesn’t exist. Then on the pages which provide a title that’s done with a <content> element.

<content:title>
  ${urlContext.ReposName} Browse ${urlContext.Path.TrimStart((char)'/')}
</content:title>

There’s also a clever bit showing log entries:

<var changeItems="(IEnumerable[[ChangeItem]])changeset.ChangeItems" />
<if condition="!showAll">
  <set changeItems="changeItems.Where(x => x.IsRelevant).Take(5)" />
</if>
<ul class="cs-items">
  <li each="var item in changeItems" id="cs-item-${item.Id}">
    ...more stuff...
  </li>
</ul>

I like how the showAll boolean will have the changeItems reassigned with a subset of itself. Ya gotta love the each attribute on elements too.


Finally on an unrelated note – the Where’s Lou theme has been changed. Looking at a few other technical blogs I noticed they usually have a smaller font-size-to-post-width ratio than the one I was using and I was getting tired of all of the heavy borders and outlines. This theme is Dreamline, which I modded to make slightly wider and changed the color palette from blue to amber in honor of the old amber monitors and Hercules graphic cards.

Let me know if it’s awful and I’ll look into maybe going green-screen. ;)