zine_brewer 1.8.0 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +3 -0
- data/Gemfile +4 -0
- data/lib/zine_brewer/kramdown/converter/sehtml.rb +3 -1
- data/lib/zine_brewer/main.rb +18 -8
- data/lib/zine_brewer/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9377b1600b8679c919199df61d3c142c7f8a0c9c1972d891a31cd6429b406a49
|
4
|
+
data.tar.gz: b100b1ad9d96943035a8acd2dd043aa27499c348d8e9a9b9c4bbef47b9d2d0b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba17f9a2b9d9288b7e54e97f3fa9ccacfa9bebfad069810bd8fb20526e012d32a944f3c1bb44851b5d899d4c94b532c958bb8a2c8dbe2d36abd381f258b2bd99
|
7
|
+
data.tar.gz: b5e927c93f297b95758ad684cb54e770a981372fc2815e1f50f7d2de0d4347edf504b5f269ba0b50518fadbd09ed3550d0adc51a022c1e5504cd8ad105bd1ddc
|
data/.rspec
ADDED
data/Gemfile
CHANGED
@@ -75,10 +75,12 @@ module Kramdown
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def convert_definition_table(el, indent)
|
78
|
+
th_width = el.attr.delete('th-width')
|
79
|
+
th = th_width.nil? ? "<th>" : "<th width=\"#{th_width}\">"
|
78
80
|
raw_caption = el.attr.delete('caption')
|
79
81
|
rows = raw_caption.nil? ? '' : table_caption(raw_caption)
|
80
82
|
inner(el.children.first, indent).scan(/(<dt>.+?<\/dt>|<dd>.+?<\/dd>)/m).
|
81
|
-
map{|x| x.first.sub(/\A<dt>(.+)<\/dt>\z/m, "
|
83
|
+
map{|x| x.first.sub(/\A<dt>(.+)<\/dt>\z/m, "#{th}\\1</th>")}.
|
82
84
|
map{|x| x.sub(/\A<dd>(.+)<\/dd>\z/m, "<td>\\1</td>")}.
|
83
85
|
each_slice(2) do |x|
|
84
86
|
row = x.map{|c| (' '*(indent + 2)) + c}.join("\n")
|
data/lib/zine_brewer/main.rb
CHANGED
@@ -49,6 +49,7 @@ module ZineBrewer
|
|
49
49
|
@author = set_header_item(h[4], '著者 クレジット')
|
50
50
|
@css = set_header_item(h[5], '')
|
51
51
|
|
52
|
+
@pp_header = make_pp_header
|
52
53
|
@converted = convert(body)
|
53
54
|
end
|
54
55
|
|
@@ -62,6 +63,17 @@ module ZineBrewer
|
|
62
63
|
end
|
63
64
|
end
|
64
65
|
|
66
|
+
def make_pp_header
|
67
|
+
header_output = []
|
68
|
+
header_output << "[コーナー]\n#{@corner}" if @corner.is_complete?
|
69
|
+
header_output << "[タイトル]\n#{@title}" if @title.is_complete?
|
70
|
+
header_output << "[リード]\n<p>#{@lead}</p>" if @lead.is_complete?
|
71
|
+
header_output << "[タイトル画像]\n#{@pic}" if @pic.is_complete?
|
72
|
+
header_output << "[著者クレジット]\n#{@author}" if @author.is_complete?
|
73
|
+
header_output << "[追加CSS]\n#{@css}" if @css.is_complete?
|
74
|
+
header_output.join("\n\n")
|
75
|
+
end
|
76
|
+
|
65
77
|
## Writing out header and body to each file
|
66
78
|
def write_out
|
67
79
|
make_proof_directory
|
@@ -78,15 +90,8 @@ module ZineBrewer
|
|
78
90
|
end
|
79
91
|
|
80
92
|
def write_proof_header
|
81
|
-
header_output = ""
|
82
|
-
header_output << "[コーナー]\n#{@corner}\n\n" if @corner.is_complete?
|
83
|
-
header_output << "[タイトル]\n#{@title}\n\n" if @title.is_complete?
|
84
|
-
header_output << "[リード]\n<p>#{@lead}</p>\n\n" if @lead.is_complete?
|
85
|
-
header_output << "[タイトル画像]\n#{@pic}\n\n" if @pic.is_complete?
|
86
|
-
header_output << "[著者クレジット]\n#{@author}\n\n" if @author.is_complete?
|
87
|
-
header_output << "[追加CSS]\n#{@css}\n\n" if @css.is_complete?
|
88
93
|
File.open("#{@proof_dir}/header.txt", 'wb') do |f|
|
89
|
-
f.write(
|
94
|
+
f.write(@pp_header)
|
90
95
|
end
|
91
96
|
end
|
92
97
|
|
@@ -120,6 +125,11 @@ module ZineBrewer
|
|
120
125
|
### Converts a markdown document and returns that converted body
|
121
126
|
dkmn.convert
|
122
127
|
end
|
128
|
+
|
129
|
+
### pretty print of the converted document
|
130
|
+
def pretty_print
|
131
|
+
@pp_header + "\n\n" + @converted
|
132
|
+
end
|
123
133
|
end
|
124
134
|
end
|
125
135
|
|
data/lib/zine_brewer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zine_brewer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akinori Ichigo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mustache
|
@@ -47,6 +47,7 @@ executables:
|
|
47
47
|
extensions: []
|
48
48
|
extra_rdoc_files: []
|
49
49
|
files:
|
50
|
+
- ".rspec"
|
50
51
|
- CODE_OF_CONDUCT.md
|
51
52
|
- Gemfile
|
52
53
|
- LICENSE.txt
|