redcarpet-render-hiki 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/bin/md2hiki +25 -0
- data/lib/redcarpet/render/hiki/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7098f0be29db69e46d6c3b5a5558055bff07c782
|
4
|
+
data.tar.gz: ced6c2fc2f4f8ea05dca77a7db914e1ce761d1a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6c8f2dbe464973efe211b17695c1171ed154a91585f77f0ee16b186c3594d692e7beb1db98f86f770299b26bcd717c113c2630a048a2eb508217a4ae81b2911
|
7
|
+
data.tar.gz: 03a1717e244ac560c1a98d7b8fe7bfcec8663f5ff323c77c8712226179cc026a66d5c5cfd5163489fc59c3e05143aaf8e8d3b454ff3019edc6c0a4680efcbfc0
|
data/README.md
CHANGED
data/bin/md2hiki
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'redcarpet'
|
4
|
+
require 'redcarpet/render/hiki'
|
5
|
+
|
6
|
+
markdown_p = -> (path) {
|
7
|
+
ext = File.extname(path).downcase
|
8
|
+
File.exist?(path) && %w(.md .markdown).include?(ext)
|
9
|
+
}
|
10
|
+
|
11
|
+
unless ARGV.all?(&markdown_p)
|
12
|
+
puts 'Usage: md2hiki file.md [file.md ...]'
|
13
|
+
exit 1
|
14
|
+
end
|
15
|
+
|
16
|
+
renderer = Redcarpet::Render::Hiki
|
17
|
+
rc_markdown = Redcarpet::Markdown.new(renderer.new, fenced_code_blocks: true, strikethrough: true)
|
18
|
+
|
19
|
+
ARGV.each do |path|
|
20
|
+
basename = File.basename(path, '.*')
|
21
|
+
dir = File.dirname(path)
|
22
|
+
hiki_path = File.join(dir, "#{basename}.hiki")
|
23
|
+
markdown = File.read(path)
|
24
|
+
File.write(hiki_path, rc_markdown.render(markdown))
|
25
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redcarpet-render-hiki
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seiei Higa
|
@@ -98,7 +98,8 @@ description: Hiki renderer plugin for the redcarpet. You can convert Markdown to
|
|
98
98
|
easier.
|
99
99
|
email:
|
100
100
|
- hanachin@gmail.com
|
101
|
-
executables:
|
101
|
+
executables:
|
102
|
+
- md2hiki
|
102
103
|
extensions: []
|
103
104
|
extra_rdoc_files: []
|
104
105
|
files:
|
@@ -108,6 +109,7 @@ files:
|
|
108
109
|
- LICENSE.txt
|
109
110
|
- README.md
|
110
111
|
- Rakefile
|
112
|
+
- bin/md2hiki
|
111
113
|
- lib/redcarpet/render/hiki.rb
|
112
114
|
- lib/redcarpet/render/hiki/version.rb
|
113
115
|
- redcarpet-render-hiki.gemspec
|