markdown_presenter 0.4.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/markdown_presenter.rb +4 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 56c29260da2e4ef0af511f36044e1d5e07b0071f
4
- data.tar.gz: 39545651df211ad2e1c53e08c9fb0cff5ee67e16
3
+ metadata.gz: e9f9121ee2a813ab86a1509206a2c7e2ce7a0475
4
+ data.tar.gz: 82c2a0c7ac60d6ec0a3730ba9dd93cf14e555c09
5
5
  SHA512:
6
- metadata.gz: 6b53affa518546b92cd1d3eea1782f4e77723b75f866d771b1875efc12aee9a149b97e95c32e8e958befabe5219af1f01ce82c3bd28e1add3274f9b6de495dba
7
- data.tar.gz: 7ce59b2e81371200136cf45e8c528219517e9d178ad2248f4c13858e4936afeba974f3793053d3d1548719a40c42975840778d6333a60617b241f1755950fa42
6
+ metadata.gz: 5c581aad00fb56b386f2a512882c32e6e0a994664ade3da76b756ce99493602fe2f4bd78cb679e2f53b18e451121b2c9e06a9dc5016492aeb84aa801ef22dcf3
7
+ data.tar.gz: 7fb4773a320b972699ee3a33d8a4cf9da7d9efd72a618091f9b6fdabdf3a5d26c7f96390edac15ea872c8287188449b165b82cfa3de08ec55a270d1371ea69d6
@@ -6,7 +6,7 @@ require 'kramdown'
6
6
  def present title, content
7
7
  template = File.read(File.join(File.dirname(__FILE__), "../presenter.html.haml"))
8
8
  haml_engine = Haml::Engine.new(template)
9
- haml_engine.render(Object.new, {slides: content.split(/(?=<h1)/), title: title}) do |filename|
9
+ haml_engine.render(Object.new, {slides: content.split(/(?=<h1)/).reject {|s| s.chomp.empty?}, title: title}) do |filename|
10
10
  File.read File.join(File.dirname(__FILE__), "../", filename)
11
11
  end
12
12
  end
@@ -16,7 +16,9 @@ def content_of filename
16
16
  Kramdown::Document.new(File.read(filename)).to_html
17
17
 
18
18
  elsif filename.end_with? ".html"
19
- File.read(filename)
19
+ require 'nokogiri'
20
+ doc = Nokogiri::HTML(File.read(filename))
21
+ doc.search('body')[0].inner_html
20
22
 
21
23
  else
22
24
  $stderr.puts "Format not supported: #{File.extname(filename)}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markdown_presenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu Tanguay-Carel