add mediawiki support
This commit is contained in:
+21
-17
@@ -4,15 +4,16 @@ module Gollum
|
|||||||
|
|
||||||
Wiki.page_class = self
|
Wiki.page_class = self
|
||||||
|
|
||||||
VALID_PAGE_RE = /^(.+)\.(md|mkdn?|mdown|markdown|textile|rdoc|org|creole|re?st(\.txt)?|asciidoc|pod)$/i
|
VALID_PAGE_RE = /^(.+)\.(md|mkdn?|mdown|markdown|textile|rdoc|org|creole|re?st(\.txt)?|asciidoc|pod|(media)?wiki)$/i
|
||||||
FORMAT_NAMES = { :markdown => "Markdown",
|
FORMAT_NAMES = { :markdown => "Markdown",
|
||||||
:textile => "Textile",
|
:textile => "Textile",
|
||||||
:rdoc => "RDoc",
|
:rdoc => "RDoc",
|
||||||
:org => "Org-mode",
|
:org => "Org-mode",
|
||||||
:creole => "Creole",
|
:creole => "Creole",
|
||||||
:rest => "reStructuredText",
|
:rest => "reStructuredText",
|
||||||
:asciidoc => "AsciiDoc",
|
:asciidoc => "AsciiDoc",
|
||||||
:pod => "Pod" }
|
:mediawiki => "MediaWiki",
|
||||||
|
:pod => "Pod" }
|
||||||
|
|
||||||
# Sets a Boolean determing whether this page is a historical version.
|
# Sets a Boolean determing whether this page is a historical version.
|
||||||
#
|
#
|
||||||
@@ -161,6 +162,8 @@ module Gollum
|
|||||||
:pod
|
:pod
|
||||||
when /\.(\d)$/i
|
when /\.(\d)$/i
|
||||||
:roff
|
:roff
|
||||||
|
when /\.(media)?wiki$/i
|
||||||
|
:mediawiki
|
||||||
else
|
else
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
@@ -244,14 +247,15 @@ module Gollum
|
|||||||
# Returns the String extension (no leading period).
|
# Returns the String extension (no leading period).
|
||||||
def self.format_to_ext(format)
|
def self.format_to_ext(format)
|
||||||
case format
|
case format
|
||||||
when :markdown then 'md'
|
when :markdown then 'md'
|
||||||
when :textile then 'textile'
|
when :textile then 'textile'
|
||||||
when :rdoc then 'rdoc'
|
when :rdoc then 'rdoc'
|
||||||
when :org then 'org'
|
when :org then 'org'
|
||||||
when :creole then 'creole'
|
when :creole then 'creole'
|
||||||
when :rest then 'rest'
|
when :rest then 'rest'
|
||||||
when :asciidoc then 'asciidoc'
|
when :asciidoc then 'asciidoc'
|
||||||
when :pod then 'pod'
|
when :pod then 'pod'
|
||||||
|
when :mediawiki then 'mediawiki'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user