redcarpet-render-hiki 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4af88aa7ed69dfb1e234b79ff7c4f37c8e3d74f2
4
+ data.tar.gz: 90f80198092148792dcbb2e6b6de28725b5b3273
5
+ SHA512:
6
+ metadata.gz: 990a8d1111c01078d63df96e1c224f325a285f5f1b705ef5008e26e1aa8520265fedef27cbf33dfba3d9035f7c1583a8cbb12000bd0c594b5b7ff32a5010394b
7
+ data.tar.gz: b8079b3eaf2e919e960f83275f7406f28ebdc6915b21dd25ce34b0103d73cf53041a605722a6cc5c7f9682cfe608a3834fe7b5835fe8e96e99d7f7ff72827c27
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ vendor
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2
4
+ script: bundle exec ruby test/test_recarpet-render-hiki.rb
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in redcarpet-render-hiki.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Seiei Higa
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # Redcarpet::Render::Hiki
2
+ [![Build Status](https://travis-ci.org/hanachin/redcarpet-render-hiki.svg)](https://travis-ci.org/hanachin/redcarpet-render-hiki)
3
+
4
+ Hiki renderer plugin for the redcarpet. You can convert Markdown to Hiki easier.
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'redcarpet-render-hiki'
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install redcarpet-render-hiki
19
+
20
+ ## Usage
21
+
22
+ ```rb
23
+ markdown = <<MARKDOWN
24
+ [redcarpet-render-hiki](https://github.com/hanachin/redcarpet-render-hiki)で、
25
+ Markdownをhiki記法に変換したい。
26
+ なぜなら、Markdownで書かれた記事をhikiに変換できるとるびまの編集の手間が減って、
27
+ 世界がちょっと幸せになりそうだからだ。
28
+ MARKDOWN
29
+
30
+ renderer = Redcarpet::Render::Hiki
31
+ rc_markdown = Redcarpet::Markdown.new(renderer.new)
32
+ puts rc_markdown.render(markdown)
33
+
34
+ # =>
35
+ # [[redcarpet-render-hiki|https://github.com/hanachin/redcarpet-render-hiki]]で、
36
+ # Markdownをhiki記法に変換したい。
37
+ # なぜなら、Markdownで書かれた記事をhikiに変換できるとるびまの編集の手間が減って、
38
+ # 世界がちょっと幸せになりそうだからだ。
39
+ ```
40
+
41
+ ## Contributing
42
+
43
+ 1. Fork it ( http://github.com/hanachin/redcarpet-render-hiki/fork )
44
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
45
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
46
+ 4. Push to the branch (`git push origin my-new-feature`)
47
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,16 @@
1
+ require "redcarpet/render/hiki/version"
2
+
3
+ module Redcarpet
4
+ module Render
5
+ class Hiki < Base
6
+ def link(link, title, content)
7
+ # FIXME I don't care about title
8
+ "[[#{content}|#{link}]]"
9
+ end
10
+
11
+ def paragraph(text)
12
+ text + $/
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,10 @@
1
+ module Redcarpet
2
+ module Render
3
+ # FIXME avoid uninitialized constant error
4
+ class Base; end
5
+
6
+ class Hiki < Base
7
+ VERSION = "0.0.1"
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'redcarpet/render/hiki/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "redcarpet-render-hiki"
8
+ spec.version = Redcarpet::Render::Hiki::VERSION
9
+ spec.authors = ["Seiei Higa"]
10
+ spec.email = ["hanachin@gmail.com"]
11
+ spec.summary = %q{Hiki renderer for the redcarpet.}
12
+ spec.description = %q{Hiki renderer plugin for the redcarpet. You can convert Markdown to Hiki easier.}
13
+ spec.homepage = "https://github.com/hanachin/redcarpet-render-hiki"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_runtime_dependency "redcarpet"
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.5"
24
+ spec.add_development_dependency "pry"
25
+ spec.add_development_dependency "pry-doc"
26
+ spec.add_development_dependency "rake"
27
+ spec.add_development_dependency "test-unit"
28
+ end
@@ -0,0 +1,26 @@
1
+ require 'test/unit'
2
+ require 'redcarpet'
3
+ require 'redcarpet/render/hiki'
4
+
5
+ class TestRecarpetRenderHiki < Test::Unit::TestCase
6
+ def test_render_markdown_as_hiki
7
+ renderer = Redcarpet::Render::Hiki
8
+ rc_markdown = Redcarpet::Markdown.new(renderer.new)
9
+
10
+ markdown = <<MARKDOWN
11
+ [redcarpet-render-hiki](https://github.com/hanachin/redcarpet-render-hiki)で、
12
+ Markdownをhiki記法に変換したい。
13
+ なぜなら、Markdownで書かれた記事をhikiに変換できるとるびまの編集の手間が減って、
14
+ 世界がちょっと幸せになりそうだからだ。
15
+ MARKDOWN
16
+
17
+ hiki = <<HIKI
18
+ [[redcarpet-render-hiki|https://github.com/hanachin/redcarpet-render-hiki]]で、
19
+ Markdownをhiki記法に変換したい。
20
+ なぜなら、Markdownで書かれた記事をhikiに変換できるとるびまの編集の手間が減って、
21
+ 世界がちょっと幸せになりそうだからだ。
22
+ HIKI
23
+
24
+ assert_equal(rc_markdown.render(markdown), hiki)
25
+ end
26
+ end
metadata ADDED
@@ -0,0 +1,140 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: redcarpet-render-hiki
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Seiei Higa
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: redcarpet
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.5'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.5'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry-doc
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: test-unit
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: Hiki renderer plugin for the redcarpet. You can convert Markdown to Hiki
98
+ easier.
99
+ email:
100
+ - hanachin@gmail.com
101
+ executables: []
102
+ extensions: []
103
+ extra_rdoc_files: []
104
+ files:
105
+ - ".gitignore"
106
+ - ".travis.yml"
107
+ - Gemfile
108
+ - LICENSE.txt
109
+ - README.md
110
+ - Rakefile
111
+ - lib/redcarpet/render/hiki.rb
112
+ - lib/redcarpet/render/hiki/version.rb
113
+ - redcarpet-render-hiki.gemspec
114
+ - test/test_recarpet-render-hiki.rb
115
+ homepage: https://github.com/hanachin/redcarpet-render-hiki
116
+ licenses:
117
+ - MIT
118
+ metadata: {}
119
+ post_install_message:
120
+ rdoc_options: []
121
+ require_paths:
122
+ - lib
123
+ required_ruby_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ requirements: []
134
+ rubyforge_project:
135
+ rubygems_version: 2.4.5
136
+ signing_key:
137
+ specification_version: 4
138
+ summary: Hiki renderer for the redcarpet.
139
+ test_files:
140
+ - test/test_recarpet-render-hiki.rb