--- app/helpers/application_helper.rb.orig 2006-12-21 16:53:54.000000000 -0600 +++ app/helpers/application_helper.rb 2006-12-21 16:54:37.000000000 -0600 @@ -23,7 +23,7 @@ if element.last != selected options << "" else - options << "" + options << "" end else options << ((element != selected) ? "" : "") --- app/controllers/application.rb.orig 2006-12-21 16:48:49.000000000 -0600 +++ app/controllers/application.rb 2006-12-21 23:43:04.000000000 -0600 @@ -48,6 +48,7 @@ '.pdf' => 'application/pdf', '.png' => 'image/png', '.txt' => 'text/plain', + '.tex' => 'text/plain', '.zip' => 'application/zip' } unless defined? FILE_TYPES @@ -114,7 +114,7 @@ def rescue_action_in_public(exception) render :status => 500, :text => <<-EOL -
+An application error occurred while processing your request.
@@ -145,8 +146,10 @@ 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 --- app/views/admin/create_system.rhtml.orig 2006-12-21 16:58:18.000000000 -0600 +++ app/views/admin/create_system.rhtml 2006-12-21 17:07:39.000000000 -0600 @@ -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()'}) %>as + onclick="this.value == 'AnonymousCoward' ? this.value = '' : true" /> <% if @page %> | <%= link_to 'Cancel', :web => @web.address, :action => 'file'%> (unlocks page) <% end %> --- app/views/textile_help.rhtml.orig 2006-12-21 17:01:49.000000000 -0600 +++ app/views/textile_help.rhtml 2006-12-21 17:02:17.000000000 -0600 @@ -1,4 +1,4 @@ -
| _your text_ | → | your text |
| *your text* | → | your text |
| _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 |
|  | → | Image |
For a complete list of LaTeX commands supported here, see the itex2MML Commands Summary.
--- lib/bluecloth_tweaked.rb.orig 2006-12-23 01:18:19.000000000 -0600 +++ lib/bluecloth_tweaked.rb 2006-12-23 01:19:22.000000000 -0600 @@ -1112,7 +1112,7 @@ ### Return a copy of +str+ with angle brackets and ampersands HTML-encoded. def encode_html( str ) - str.gsub( /&(?!#?[x]?(?:[0-9a-f]+|\w{1,8});)/i, "&" ). + str.gsub( /&(?!#?[x]?(?:[0-9a-f]+|\w+);)/i, "&" ). gsub( %r{<(?![a-z/?\$!])}i, "<" ) end --- app/views/wiki/new.rhtml.orig 2006-12-21 17:10:16.000000000 -0600 +++ app/views/wiki/new.rhtml 2006-12-21 17:10:31.000000000 -0600 @@ -10,7 +10,7 @@ <%= form_tag({ :action => 'save', :web => @web.address, :id => @page_name}, - {'id' => 'editForm', 'method' => 'post', 'onSubmit' => 'cleanAuthorName();'}) + {'id' => 'editForm', 'method' => 'post', 'onsubmit' => 'cleanAuthorName();'}) %>--- app/views/admin/edit_web.rhtml.orig 2006-12-21 16:59:46.000000000 -0600 +++ app/views/admin/edit_web.rhtml 2006-12-21 22:54:27.000000000 -0600 @@ -1,7 +1,7 @@ <% @title = "Edit Web" %> <%= form_tag({ :controller => 'admin', :action => 'edit_web', :web => @web.address }, - {'id' => 'setup', 'method' => 'post', 'onSubmit' => 'cleanAddress(); return validateSetup()'}) + {'id' => 'setup', 'method' => 'post', 'onsubmit' => 'cleanAddress(); return validateSetup()'}) %>
--- app/views/layouts/tex.rhtml.orig 1969-12-31 18:00:00.000000000 -0600 +++ app/views/layouts/tex.rhtml 2006-12-26 14:59:13.000000000 -0600 @@ -0,0 +1 @@ +<%= @content_for_layout %> --- app/views/wiki/tex.rhtml.orig 2006-12-26 13:05:05.000000000 -0600 +++ app/views/wiki/tex.rhtml 2006-12-26 13:12:25.000000000 -0600 @@ -1,12 +1,12 @@ \documentclass[12pt,titlepage]{article} -\usepackage[danish]{babel} %danske tekster +\usepackage{amsmath} +\usepackage{amsfonts} \usepackage[OT1]{fontenc} %rigtige danske bogstaver... -\usepackage{a4} \usepackage{graphicx} \usepackage{ucs} \usepackage[utf8x]{inputenc} -\input epsf +\usepackage{hyperref} %------------------------------------------------------------------- --- app/views/wiki/page.rhtml.orig 2006-12-26 13:23:51.000000000 -0600 +++ app/views/wiki/page.rhtml 2006-12-26 13:25:00.000000000 -0600 @@ -37,7 +37,7 @@ <%= link_to('Print', { :web => @web.address, :action => 'print', :id => @page.name }, { :accesskey => 'p', :name => 'view_print' }) %> - <% if defined? RedClothForTex and RedClothForTex.available? and @web.markup == :textile %> + <% if defined? RedClothForTex and RedClothForTex.available? and @web.markup == :textile or @web.markup == :markdownMML %> | <%= link_to 'TeX', {:web => @web.address, :action => 'tex', :id => @page.name}, {:name => 'view_tex'} %> --- lib/chunks/engines.rb.orig 2006-12-21 22:32:47.000000000 -0600 +++ lib/chunks/engines.rb 2007-01-13 02:06:22.000000000 -0600 @@ -40,6 +40,13 @@ end end + class MarkdownMML < AbstractEngine + def mask + require_dependency 'maruku' + Maruku.new(@content.delete("\r")).to_html + end + end + class Mixed < AbstractEngine def mask require_dependency 'redcloth' @@ -57,6 +64,6 @@ end end - MAP = { :textile => Textile, :markdown => Markdown, :mixed => Mixed, :rdoc => RDoc } + MAP = { :textile => Textile, :markdown => Markdown, :markdownMML => MarkdownMML, :mixed => Mixed, :rdoc => RDoc } MAP.default = Textile end --- app/controllers/wiki_controller.rb.orig 2006-12-26 01:49:25.000000000 -0600 +++ app/controllers/wiki_controller.rb 2007-01-13 02:19:11.000000000 -0600 @@ -8,7 +8,7 @@ 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 @@ -279,8 +279,12 @@ 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 @@ end def export_page_to_tex(file_path) - tex - File.open(file_path, 'w') { |f| f.write(render_to_string(:template => 'wiki/tex', :layout => nil)) } + 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) @@ -392,7 +400,11 @@ 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 --- public/stylesheets/instiki.css.orig 2007-01-13 02:33:09.000000000 -0600 +++ public/stylesheets/instiki.css 2007-01-13 02:31:51.000000000 -0600 @@ -81,3 +81,8 @@ /* Affects the display of "category: ..." */ .property { color: #999; font-size: 80%; } + +merror {display:inline;font-size:1em;} +math[display=block] {overflow:auto;} +math { white-space: nowrap } +.eqno {float:right}