instiki/lib/maruku/defaults.rb

66 lines
1.6 KiB
Ruby
Raw Normal View History

2007-01-22 15:36:51 +01:00
#--
# Copyright (C) 2006 Andrea Censi <andrea (at) rubyforge.org>
#
# This file is part of Maruku.
#
# Maruku is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Maruku is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Maruku; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#++
module MaRuKu
Globals = {
:unsafe_features => false,
2007-01-23 16:26:45 +01:00
:on_error => :warning,
2007-01-22 15:36:51 +01:00
2007-01-23 16:26:45 +01:00
:use_numbered_headers => false,
2007-01-22 15:36:51 +01:00
:maruku_signature => false,
:code_background_color => '#fef',
:code_show_spaces => false,
:html_math_engine => 'itex2mml', #ritex, itex2mml, none
:html_png_engine => 'none',
:html_png_dir => 'pngs',
:html_png_url => 'pngs/',
:html_png_resolution => 200,
2007-01-22 15:36:51 +01:00
:html_use_syntax => false,
2007-01-23 16:26:45 +01:00
:latex_use_listings => false,
:latex_cjk => false,
:debug_keep_ials => false,
2007-01-22 15:36:51 +01:00
}
class MDElement
def get_setting(sym)
if self.attributes.has_key?(sym) then
return self.attributes[sym]
elsif self.doc && self.doc.attributes.has_key?(sym) then
return self.doc.attributes[sym]
elsif MaRuKu::Globals.has_key?(sym)
return MaRuKu::Globals[sym]
else
$stderr.puts "Bug: no default for #{sym.inspect}"
nil
end
end
end
end