Permalink
Browse files

Merge remote-tracking branch 'upstream/master'

  • Loading branch information...
2 parents cd8a591 + e3d37d4 commit b1dd42d71a4d62363781bb78dfd5220e1619e5ae @vinbarnes vinbarnes committed Jul 4, 2012
Showing with 13 additions and 3 deletions.
  1. +2 −1 README.rdoc
  2. +1 −1 example/something.css
  3. +7 −1 lib/showoff.rb
  4. +3 −0 lib/showoff_utils.rb
View
@@ -503,11 +503,12 @@ Then restart showoff, and navigate to <tt>/pdf</tt> (e.g. http://localhost/pdf)
== Markdown Engine
It is possible to configure the markdown engine of your choice to use
-with showoff. The following engines come preconfigured:
+with showoff. The following engines are available:
* redcarpet (default)
* bluecloth
* maruku
+* kramdown
* rdiscount
Configuring an engine (or overriding it's default configuration) allows you to access special features of that engine.
View
@@ -1,4 +1,4 @@
-/* customr css and js files included at the top level of your presentation will
+/* custom css and js files included at the top level of your presentation will
* will be included in your presentation */
.title-slide h1 {
View
@@ -36,6 +36,7 @@ class ShowOff < Sinatra::Application
set :page_size, "Letter"
set :pres_template, nil
set :showoff_config, nil
+ set :encoding, nil
def initialize(app=nil)
super(app)
@@ -61,7 +62,8 @@ def initialize(app=nil)
showoff_json = JSON.parse(File.read(ShowOffUtils.presentation_config_file))
settings.showoff_config = showoff_json
- # Set options for template and page size
+ # Set options for encoding, template and page size
+ settings.encoding = showoff_json["encoding"]
settings.page_size = showoff_json["page-size"] || "Letter"
settings.pres_template = showoff_json["templates"]
end
@@ -145,6 +147,10 @@ def empty?
def process_markdown(name, content, static=false, pdf=false)
+ if settings.encoding and content.respond_to?(:force_encoding)
+ content.force_encoding(settings.encoding)
+ end
+
# if there are no !SLIDE markers, then make every H1 define a new slide
unless content =~ /^\<?!SLIDE/m
content = content.gsub(/^# /m, "<!SLIDE>\n# ")
View
@@ -425,6 +425,9 @@ def self.setup(dir_name)
when 'bluecloth'
Tilt.prefer Tilt::BlueClothTemplate, "markdown"
+ when 'kramdown'
+ Tilt.prefer Tilt::KramdownTemplate, "markdown"
+
else
Tilt.prefer Tilt::RedcarpetTemplate, "markdown"

0 comments on commit b1dd42d

Please sign in to comment.