epitron / redmine_ultraviolet

Advanced syntax highlighting for Redmine source code repositories (using Ultraviolet, which is based on Textmate syntax files).
Other
60 stars 20 forks source link

the plugin can not support the remdine 1.4.X #19

Open archonwang opened 12 years ago

archonwang commented 12 years ago

when I use the plugin to preview the code ,it shows erro.

ArgumentError in Repositories#entry

Showing vendor/plugins/redmine_ultraviolet/app/views/common/_file.rhtml where line #15 raised:

Output for xhtml is not yet implemented

Extracted source (around line #15):

12: 13: 14:

15: <%= syntax_highlight( filename, Redmine::CodesetUtil.to_utf8_by_setting(content) ) %> 16:
17: 18: <% content_for :header_tags do %>

Trace of template inclusion: app/views/repositories/entry.html.erb

RAILS_ROOT: C:/Rails_Prj/Redmine14

the information is :

/////////////////////////////////////////////////////////// Processing RepositoriesController#entry (for 127.0.0.1 at 2012-04-25 15:16:25) [ GET] Parameters: {"action"=>"entry", "controller"=>"repositories", "id"=>"demoproject", "path"=>["trunk", "Google_APP_SN.txt"], "rev"=>"2"} Rendering template within layouts/base Rendering repositories/entry

ActionView::TemplateError (Output for xhtml is not yet implemented) on line #15 of vendor/plugins/redmine_ultraviolet/app/views/common/_file.rhtml: 12: 13: 14:

15: <%= syntax_highlight( filename, Redmine::CodesetUtil.to_utf8_by_setting(content) ) %> 16:
17: 18: <% content_for :header_tags do %>

ultraviolet (0.10.2) lib/uv.rb:69:in `parse'
vendor/plugins/redmine_ultraviolet/app/views/common/_file.rhtml:15:in `_run_

rhtml_vendor47plugins47redmine_ultraviolet47app47views47common47_file46rhtml_locals_content_file_filename_object' app/views/repositories/entry.html.erb:11

Rendering rescues/layout (internal_server_error) ///////////////////////////////////////////////////////

epitron commented 12 years ago

Hmmm.. not sure why it says it doesn't support xhtml. That's the default output format for ultraviolet. Maybe you could try changing it to "html"? Here's how...

Edit redmine_ultraviolet/lib/ultraviolet_syntax_patch.rb, and change line 101, which reads:

return Uv.parse(content, "xhtml", syntax_name, true, @uv_theme_name)

to:

return Uv.parse(content, "html", syntax_name, true, @uv_theme_name)
archonwang commented 12 years ago

maybe in bundle, it could not support xhtml? I am not sure. anyone have any idea?

epitron commented 12 years ago

I believe I am the only one here. Also, this is an Ultraviolet error.

Which gem are you using? 'uv', or 'ultraviolet'?

archonwang commented 12 years ago

I used ultraviolet (0.10.2)

epitron commented 12 years ago

Try 'uv'.

archonwang commented 12 years ago

I not sure .for my ruby is 1.8.7

uv need ruby 1.9 +

nickcaballero commented 12 years ago

I had this same problem on 1.4.4. I installed ultraviolet with gem install ultraviolet, added a Gemfile to the plugin with gem "ultraviolet" and then bundle install --local. Works.

nickcaballero commented 12 years ago

The Gemfile was actually added in most of the forks. Maybe pull?