mdtohtml 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/mdtohtml +13 -19
- 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: b432d360dd17e2ea3826c36bfb46067e2ed08e75
|
4
|
+
data.tar.gz: 54d79a0e1954f4ac91557ab9d3cac5b036672afa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c3871ab10c7385a44ef6efcc0f0eb66db3e278ca881ccc22d7b8fbbed812ba7bde6fecc02dfa1865e9068361ef35579c3e58070613b72e90458bc9bb0a19312
|
7
|
+
data.tar.gz: 808316b51494575de5da9766ab321050bfef38c70b9f1061e6e0701a3c445c6971df9b57c196a65028e153cc70b56da33569726d54d8d711fb03b8ca339859ab
|
data/bin/mdtohtml
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'redcarpet'
|
4
4
|
|
5
5
|
def mdtohtml(file)
|
6
|
-
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true)
|
6
|
+
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, fenced_code_blocks: true, autolink: true, tables: true)
|
7
7
|
out_file_content = markdown.render(File.read(file))
|
8
8
|
|
9
9
|
basename = File.basename(file, '.*')
|
@@ -11,26 +11,20 @@ def mdtohtml(file)
|
|
11
11
|
fp = File.open(out_file, "w")
|
12
12
|
|
13
13
|
fp.write('
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
margin: 0 auto;
|
23
|
-
padding: 30px;
|
24
|
-
}
|
25
|
-
</style>
|
26
|
-
</head>
|
27
|
-
<body>
|
28
|
-
<article class="markdown-body">')
|
14
|
+
<html>
|
15
|
+
<head>
|
16
|
+
<title>' + basename + '</title>
|
17
|
+
<link rel="stylesheet" href="https://raw.githubusercontent.com/githubutilities/mdtohtml/master/css/github-markdown.css">
|
18
|
+
</head>
|
19
|
+
<body>
|
20
|
+
<article class="markdown-body">'
|
21
|
+
)
|
29
22
|
fp.write(out_file_content)
|
30
23
|
fp.write('
|
31
|
-
|
32
|
-
|
33
|
-
|
24
|
+
</article>
|
25
|
+
</body>
|
26
|
+
</html>'
|
27
|
+
)
|
34
28
|
# close the file to save the changes
|
35
29
|
fp.close
|
36
30
|
end
|