creole2md 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +41 -0
- data/Rakefile +2 -0
- data/bin/creole2md +5 -0
- data/creole2md.gemspec +33 -0
- data/lib/creole2md/version.rb +3 -0
- data/lib/creole2md.rb +16 -0
- metadata +131 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 63a36c1a6802c132c78ac885754277408fd9612b
|
4
|
+
data.tar.gz: 61e0d39c19ac29787f633df60f3d4fd41e648fa6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4a60e751463b1e7130dd30bfe8aea9f799a8270d0823693f9431806e2b07dfa2e709131167db5dbb9ca3da9fc1adaae6deec1f0b26383cd774704daad1823095
|
7
|
+
data.tar.gz: 9606699dfb3ae0f9331efaaf7371de758006b0d9c0d85408cfd1b706d5970ab03932078eebbfc258f9dfef9c3300030af8e74ea8149ee5ec34d2d45a0294ac59
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Jakukyo Friel
|
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,41 @@
|
|
1
|
+
# Creole2md
|
2
|
+
|
3
|
+
This gem converts creole to html, then converts html to markdown.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'creole2md'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install creole2md
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
require 'creole2md'
|
25
|
+
Creole2md.convert(text)
|
26
|
+
```
|
27
|
+
|
28
|
+
A command line converter is also provided:
|
29
|
+
|
30
|
+
```sh
|
31
|
+
creole2md in.creole > out.md
|
32
|
+
cat in.creole | creole2md > out.md
|
33
|
+
```
|
34
|
+
|
35
|
+
## Contributing
|
36
|
+
|
37
|
+
1. Fork it ( https://github.com/weakish/creole2md/fork )
|
38
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
39
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
40
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
41
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/creole2md
ADDED
data/creole2md.gemspec
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'creole2md/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'creole2md'
|
8
|
+
spec.version = Creole2md::VERSION
|
9
|
+
spec.authors = ['Jakukyo Friel']
|
10
|
+
spec.email = ['weakish@gmail.com']
|
11
|
+
spec.summary = %q{Convert creole to markdown.}
|
12
|
+
spec.description = %q{This gem converts creole to html, then converts
|
13
|
+
html to markdown.}
|
14
|
+
spec.homepage = 'https://github.com/weakish/creole2md'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
spec.metadata = {
|
17
|
+
'repository' => 'https://github.com/weakish/creole2md.git',
|
18
|
+
'issues' => 'https://github.com/weakish/creole2md/issues',
|
19
|
+
'wiki' => 'https://github.com/weakish/creole2md/wiki',
|
20
|
+
'documentation' => 'http://www.rubydoc.info/gems/creole2md'
|
21
|
+
}
|
22
|
+
|
23
|
+
spec.files = `git ls-files -z`.split("\x0")
|
24
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
25
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
26
|
+
spec.require_paths = ['lib']
|
27
|
+
|
28
|
+
spec.add_runtime_dependency 'creole', '~> 0.5.0'
|
29
|
+
spec.add_runtime_dependency 'reverse_markdown', '~> 0.6.0'
|
30
|
+
spec.add_development_dependency 'bundler', '~> 1.7'
|
31
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
32
|
+
spec.add_development_dependency 'yard', '~> 0.8.7.6'
|
33
|
+
end
|
data/lib/creole2md.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require "creole2md/version"
|
2
|
+
|
3
|
+
require 'creole'
|
4
|
+
require 'reverse_markdown'
|
5
|
+
|
6
|
+
module Creole2md
|
7
|
+
module_function
|
8
|
+
|
9
|
+
# Convert text in creole markup to markdown.
|
10
|
+
# @param [String]
|
11
|
+
# @return [String]
|
12
|
+
def convert(text)
|
13
|
+
html = Creole.creolize(text)
|
14
|
+
md = ReverseMarkdown.convert(html, github_flavored: true)
|
15
|
+
end
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,131 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: creole2md
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jakukyo Friel
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-01-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: creole
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.5.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.5.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: reverse_markdown
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.6.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.6.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.7'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.7'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: yard
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.8.7.6
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.8.7.6
|
83
|
+
description: |-
|
84
|
+
This gem converts creole to html, then converts
|
85
|
+
html to markdown.
|
86
|
+
email:
|
87
|
+
- weakish@gmail.com
|
88
|
+
executables:
|
89
|
+
- creole2md
|
90
|
+
extensions: []
|
91
|
+
extra_rdoc_files: []
|
92
|
+
files:
|
93
|
+
- ".gitignore"
|
94
|
+
- Gemfile
|
95
|
+
- LICENSE.txt
|
96
|
+
- README.md
|
97
|
+
- Rakefile
|
98
|
+
- bin/creole2md
|
99
|
+
- creole2md.gemspec
|
100
|
+
- lib/creole2md.rb
|
101
|
+
- lib/creole2md/version.rb
|
102
|
+
homepage: https://github.com/weakish/creole2md
|
103
|
+
licenses:
|
104
|
+
- MIT
|
105
|
+
metadata:
|
106
|
+
repository: https://github.com/weakish/creole2md.git
|
107
|
+
issues: https://github.com/weakish/creole2md/issues
|
108
|
+
wiki: https://github.com/weakish/creole2md/wiki
|
109
|
+
documentation: http://www.rubydoc.info/gems/creole2md
|
110
|
+
post_install_message:
|
111
|
+
rdoc_options: []
|
112
|
+
require_paths:
|
113
|
+
- lib
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
requirements: []
|
125
|
+
rubyforge_project:
|
126
|
+
rubygems_version: 2.2.2
|
127
|
+
signing_key:
|
128
|
+
specification_version: 4
|
129
|
+
summary: Convert creole to markdown.
|
130
|
+
test_files: []
|
131
|
+
has_rdoc:
|