Jean-Philippe Lang 889d50089d Added syntax highlightment for repository files (using CodeRay).
Supported languages: c, ruby, rhtml, yaml, html, xml.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@644 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-08-15 20:20:18 +00:00

24 lines
602 B
Plaintext

<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
<table class="list CodeRay">
<thead>
<tr>
<th colspan="2" class="list-filename"><%= @path %></th>
</tr>
</thead>
<tbody>
<% line_num = 1 %>
<% syntax_highlight(@path, @content).each_line do |line| %>
<tr>
<th class="line-num"><%= line_num %></th>
<td class="line-code"><pre><%= line %></pre></td>
</tr>
<% line_num += 1 %>
<% end %>
<tbody>
</table>
<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>
<% end %>