mark_maker 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/bin/generate_readme.rb +1 -1
- data/lib/mark_maker/generator.rb +9 -5
- data/lib/mark_maker/version.rb +1 -1
- data/test/test_mark_maker.rb +9 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a68f07f8d48fdc287cc5c6f646e84f3a3647bea
|
4
|
+
data.tar.gz: 8e9a4a968cfbd8ba7b4d6113349cadfa8f4403a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2fd47a0dae3bc3976af88f5474c6a964c8225359138708cc093bfaadf9123336d456ad18475394bced8b3691022dcc5b0c1219ce60356e95b653410862c8c19
|
7
|
+
data.tar.gz: 2c18d49746a7db186226069519da9a3cf66b482e709e5bd36bfd5e2bd166c3bd81ad5f12c720a9dbdf401e53ce1c27fa79ce418ffd8578490bc7d14b65fabbc7
|
data/README.md
CHANGED
@@ -23,7 +23,7 @@ Usage
|
|
23
23
|
|
24
24
|
MarkMaker provides line oriented conversion of content to markdown elements. It
|
25
25
|
currently supports first, second and third level headings, links, bullets, numbered
|
26
|
-
bullets, *emphasis
|
26
|
+
bullets, *emphasis*, **strong** and code markdown. See bin/generate_readme.rb for the code used to generate this
|
27
27
|
document and a sample of all these markdown generators in action.
|
28
28
|
|
29
29
|
### Header Example
|
data/bin/generate_readme.rb
CHANGED
@@ -38,7 +38,7 @@ doc << gen.header2("Usage")
|
|
38
38
|
doc << ""
|
39
39
|
doc << "MarkMaker provides line oriented conversion of content to markdown elements. It"
|
40
40
|
doc << "currently supports first, second and third level headings, links, bullets, numbered"
|
41
|
-
doc << "bullets, #{gen.emphasis('emphasis')} and code markdown. See #{__FILE__} for the code used to generate this"
|
41
|
+
doc << "bullets, #{gen.emphasis('emphasis')}, #{gen.strong('strong')} and code markdown. See #{__FILE__} for the code used to generate this"
|
42
42
|
doc << "document and a sample of all these markdown generators in action."
|
43
43
|
doc << ""
|
44
44
|
doc << gen.header3("Header Example")
|
data/lib/mark_maker/generator.rb
CHANGED
@@ -49,21 +49,25 @@ module MarkMaker
|
|
49
49
|
|
50
50
|
# creates a github flavored markdown fenced code block
|
51
51
|
def fenced_code_block(*content)
|
52
|
-
block = *
|
52
|
+
block = *FENCE
|
53
53
|
block.push(*content)
|
54
|
-
block <<
|
54
|
+
block << FENCE
|
55
55
|
end
|
56
56
|
|
57
57
|
# creates a github flavored markdown fenced code block that
|
58
58
|
# specifies the language for syntax highlighting purposes
|
59
59
|
def fenced_code_language(lang, *content)
|
60
|
-
block = *
|
60
|
+
block = *FENCE + lang
|
61
61
|
block.push(*content)
|
62
|
-
block <<
|
62
|
+
block << FENCE
|
63
63
|
end
|
64
64
|
|
65
65
|
def emphasis(content)
|
66
|
-
"#{
|
66
|
+
"#{EMPHASIS}#{content}#{EMPHASIS}"
|
67
|
+
end
|
68
|
+
|
69
|
+
def strong(content)
|
70
|
+
EMPHASIS * 2 + content + EMPHASIS * 2
|
67
71
|
end
|
68
72
|
end
|
69
73
|
end
|
data/lib/mark_maker/version.rb
CHANGED
data/test/test_mark_maker.rb
CHANGED
@@ -109,10 +109,18 @@ class TestMarkMaker < Minitest::Test
|
|
109
109
|
assert(markup.last == MarkMaker::FENCE, "Markup should end with the code fence.")
|
110
110
|
end
|
111
111
|
|
112
|
-
def
|
112
|
+
def test_emphasis_generation
|
113
113
|
content = "emphasize this"
|
114
114
|
gen = MarkMaker::Generator.new
|
115
115
|
markup = gen.emphasis(content)
|
116
116
|
assert_match(/^#{Regexp.quote(MarkMaker::EMPHASIS)}#{content}#{Regexp.quote(MarkMaker::EMPHASIS)}$/, markup)
|
117
117
|
end
|
118
|
+
|
119
|
+
def test_strong_generation
|
120
|
+
content = "strong stuff"
|
121
|
+
gen = MarkMaker::Generator.new
|
122
|
+
markup = gen.strong(content)
|
123
|
+
assert_match(/^#{Regexp.quote(MarkMaker::EMPHASIS * 2)}#{content}#{Regexp.quote(MarkMaker::EMPHASIS * 2)}$/, markup)
|
124
|
+
end
|
118
125
|
end
|
126
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mark_maker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brad Schneider
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|