From f7b7d0d96594d21caba71177885530f13c2007a9 Mon Sep 17 00:00:00 2001 From: rick Date: Mon, 3 Jan 2011 15:52:13 -0800 Subject: [PATCH] add mediawiki support --- lib/gollum/page.rb | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/lib/gollum/page.rb b/lib/gollum/page.rb index 5b888964..7a71fbdc 100644 --- a/lib/gollum/page.rb +++ b/lib/gollum/page.rb @@ -4,15 +4,16 @@ module Gollum Wiki.page_class = self - VALID_PAGE_RE = /^(.+)\.(md|mkdn?|mdown|markdown|textile|rdoc|org|creole|re?st(\.txt)?|asciidoc|pod)$/i - FORMAT_NAMES = { :markdown => "Markdown", - :textile => "Textile", - :rdoc => "RDoc", - :org => "Org-mode", - :creole => "Creole", - :rest => "reStructuredText", - :asciidoc => "AsciiDoc", - :pod => "Pod" } + VALID_PAGE_RE = /^(.+)\.(md|mkdn?|mdown|markdown|textile|rdoc|org|creole|re?st(\.txt)?|asciidoc|pod|(media)?wiki)$/i + FORMAT_NAMES = { :markdown => "Markdown", + :textile => "Textile", + :rdoc => "RDoc", + :org => "Org-mode", + :creole => "Creole", + :rest => "reStructuredText", + :asciidoc => "AsciiDoc", + :mediawiki => "MediaWiki", + :pod => "Pod" } # Sets a Boolean determing whether this page is a historical version. # @@ -161,6 +162,8 @@ module Gollum :pod when /\.(\d)$/i :roff + when /\.(media)?wiki$/i + :mediawiki else nil end @@ -244,14 +247,15 @@ module Gollum # Returns the String extension (no leading period). def self.format_to_ext(format) case format - when :markdown then 'md' - when :textile then 'textile' - when :rdoc then 'rdoc' - when :org then 'org' - when :creole then 'creole' - when :rest then 'rest' - when :asciidoc then 'asciidoc' - when :pod then 'pod' + when :markdown then 'md' + when :textile then 'textile' + when :rdoc then 'rdoc' + when :org then 'org' + when :creole then 'creole' + when :rest then 'rest' + when :asciidoc then 'asciidoc' + when :pod then 'pod' + when :mediawiki then 'mediawiki' end end