Dam, writing installation & documentation it is boring. I never expected it to be this much work to just get a first release out the door. Well now that it is done I can spend time implementing new features again.
Yesterday I finished the implementation of the history log rss feed. I was also able to fix CSS issues with Firefox2 and Chrome as well. There is a new download available on www.codesaga.com, the demo site is also updated.
The rss feed was interesting to implement as it was the first time I ever implemented an rss feed. It was very easy, just a normal view but with the response content type set to text/xml.
<?xml version="1.0"?> <viewdata model="HistoryRssViewModel" /> <viewdata urlContext="RepositoryUrlContext"/> <rss version="2.0"> <channel> <title>CodeSaga - ${Html.Encode(urlContext.ReposName)}</title> <link> ${Url.AbsoluteRouteUrl(RouteName.History, new {urlPath=urlContext.Url})} </link> <description> History for the ${Html.Encode(urlContext.ReposName)} repository and directory ${Html.Encode(urlContext.Path)} </description> <item each="var changeset in ViewData.Model.Changesets"> <var changesetUrl="Url.AbsoluteRouteUrl(RouteName.ChangesetDetail, new {urlPath=urlContext.Url, cs=changeset.Revision})" /> <title>${Html.Encode(changeset.Message.TrimWithElipsis(90))}</title> <pubDate>${changeset.Time.ToString("R")}</pubDate> <author>${Html.Encode(changeset.Author)}</author> <link>${changesetUrl}</link> <guid isPermaLink="false">${changesetUrl}</guid> <description> /// rss article html </description> </item> </channel> </rss>
I omitted the rss item content to keep the sample smaller. The biggest change from a normal view is that all links and urls must be made absolute. For this I created a extension method, AbsoluteRouteUrl, on the UrlHelper class.
Since you cannot include css files in the item description you are limited to inline css, and most rss readers will parse the rss item html and remove unwanted tags and css. I tried a simple table layout with cell background colors, it looks pretty good in Newsgator:
I also tried Google Reader, it looks similar but not as good in google reader as it forces a specific width for the rss item content, not good for wide monitors (you can override this by using a greasemonkey script).
I haven't figured out a good way to unit test the rss feed yet. I am not talking about the controller action, that was simple, no I mean the actual rss output generated by the view. One way would be to do some serious mocking to get the view engine to work in a unit test or try Watin and see how it handles rss content.
I have a lot of fun stuff in the backlog for CodeSaga:
- Interactive charts and graphs in Silverlight (why not I am doing this app for fun and this sounds like fun to do!)
- Advanced search options and filtering, search on file content using Lucene.NET
- Arbitrary diffs, side by side diffs, diff options (context lines)
- File content view,
- File history view
- Integration with TFS issue tracking
- Parsing commit message for issue ids and link to issue
Will all this get done? I highly doubt it :) But it is good to have a plan / vision. How come I have had time to work on this? Well I haven't been coding much at work the last couple months so I have had a lot of will / energy to work on something after work and while hung over on Sundays.
And to be honest it just began as a experiment and grew to something more, and the last couple of weeks it has been like "well you have spent all this time working on this, you might as well release it and not let all that time go to waste". Not that it would have been a waste, I feel like I am getting very efficient with ASP.NET MVC. It feels kind of daunting now that it has been released, because now I feel even more obliged to work on it.