Using github's linguist to better detect filetypes and to do syntax highlighting.

This commit is contained in:
Arthur Schreiber 2012-04-20 23:21:12 +02:00
parent 9ee345750c
commit 5b6019f357
6 changed files with 21 additions and 56 deletions

View file

@ -11,10 +11,10 @@
- if file.text?
.view_file_content
- unless file.empty?
%div{:class => current_user.dark_scheme ? "black" : "white"}
= preserve do
= raw file.colorize
- else
%div{:class => current_user.dark_scheme ? "black" : "white"}
= preserve do
= raw file.colorize(options: { linenos: 'True'})
- else
%h3
%center Empty file
- elsif file.image?

View file

@ -13,8 +13,7 @@
.view_file_header
%strong= @snippet.file_name
.view_file_content
%div{:class => current_user.dark_scheme ? "black" : ""}
:erb
<%= raw @snippet.colorize %>
%div{:class => current_user.dark_scheme ? "black" : ""}
= raw @snippet.colorize(options: { linenos: 'True'})
= render "notes/notes", :tid => @snippet.id, :tt => "snippet"