diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 59c43eb0..b4838822 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -48,6 +48,7 @@ class ApplicationController < ActionController::Base '.pdf' => 'application/pdf', '.png' => 'image/png', '.txt' => 'text/plain', + '.tex' => 'text/plain', '.zip' => 'application/zip' } unless defined? FILE_TYPES @@ -114,7 +115,7 @@ class ApplicationController < ActionController::Base def rescue_action_in_public(exception) render :status => 500, :text => <<-EOL -
+An application error occurred while processing your request.
@@ -145,8 +146,10 @@ class ApplicationController < ActionController::Base def set_content_type_header if %w(rss_with_content rss_with_headlines).include?(action_name) @response.headers['Content-Type'] = 'text/xml; charset=UTF-8' + elsif %w(tex).include?(action_name) + @response.headers['Content-Type'] = 'text/plain; charset=UTF-8' else - @response.headers['Content-Type'] = 'text/html; charset=UTF-8' + @response.headers['Content-Type'] = 'application/xhtml+xml; charset=UTF-8' end end diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 6bf52f7c..181ed53c 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -9,7 +9,7 @@ class WikiController < ApplicationController caches_action :show, :published, :authors, :recently_revised, :list cache_sweeper :revision_sweeper - layout 'default', :except => [:rss_feed, :rss_with_content, :rss_with_headlines, :tex, :export_tex, :export_html] + layout 'default', :except => [:rss_feed, :rss_with_content, :rss_with_headlines, :tex, :pdf, :export_tex, :export_html] def index if @web_name @@ -280,8 +280,12 @@ class WikiController < ApplicationController end def tex + if @web.markup == :markdownMML + @tex_content = Maruku.new(@page.content).to_latex + else @tex_content = RedClothForTex.new(@page.content).to_tex end + end protected @@ -305,8 +309,12 @@ class WikiController < ApplicationController end def export_page_to_tex(file_path) - tex - File.open(file_path, 'w') { |f| f.write(render_to_string(:template => 'wiki/tex', :layout => false)) } + if @web.markup == :markdownMML + @tex_content = Maruku.new(@page.content).to_latex + else + @tex_content = RedClothForTex.new(@page.content).to_tex + end + File.open(file_path, 'w') { |f| f.write(render_to_string(:template => 'wiki/tex', :layout => 'tex')) } end def export_pages_as_zip(file_type, &block) @@ -396,7 +404,11 @@ class WikiController < ApplicationController def render_tex_web @web.select.by_name.inject({}) do |tex_web, page| + if @web.markup == :markdownMML + tex_web[page.name] = Maruku.new(page.content).to_latex + else tex_web[page.name] = RedClothForTex.new(page.content).to_tex + end tex_web end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 67d7ae86..e33bc0fc 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -23,7 +23,7 @@ module ApplicationHelper if element.last != selected options << "" else - options << "" + options << "" end else options << ((element != selected) ? "" : "") diff --git a/app/views/admin/create_system.rhtml b/app/views/admin/create_system.rhtml index f5d5ff7f..0ef6175c 100644 --- a/app/views/admin/create_system.rhtml +++ b/app/views/admin/create_system.rhtml @@ -7,7 +7,7 @@ <%= form_tag({ :controller => 'admin', :action => 'create_system' }, - { 'id' => 'setup', 'method' => 'post', 'onSubmit' => 'return validateSetup()', + { 'id' => 'setup', 'method' => 'post', 'onsubmit' => 'return validateSetup()', 'accept-charset' => 'utf-8' }) %>diff --git a/app/views/file/import.rhtml b/app/views/file/import.rhtml index 910ccef4..0d71ee3a 100644 --- a/app/views/file/import.rhtml +++ b/app/views/file/import.rhtml @@ -13,7 +13,7 @@
as + onclick="this.value == 'AnonymousCoward' ? this.value = '' : true" /> <% if @page %> | <%= link_to 'Cancel', :web => @web.address, :action => 'file'%> (unlocks page) <% end %> diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index 67b85e06..6c3a8132 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -1,6 +1,4 @@ - +
_your text_ | → | your text |
**your text** | → | your text |
`my code` | → | my code |
* Bulleted list * Second item | → | • Bulleted list • Second item |
1. Numbered list 1. Second item | → | 1. Numbered list 2. Second item |
[link name](URL) | → | link name |
*** | → | Horizontal ruler |
<http://url> <email@add.com> | → | Auto-linked |
![Alt text](URL) | → | Image |
For a complete list of LaTeX commands supported here, see the itex2MML Commands Summary.
diff --git a/app/views/textile_help.rhtml b/app/views/textile_help.rhtml index 3d8400b3..78f9a91e 100644 --- a/app/views/textile_help.rhtml +++ b/app/views/textile_help.rhtml @@ -1,4 +1,4 @@ -_your text_ | → | your text |
*your text* | → | your text |