mdtohtml 0.0.2 → 0.0.3
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/README.md +11 -0
- data/bin/mdtohtml +3 -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: f0059ea6c5a409f01593a696b95493d5bd77b51b
|
4
|
+
data.tar.gz: ae829631326956b285f4ce05a384a84a83331dd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 459ca0fe106c2db7fdc93588e061e21c948f3bcf892f0d422b727f627c46c1b52d4b5bb9d34b5904cd1852497151840ceca48ed2ce5b82a62e60715d7c9ab410
|
7
|
+
data.tar.gz: 498399fd45406d7e75d5bf8b956bfe56278096949935516191a59697576c433de851ed227818286fa8c2e47fc577a1d6517400aa1d4aebb228829d51e3095232
|
data/README.md
CHANGED
@@ -3,6 +3,17 @@
|
|
3
3
|
This utility utilize [`redcarpet` markdown parser](https://github.com/vmg/redcarpet) and [`github-markdown.css` by sindresorhus](https://github.com/sindresorhus/github-markdown-css) to generate `html` file for printing.
|
4
4
|
|
5
5
|
|
6
|
+
# Install From Gem
|
7
|
+
|
8
|
+
```sh
|
9
|
+
# search it
|
10
|
+
gem list -r mdtohtml
|
11
|
+
|
12
|
+
# and install it
|
13
|
+
gem install mdtohtml
|
14
|
+
```
|
15
|
+
|
16
|
+
|
6
17
|
# Dev Env Setup
|
7
18
|
|
8
19
|
```sh
|
data/bin/mdtohtml
CHANGED
@@ -6,12 +6,14 @@ def mdtohtml(file)
|
|
6
6
|
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true)
|
7
7
|
out_file_content = markdown.render(File.read(file))
|
8
8
|
|
9
|
-
|
9
|
+
basename = File.basename(file, '.*')
|
10
|
+
out_file = basename + '.html'
|
10
11
|
fp = File.open(out_file, "w")
|
11
12
|
|
12
13
|
fp.write('
|
13
14
|
<html>
|
14
15
|
<head>
|
16
|
+
<title>' + basename + '</title>
|
15
17
|
<link rel="stylesheet" href="https://raw.githubusercontent.com/sindresorhus/github-markdown-css/gh-pages/github-markdown.css">
|
16
18
|
<style>
|
17
19
|
.markdown-body {
|