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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 519bd68e8ab79b21e805f0e9d2ee48a83a13ffed
4
- data.tar.gz: 4b59e8c60cf9a4716caaea45ec364747dde05c70
3
+ metadata.gz: 7098f0be29db69e46d6c3b5a5558055bff07c782
4
+ data.tar.gz: ced6c2fc2f4f8ea05dca77a7db914e1ce761d1a4
5
5
  SHA512:
6
- metadata.gz: 19f0e524e2e05160a7efbd405ae0101d3ec3c6ccad2c1d4a9b95dfc999a0b93f9a871511459b2b31233a035b58dd8aaaa1f4363d47213b20cf63f68fcd3120ba
7
- data.tar.gz: 190ec8b756be18cf89def17e8a8fb6a75d997417a13ad143450936eb2526e7d00f2cdfb089292a7fe3802014709f7fd9b7354f6e182ca66a115629109f107370
6
+ metadata.gz: f6c8f2dbe464973efe211b17695c1171ed154a91585f77f0ee16b186c3594d692e7beb1db98f86f770299b26bcd717c113c2630a048a2eb508217a4ae81b2911
7
+ data.tar.gz: 03a1717e244ac560c1a98d7b8fe7bfcec8663f5ff323c77c8712226179cc026a66d5c5cfd5163489fc59c3e05143aaf8e8d3b454ff3019edc6c0a4680efcbfc0
data/README.md CHANGED
@@ -19,6 +19,12 @@ Or install it yourself as:
19
19
 
20
20
  ## Usage
21
21
 
22
+ ```console
23
+ $ md2hiki README.md
24
+ ```
25
+
26
+ or
27
+
22
28
  ```rb
23
29
  markdown = <<MARKDOWN
24
30
  [redcarpet-render-hiki](https://github.com/hanachin/redcarpet-render-hiki)で、
@@ -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
@@ -4,7 +4,7 @@ module Redcarpet
4
4
  class Base; end
5
5
 
6
6
  class Hiki < Base
7
- VERSION = "0.0.2"
7
+ VERSION = "0.0.3"
8
8
  end
9
9
  end
10
10
  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.2
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