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 +4 -4
- data/lib/mmarkdown/version.rb +1 -1
- data/lib/mmarkdown.rb +7 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f0ec6fb4f618a9ee8807d57cdafbe713b79ec00
|
4
|
+
data.tar.gz: 3f5dda12f6f1da38c851a1cc6b352af8cdb00e43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b62550197b658c6b0049f738d94c718bd9d37991e5ed4669061d47feb56013f1f3bc671ed7569320bcc5867172e9d8d7adef8514f812bfabaaab252572baae7
|
7
|
+
data.tar.gz: 81048d75a3f3c9bd0eb6989b6563b2e57d3c103ca6312c55be1ed49d800bdce2983724147fec074c73cdb1635817436427054642d83fc0dcb870552f9c272912
|
data/lib/mmarkdown/version.rb
CHANGED
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
|