gyazz-markup 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +4 -0
- data/README.md +3 -3
- data/bin/gyazz-markup +5 -5
- data/lib/gyazz-markup/markup.rb +4 -4
- data/lib/gyazz-markup/options.rb +1 -1
- data/lib/gyazz-markup/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b35c60ff1b1ca1a396bfcc23e8b8b69fa856866
|
4
|
+
data.tar.gz: cffdec0efd0d223e7a3977b4b893e52b2bc84011
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e0f98ac36d6fbe7e95ccbf523a478a5dcb63f0ec140a1fcac7995f0371e48bd2b37652c7376d0072c7da332d7c4cacbc082eac992eed1ac0e933a2bdf89e81a
|
7
|
+
data.tar.gz: 580de3d1ccf20f86bf0f33b61eabdb5f8235bd1c1b03bf9483c2510adbbfb402eef2196312d21ad9387ffb729d2578ff4c904b10ad08ca88364cb4a88c3bde80
|
data/History.txt
CHANGED
data/README.md
CHANGED
@@ -29,7 +29,7 @@ options
|
|
29
29
|
gm = GyazzMarkup::Markup.new(
|
30
30
|
:host => 'http://gyazz.com',
|
31
31
|
:wiki => 'shokai'
|
32
|
-
:
|
32
|
+
:listtag => 'div',
|
33
33
|
:prefix => '-'
|
34
34
|
)
|
35
35
|
puts gm.markup str
|
@@ -57,9 +57,9 @@ wikilink [[shokai::かずすけ]]
|
|
57
57
|
```
|
58
58
|
|
59
59
|
% gyazz-markup --help
|
60
|
-
% gyazz-markup -i samples/sample.txt
|
60
|
+
% gyazz-markup -i samples/sample.txt -li div -prefix "-"
|
61
61
|
|
62
|
-
<img src="http://shokai.org/archive/file/
|
62
|
+
<img src="http://shokai.org/archive/file/507156117820b62bab54dc185883d9d3.png">
|
63
63
|
|
64
64
|
|
65
65
|
Test
|
data/bin/gyazz-markup
CHANGED
@@ -10,23 +10,23 @@ parser = ArgsParser.parse ARGV do
|
|
10
10
|
arg :output, 'output file', :alias => :o
|
11
11
|
arg :wiki, 'wiki name', :default => 'test'
|
12
12
|
arg :host, 'host name', :default => 'http://gyazz.com'
|
13
|
-
arg :
|
13
|
+
arg :listtag, 'list tag', :alias => :li
|
14
14
|
arg :prefix, 'list prefix'
|
15
15
|
arg :help, 'show help', :alias => :h
|
16
16
|
end
|
17
17
|
|
18
18
|
if parser.has_option? :help or !parser.has_param? :input
|
19
|
-
STDERR.puts "gyazz-markup - convert
|
19
|
+
STDERR.puts "gyazz-markup - convert Gyazz.com syntax to HTML (v#{GyazzMarkup::VERSION})"
|
20
20
|
STDERR.puts " https://github.com/shokai/gyazz-markup"
|
21
21
|
STDERR.puts parser.help
|
22
22
|
STDERR.puts
|
23
23
|
STDERR.puts "e.g."
|
24
24
|
STDERR.puts " gyazz-markup -i input.txt"
|
25
|
-
STDERR.puts " gyazz-markup -i input.txt -wiki shokai -
|
25
|
+
STDERR.puts " gyazz-markup -i input.txt -wiki shokai -li div -prefix \"-\""
|
26
26
|
exit 1
|
27
27
|
end
|
28
28
|
|
29
|
-
if parser.has_param? :
|
29
|
+
if parser.has_param? :listtag
|
30
30
|
puts '<style type="text/css">'
|
31
31
|
0.upto(5).each do |i|
|
32
32
|
puts ".gyazz_indent#{i}{ margin-left : #{i*20}px; }"
|
@@ -38,6 +38,6 @@ txt = open(parser[:input]).read
|
|
38
38
|
puts GyazzMarkup::Markup.new(
|
39
39
|
:wiki => parser[:wiki],
|
40
40
|
:host => parser[:host],
|
41
|
-
:
|
41
|
+
:listtag => parser[:listtag],
|
42
42
|
:prefix => parser[:prefix]
|
43
43
|
).markup(txt)
|
data/lib/gyazz-markup/markup.rb
CHANGED
@@ -28,15 +28,15 @@ module GyazzMarkup
|
|
28
28
|
line = markup_url line
|
29
29
|
line = markup_wiki_link line
|
30
30
|
line = markup_inner_link line
|
31
|
-
line =
|
31
|
+
line = markup_listtag line
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
def
|
36
|
-
return str unless options[:
|
35
|
+
def markup_listtag(str)
|
36
|
+
return str unless options[:listtag]
|
37
37
|
indent_count = str.scan(/^(\s*).*$/)[0][0].size
|
38
38
|
prefix = "#{options[:prefix]} " if options[:prefix]
|
39
|
-
"<#{options[:
|
39
|
+
"<#{options[:listtag]} class=\"gyazz_indent#{indent_count}\">#{prefix}#{str.strip}</#{options[:listtag]}>"
|
40
40
|
end
|
41
41
|
|
42
42
|
def markup_image(str)
|
data/lib/gyazz-markup/options.rb
CHANGED
data/lib/gyazz-markup/version.rb
CHANGED