Module: MarkdownConfig
- Defined in:
- lib/showoff_utils.rb
Overview
Load the configuration for the markdown engine from the showoff.json file
Class Method Summary collapse
Class Method Details
.defaults(dir_name) ⇒ Object
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 |
# File 'lib/showoff_utils.rb', line 451 def self.defaults(dir_name) case ShowOffUtils.showoff_markdown(dir_name) when 'rdiscount' { :autolink => true, } when 'maruku' {} when 'bluecloth' { :auto_links => true, :definition_lists => true, :strikethrough => true, :superscript => true, :tables => true, } when 'kramdown' {} else { :autolink => true, :no_intra_emphasis => true, :strikethrough => true, :superscript => true, :tables => true, :underline => true, } end end |
.setup(dir_name) ⇒ Object
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 |
# File 'lib/showoff_utils.rb', line 411 def self.setup(dir_name) # Load markdown configuration case ShowOffUtils.showoff_markdown(dir_name) when 'rdiscount' Tilt.prefer Tilt::RDiscountTemplate, "markdown" when 'maruku' Tilt.prefer Tilt::MarukuTemplate, "markdown" # Now check if we can go for latex mode require 'maruku' require 'maruku/ext/math' # Load maruku options opts = ShowOffUtils.(dir_name, { :use_tex => false, :png_dir => 'images', :html_png_url => '/file/images/'}) 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] end when 'bluecloth' Tilt.prefer Tilt::BlueClothTemplate, "markdown" when 'kramdown' Tilt.prefer Tilt::KramdownTemplate, "markdown" else Tilt.prefer Tilt::RedcarpetTemplate, "markdown" end end |