mmarkdown 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1b7233d3c397aa996268f8b85551e98b21ca7bf
4
- data.tar.gz: ca4a64a6d88b53ea915713cbd59c4ad67207f3a1
3
+ metadata.gz: 3f0ec6fb4f618a9ee8807d57cdafbe713b79ec00
4
+ data.tar.gz: 3f5dda12f6f1da38c851a1cc6b352af8cdb00e43
5
5
  SHA512:
6
- metadata.gz: 1337a3452fba6d10d81c5e7738e020db7e7797e67d94a0403f24a0ab2b6e1900c3bfb1325cb953646d9e0c00c9c852405526ae538f56706250f57080040c8ec1
7
- data.tar.gz: d1dffa61c7de3df835358fcfb2baf784767d3db8ce865d92dc854a218a30334bedc981bfbbc2f9ed7748d58019244e31a6d84b5d677c2f6fc8903306f203faed
6
+ metadata.gz: 3b62550197b658c6b0049f738d94c718bd9d37991e5ed4669061d47feb56013f1f3bc671ed7569320bcc5867172e9d8d7adef8514f812bfabaaab252572baae7
7
+ data.tar.gz: 81048d75a3f3c9bd0eb6989b6563b2e57d3c103ca6312c55be1ed49d800bdce2983724147fec074c73cdb1635817436427054642d83fc0dcb870552f9c272912
@@ -2,7 +2,7 @@
2
2
  class MMarkdown
3
3
  VERSION_MAJOR = 0
4
4
  VERSION_MINOR = 0
5
- VERSION_REVISION = 4
5
+ VERSION_REVISION = 5
6
6
 
7
7
  VERSION = "#{VERSION_MAJOR}.#{VERSION_MINOR}.#{VERSION_REVISION}"
8
8
  end
data/lib/mmarkdown.rb CHANGED
@@ -4,6 +4,12 @@ require "redcarpet"
4
4
  require "#{__dir__}/mmarkdown/version"
5
5
 
6
6
  class MMarkdown
7
+ def self.load_file filename
8
+ str = File.open(filename).read
9
+
10
+ return self.new(str)
11
+ end
12
+
7
13
  def initialize md_string
8
14
  @md_mathml = equations_to_mathml(md_string)
9
15
 
@@ -40,7 +46,7 @@ class MMarkdown
40
46
  end
41
47
 
42
48
  def toc_html nesting_level = 3
43
- render_toc = Redcarpet::Render::HTML_TOC.new
49
+ render_toc = Redcarpet::Render::HTML_TOC.new(nesting_level: nesting_level)
44
50
  toc_html = Redcarpet::Markdown.new(render_toc).render(@md_mathml)
45
51
 
46
52
  return toc_html
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mmarkdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroyuki Tanaka