markie 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 +11 -0
- data/.rspec +1 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +41 -0
- data/LICENSE.txt +21 -0
- data/README.md +125 -0
- data/Rakefile +6 -0
- data/bin/console +8 -0
- data/bin/setup +6 -0
- data/lib/markie.rb +6 -0
- data/lib/markie/node.rb +15 -0
- data/lib/markie/parser.rb +44 -0
- data/lib/markie/rule.rb +22 -0
- data/lib/markie/token.rb +18 -0
- data/lib/markie/tokenizer.rb +94 -0
- data/lib/markie/version.rb +3 -0
- data/markie.gemspec +35 -0
- metadata +121 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a779cd45039bccbf2dffd04137a2908e609331484552e4269dd985da9d288532
|
4
|
+
data.tar.gz: 773b69639460a9d19aeb486a71fad6fd69814216c6c4f65222af643ce0301e37
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 28f22a19ba9fcb37196fb591c72e4a2bb3314b1616972d2857bcc21fb26514b39cc1562b1d718410c08f7354549f921aaaa551010488dd5990638e1388a2d4fa
|
7
|
+
data.tar.gz: afeed9b58bcf5d372afc5511a583835d4ebcd02b5f2a5608e1de5c8719e9188a0bccc32dc244fb18004401c3233d367d705d853159d197399053adcc38c567f4
|
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require spec_helper
|
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at thomascountz@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
markie (0.0.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
coderay (1.1.2)
|
10
|
+
diff-lcs (1.3)
|
11
|
+
method_source (0.9.2)
|
12
|
+
pry (0.12.2)
|
13
|
+
coderay (~> 1.1.0)
|
14
|
+
method_source (~> 0.9.0)
|
15
|
+
rake (10.5.0)
|
16
|
+
rspec (3.8.0)
|
17
|
+
rspec-core (~> 3.8.0)
|
18
|
+
rspec-expectations (~> 3.8.0)
|
19
|
+
rspec-mocks (~> 3.8.0)
|
20
|
+
rspec-core (3.8.2)
|
21
|
+
rspec-support (~> 3.8.0)
|
22
|
+
rspec-expectations (3.8.4)
|
23
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
24
|
+
rspec-support (~> 3.8.0)
|
25
|
+
rspec-mocks (3.8.1)
|
26
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
27
|
+
rspec-support (~> 3.8.0)
|
28
|
+
rspec-support (3.8.2)
|
29
|
+
|
30
|
+
PLATFORMS
|
31
|
+
ruby
|
32
|
+
|
33
|
+
DEPENDENCIES
|
34
|
+
bundler (~> 2.0)
|
35
|
+
markie!
|
36
|
+
pry
|
37
|
+
rake (~> 10.0)
|
38
|
+
rspec (~> 3.0)
|
39
|
+
|
40
|
+
BUNDLED WITH
|
41
|
+
2.0.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 thomascountz
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
# Markie <img src="https://i.postimg.cc/wxXhdwZr/markie-2.jpg" alt="markie_logo" width="100" align="right"/>
|
2
|
+
|
3
|
+
Proof-of-concept Markdown to HTML compiler in Ruby
|
4
|
+
|
5
|
+
|
6
|
+
## Grammar v.`6c20d2a`
|
7
|
+
|
8
|
+
|
9
|
+
```
|
10
|
+
Body := Paragraph*
|
11
|
+
Paragraph := Sentence+ <NEWLINE> <NEWLINE>
|
12
|
+
| Sentence+ <EOF>
|
13
|
+
Sentence := Text
|
14
|
+
| Emphasis
|
15
|
+
| Link
|
16
|
+
Text := <TEXT>
|
17
|
+
Emphasis := <UNDERSCORE> <TEXT> <UNDERSCORE>
|
18
|
+
| <ASTERISK> <TEXT> <ASTERISK>
|
19
|
+
Link := <OPEN_SQUARE_BRACKET> <TEXT> <CLOSED_SQUARE_BRACKET> <OPEN_PARENTHESIS> <TEXT> <CLOSED_PARENTHESIS>
|
20
|
+
```
|
21
|
+
|
22
|
+
## Quick Start
|
23
|
+
|
24
|
+
Setup Markie for local development
|
25
|
+
```
|
26
|
+
$ bin/setup
|
27
|
+
```
|
28
|
+
|
29
|
+
Experiment with Markie
|
30
|
+
|
31
|
+
```
|
32
|
+
$ bin/console
|
33
|
+
```
|
34
|
+
|
35
|
+
Run tests
|
36
|
+
```
|
37
|
+
$ rake
|
38
|
+
```
|
39
|
+
|
40
|
+
## Example v.`6c20d2a`
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
markdown = "[Markie](https://github.com/Thomascountz/markie) isn't _the_ best, but it's fun!"
|
44
|
+
=> "[Markie](https://github.com/Thomascountz/markie) isn't _the_ best, but it's fun!"
|
45
|
+
|
46
|
+
tokens = Markie::Tokenizer.tokenize(markdown)
|
47
|
+
=> [#<Markie::Token:0x00007f942c095c00 @type=:open_square_bracket, @value="[">,
|
48
|
+
#<Markie::Token:0x00007f942c115cc0 @type=:text, @value="Markie">,
|
49
|
+
#<Markie::Token:0x00007f942c11c2f0 @type=:close_square_bracket, @value="]">,
|
50
|
+
#<Markie::Token:0x00007f942c124400 @type=:open_parenthesis, @value="(">,
|
51
|
+
#<Markie::Token:0x00007f942d0e7928 @type=:text, @value="https://github.com/Thomascountz/markie">,
|
52
|
+
#<Markie::Token:0x00007f942d0e5f10 @type=:close_parenthesis, @value=")">,
|
53
|
+
#<Markie::Token:0x00007f942d10d100 @type=:text, @value=" isn't ">,
|
54
|
+
#<Markie::Token:0x00007f942d1171a0 @type=:underscore, @value="_">,
|
55
|
+
#<Markie::Token:0x00007f942d12dc98 @type=:text, @value="the">,
|
56
|
+
#<Markie::Token:0x00007f942d13f5b0 @type=:underscore, @value="_">,
|
57
|
+
#<Markie::Token:0x00007f942d19f7f8 @type=:text, @value=" best, but it's fun!">,
|
58
|
+
#<Markie::Token:0x00007f942d19f690 @type=:eof, @value="">]
|
59
|
+
|
60
|
+
ast = Markie::Parser.parse(tokens)
|
61
|
+
=> #<Markie::Node:0x00007f942d23a640
|
62
|
+
@children=
|
63
|
+
[#<Markie::Node:0x00007f942d23a708
|
64
|
+
@children=
|
65
|
+
[#<Markie::Node:0x00007f942d23aaf0 @children=[#<Markie::Node:0x00007f942d23abb8 @children=[], @token_count=1, @type=:text, @value="Markie">], @token_count=6, @type=:link, @value="https://github.com/Thomascountz/markie">,
|
66
|
+
#<Markie::Node:0x00007f942d23aa00 @children=[], @token_count=1, @type=:text, @value=" isn't ">,
|
67
|
+
#<Markie::Node:0x00007f942d23a910 @children=[], @token_count=3, @type=:emphasis, @value="the">,
|
68
|
+
#<Markie::Node:0x00007f942d23a820 @children=[], @token_count=1, @type=:text, @value=" best, but it's fun!">],
|
69
|
+
@token_count=11,
|
70
|
+
@type=:paragraph,
|
71
|
+
@value=nil>],
|
72
|
+
@token_count=11,
|
73
|
+
@type=:body,
|
74
|
+
@value=nil>
|
75
|
+
```
|
76
|
+
|
77
|
+
### Abstract Syntax Tree as JSON
|
78
|
+
|
79
|
+
```json
|
80
|
+
{
|
81
|
+
"type": "body",
|
82
|
+
"token_count": "11",
|
83
|
+
"value": "",
|
84
|
+
"children": [
|
85
|
+
{
|
86
|
+
"type": "paragraph",
|
87
|
+
"token_count": "11",
|
88
|
+
"value": "",
|
89
|
+
"children": [
|
90
|
+
{
|
91
|
+
"type": "link",
|
92
|
+
"token_count": "6",
|
93
|
+
"value": "https://github.com/Thomascountz/markie",
|
94
|
+
"children": [
|
95
|
+
{
|
96
|
+
"type": "text",
|
97
|
+
"token_count": "1",
|
98
|
+
"value": "Markie",
|
99
|
+
"children": []
|
100
|
+
}
|
101
|
+
]
|
102
|
+
},
|
103
|
+
{
|
104
|
+
"type": "text",
|
105
|
+
"token_count": "1",
|
106
|
+
"value": " isn't ",
|
107
|
+
"children": []
|
108
|
+
},
|
109
|
+
{
|
110
|
+
"type": "emphasis",
|
111
|
+
"token_count": "3",
|
112
|
+
"value": "the",
|
113
|
+
"children": []
|
114
|
+
},
|
115
|
+
{
|
116
|
+
"type": "text",
|
117
|
+
"token_count": "1",
|
118
|
+
"value": " best, but it's fun!",
|
119
|
+
"children": []
|
120
|
+
}
|
121
|
+
]
|
122
|
+
}
|
123
|
+
]
|
124
|
+
}
|
125
|
+
```
|
data/Rakefile
ADDED
data/bin/console
ADDED
data/bin/setup
ADDED
data/lib/markie.rb
ADDED
data/lib/markie/node.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
module Markie
|
2
|
+
class Node
|
3
|
+
attr_reader :type, :token_count, :children, :value
|
4
|
+
def initialize(type:, token_count:, children: [], value: nil)
|
5
|
+
@type = type
|
6
|
+
@token_count = token_count
|
7
|
+
@children = children
|
8
|
+
@value = value
|
9
|
+
end
|
10
|
+
|
11
|
+
def to_json
|
12
|
+
"{ \"type\": \"#{type}\", \"token_count\": \"#{token_count}\", \"value\": \"#{value}\", \"children\": [#{children.map(&:to_json).join(", ") if children.any?}] }"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require_relative "token"
|
2
|
+
require_relative "node"
|
3
|
+
|
4
|
+
module Markie
|
5
|
+
class Parser
|
6
|
+
class << self
|
7
|
+
def parse(tokens)
|
8
|
+
parse_body(tokens)
|
9
|
+
end
|
10
|
+
|
11
|
+
def parse_body(tokens)
|
12
|
+
children = [parse_paragraph(tokens)]
|
13
|
+
Node.new(type: :body, token_count: children.map(&:token_count).sum, children: children)
|
14
|
+
end
|
15
|
+
|
16
|
+
def parse_paragraph(tokens, children = [])
|
17
|
+
if tokens[0].type == :eof
|
18
|
+
return Node.new(type: :paragraph, token_count: children.map(&:token_count).sum, children: children)
|
19
|
+
end
|
20
|
+
|
21
|
+
if tokens[0].type == :text
|
22
|
+
next_child = Node.new(type: :text, token_count: 1, value: tokens[0].value)
|
23
|
+
|
24
|
+
elsif tokens[0].type == :underscore && tokens[1].type == :text && tokens[2].type == :underscore
|
25
|
+
next_child = Node.new(type: :emphasis, token_count: 3, value: tokens[1].value)
|
26
|
+
|
27
|
+
elsif tokens[0].type == :asterisk && tokens[1].type == :text && tokens[2].type == :asterisk
|
28
|
+
next_child = Node.new(type: :emphasis, token_count: 3, value: tokens[1].value)
|
29
|
+
|
30
|
+
elsif tokens[0].type == :open_square_bracket && tokens[1].type == :text && tokens[2].type == :close_square_bracket && tokens[3].type == :open_parenthesis && tokens[4].type == :text && tokens[5].type == :close_parenthesis
|
31
|
+
next_child = Node.new(type: :link, token_count: 6, value: tokens[4].value, children: [
|
32
|
+
Node.new(type: :text, token_count: 1, value: tokens[1].value),
|
33
|
+
])
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
children.append(next_child)
|
38
|
+
next_tokens = tokens[next_child.token_count..-1]
|
39
|
+
|
40
|
+
parse_paragraph(next_tokens, children)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/lib/markie/rule.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
module Markie
|
2
|
+
class Rule
|
3
|
+
attr_reader :regex
|
4
|
+
|
5
|
+
def initialize(regex:, tokenize_rule:)
|
6
|
+
@regex = regex
|
7
|
+
@tokenize_rule = tokenize_rule
|
8
|
+
end
|
9
|
+
|
10
|
+
def applies_to?(markdown)
|
11
|
+
regex.match?(markdown[0])
|
12
|
+
end
|
13
|
+
|
14
|
+
def tokenize(markdown)
|
15
|
+
tokenize_rule.call(markdown, regex)
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
attr_reader :tokenize_rule
|
21
|
+
end
|
22
|
+
end
|
data/lib/markie/token.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
module Markie
|
2
|
+
class Token
|
3
|
+
attr_reader :type, :value
|
4
|
+
|
5
|
+
def initialize(type:, value: "")
|
6
|
+
@type = type
|
7
|
+
@value = value
|
8
|
+
end
|
9
|
+
|
10
|
+
def length
|
11
|
+
value.length
|
12
|
+
end
|
13
|
+
|
14
|
+
def to_s
|
15
|
+
"{ type: #{type}, value: \"#{value}\" }"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
require_relative "token"
|
2
|
+
require_relative "./rule"
|
3
|
+
|
4
|
+
module Markie
|
5
|
+
class Tokenizer
|
6
|
+
class << self
|
7
|
+
def tokenize(markdown)
|
8
|
+
scan(markdown, [])
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def scan(markdown, tokens)
|
14
|
+
if markdown.length == 0
|
15
|
+
return tokens.append(eof_token)
|
16
|
+
end
|
17
|
+
|
18
|
+
next_token = nil
|
19
|
+
|
20
|
+
rules.each do |rule|
|
21
|
+
if rule.applies_to?(markdown)
|
22
|
+
next_token = rule.tokenize(markdown)
|
23
|
+
break
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
if next_token.nil?
|
28
|
+
next_token = text_token(markdown)
|
29
|
+
end
|
30
|
+
|
31
|
+
scan(markdown[next_token.length..-1], tokens.append(next_token))
|
32
|
+
end
|
33
|
+
|
34
|
+
def eof_token
|
35
|
+
Token.new(type: :eof)
|
36
|
+
end
|
37
|
+
|
38
|
+
def text_token(markdown)
|
39
|
+
text = markdown.each_char.take_while { |char|
|
40
|
+
!char.match?(Regexp.union(rules.map(&:regex)))
|
41
|
+
}.join("")
|
42
|
+
|
43
|
+
Token.new(type: :text, value: text)
|
44
|
+
end
|
45
|
+
|
46
|
+
def rules
|
47
|
+
[
|
48
|
+
Rule.new(
|
49
|
+
regex: Regexp.new("\_"),
|
50
|
+
tokenize_rule: ->(markdown, regex) {
|
51
|
+
Token.new(type: :underscore, value: "_")
|
52
|
+
}
|
53
|
+
),
|
54
|
+
Rule.new(
|
55
|
+
regex: Regexp.new("\\*"),
|
56
|
+
tokenize_rule: ->(markdown, regex) {
|
57
|
+
Token.new(type: :asterisk, value: "*")
|
58
|
+
}
|
59
|
+
),
|
60
|
+
Rule.new(
|
61
|
+
regex: Regexp.new("\\["),
|
62
|
+
tokenize_rule: ->(markdown, regex) {
|
63
|
+
Token.new(type: :open_square_bracket, value: "[")
|
64
|
+
}
|
65
|
+
),
|
66
|
+
Rule.new(
|
67
|
+
regex: Regexp.new("\\]"),
|
68
|
+
tokenize_rule: ->(markdown, regex) {
|
69
|
+
Token.new(type: :close_square_bracket, value: "]")
|
70
|
+
}
|
71
|
+
),
|
72
|
+
Rule.new(
|
73
|
+
regex: Regexp.new("\\("),
|
74
|
+
tokenize_rule: ->(markdown, regex) {
|
75
|
+
Token.new(type: :open_parenthesis, value: "(")
|
76
|
+
}
|
77
|
+
),
|
78
|
+
Rule.new(
|
79
|
+
regex: Regexp.new("\\)"),
|
80
|
+
tokenize_rule: ->(markdown, regex) {
|
81
|
+
Token.new(type: :close_parenthesis, value: ")")
|
82
|
+
}
|
83
|
+
),
|
84
|
+
Rule.new(
|
85
|
+
regex: Regexp.new("\n"),
|
86
|
+
tokenize_rule: ->(markdown, regex) {
|
87
|
+
Token.new(type: :newline, value: "\n")
|
88
|
+
}
|
89
|
+
),
|
90
|
+
]
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
data/markie.gemspec
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "markie/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "markie"
|
7
|
+
spec.version = Markie::VERSION
|
8
|
+
spec.authors = ["thomascountz"]
|
9
|
+
spec.email = ["thomascountz@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = "Markdown to HTML compiler"
|
12
|
+
spec.homepage = "https://github.com/Thomascountz/markie"
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
if spec.respond_to?(:metadata)
|
16
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
17
|
+
else
|
18
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
19
|
+
"public gem pushes."
|
20
|
+
end
|
21
|
+
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
23
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
|
+
spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
|
25
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
+
end
|
27
|
+
spec.bindir = "bin"
|
28
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
29
|
+
spec.require_paths = ["lib"]
|
30
|
+
|
31
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
32
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
33
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
34
|
+
spec.add_development_dependency "pry", "~> 0.12"
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: markie
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- thomascountz
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-09-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.12'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.12'
|
69
|
+
description:
|
70
|
+
email:
|
71
|
+
- thomascountz@gmail.com
|
72
|
+
executables:
|
73
|
+
- console
|
74
|
+
- setup
|
75
|
+
extensions: []
|
76
|
+
extra_rdoc_files: []
|
77
|
+
files:
|
78
|
+
- ".gitignore"
|
79
|
+
- ".rspec"
|
80
|
+
- ".travis.yml"
|
81
|
+
- CODE_OF_CONDUCT.md
|
82
|
+
- Gemfile
|
83
|
+
- Gemfile.lock
|
84
|
+
- LICENSE.txt
|
85
|
+
- README.md
|
86
|
+
- Rakefile
|
87
|
+
- bin/console
|
88
|
+
- bin/setup
|
89
|
+
- lib/markie.rb
|
90
|
+
- lib/markie/node.rb
|
91
|
+
- lib/markie/parser.rb
|
92
|
+
- lib/markie/rule.rb
|
93
|
+
- lib/markie/token.rb
|
94
|
+
- lib/markie/tokenizer.rb
|
95
|
+
- lib/markie/version.rb
|
96
|
+
- markie.gemspec
|
97
|
+
homepage: https://github.com/Thomascountz/markie
|
98
|
+
licenses:
|
99
|
+
- MIT
|
100
|
+
metadata:
|
101
|
+
allowed_push_host: https://rubygems.org
|
102
|
+
post_install_message:
|
103
|
+
rdoc_options: []
|
104
|
+
require_paths:
|
105
|
+
- lib
|
106
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '0'
|
116
|
+
requirements: []
|
117
|
+
rubygems_version: 3.0.6
|
118
|
+
signing_key:
|
119
|
+
specification_version: 4
|
120
|
+
summary: Markdown to HTML compiler
|
121
|
+
test_files: []
|