Permalink
Browse files

For the markup engine config settings, hash keys are converted from s…

…trings to symbols.

The Tilt markup engine wrappers expect hash keys that are symbols, and there is no way to specify hashes in that format in JSON. But there's no reason the existing Maruku engine settings code couldn't be tweaked to expect symbol keys and work the same way.
  • Loading branch information...
1 parent ed09534 commit 47259576381ac3c7351dc352da3a7bb21d20f5f9 @MichaelHackett committed Sep 13, 2012
Showing with 7 additions and 6 deletions.
  1. +7 −6 lib/showoff_utils.rb
View
@@ -316,6 +316,7 @@ def self.showoff_markdown(dir = ".")
def self.showoff_renderer_options(dir = '.', default_options = {})
opts = get_config_option(dir, showoff_markdown(dir))
+ Hash[opts.map {|k, v| [k.to_sym, v]}] # keys must be symbols
end
def self.get_config_option(dir, option, default = nil)
@@ -413,17 +414,17 @@ def self.setup(dir_name)
# Load maruku options
opts = ShowOffUtils.showoff_renderer_options(dir_name,
- { 'use_tex' => false,
- 'png_dir' => 'images',
- 'html_png_url' => '/file/images/'})
+ { :use_tex => false,
+ :png_dir => 'images',
+ :html_png_url => '/file/images/'})
- if opts['use_tex']
+ if opts[:use_tex]
MaRuKu::Globals[:html_math_output_mathml] = false
MaRuKu::Globals[:html_math_engine] = 'none'
MaRuKu::Globals[:html_math_output_png] = true
MaRuKu::Globals[:html_png_engine] = 'blahtex'
- MaRuKu::Globals[:html_png_dir] = opts['png_dir']
- MaRuKu::Globals[:html_png_url] = opts['html_png_url']
+ MaRuKu::Globals[:html_png_dir] = opts[:png_dir]
+ MaRuKu::Globals[:html_png_url] = opts[:html_png_url]
end
when 'bluecloth'

0 comments on commit 4725957

Please sign in to comment.