zine_brewer 1.9.0 → 1.11.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9377b1600b8679c919199df61d3c142c7f8a0c9c1972d891a31cd6429b406a49
4
- data.tar.gz: b100b1ad9d96943035a8acd2dd043aa27499c348d8e9a9b9c4bbef47b9d2d0b2
3
+ metadata.gz: 436fc24bfbaa271fdc978e0455307559c94b9ba9ff8c782509c58003e5d15230
4
+ data.tar.gz: 9535c3e48db6950deba0d3f703f7b0f9ee9a8e3432b22f48462de3b45d5992cd
5
5
  SHA512:
6
- metadata.gz: ba17f9a2b9d9288b7e54e97f3fa9ccacfa9bebfad069810bd8fb20526e012d32a944f3c1bb44851b5d899d4c94b532c958bb8a2c8dbe2d36abd381f258b2bd99
7
- data.tar.gz: b5e927c93f297b95758ad684cb54e770a981372fc2815e1f50f7d2de0d4347edf504b5f269ba0b50518fadbd09ed3550d0adc51a022c1e5504cd8ad105bd1ddc
6
+ metadata.gz: b2d1a42f30e7d1162a1d4f000ef06fe5480154bafdedad1056e8383c92cd3ff16111c3739236ef7937cc4f44d5717de664e545aff3234c835a34ebaaeb68cb66
7
+ data.tar.gz: 2ef0d0146909e6f78d388c18a6a8741c788eb49581a136ae95139949a402371a3535288be738525a186862044334189c84cd4828af418e871d7cc3db38e65db7
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ZineBrewer
2
2
 
3
- ZineBrewer converts Kramdown (=exhanced Markdown) document to HTML for Shoeisha Web Media.
3
+ ZineBrewer converts Kramdown (=exhanced Markdown) document to HTML for a web media.
4
4
 
5
5
  ## Installation
6
6
 
@@ -353,12 +353,12 @@ width: 200px
353
353
 
354
354
  #### ■定義表の書き方
355
355
 
356
- 定義リストの記述を`===dtable`〜`==/dtable`で挟むと、左に項目、右に内容のテーブル(表)ができます。
356
+ 定義リストの記述を`===dtable`〜`==/dtable`で挟むと、左に項目、右に内容のテーブル(表)ができます。キャプション(caption)を定義できるほか、1列目の幅を`th-width`属性で指定できます。
357
357
 
358
358
  例えば、次のように記述すると、
359
359
 
360
360
  ```
361
- {:caption="イベント概要"}
361
+ {:caption="イベント概要" th-width="20%"}
362
362
  ===dtable
363
363
  イベント名
364
364
  : HRzine Day 2020 Autumn
@@ -376,7 +376,7 @@ width: 200px
376
376
 
377
377
  次のように表示されます。
378
378
 
379
- ![dtable](https://user-images.githubusercontent.com/24837059/94995269-32e6e680-05d8-11eb-86ed-074e650ff2eb.png)
379
+ ![dtable](https://user-images.githubusercontent.com/24837059/133894991-59887c24-3c2f-402d-a854-b56c55d7da8c.png)
380
380
 
381
381
  #### ■スタイルの書き方
382
382
 
@@ -42,9 +42,9 @@ module ZineBrewer
42
42
 
43
43
  @article_id = $+ if header.sub!(/^■記事ID■[^0-9]+(\d+)$/, '')
44
44
  h = header.strip.split(/\n\n+/)
45
- @corner = set_header_item(h[0], 'IT人材ラボの記事・ニュース')
45
+ @corner = set_header_item(h[0], '記事・ニュースのコーナー')
46
46
  @title = set_header_item(h[1], 'タイトル' )
47
- @lead = set_header_item(h[2], 'リード')
47
+ @lead = set_header_item(h[2], 'nil')
48
48
  @pic = set_header_item(h[3], 'dummy.png')
49
49
  @author = set_header_item(h[4], '著者 クレジット')
50
50
  @css = set_header_item(h[5], '')
@@ -54,7 +54,7 @@ module ZineBrewer
54
54
  end
55
55
 
56
56
  def set_header_item(target, default)
57
- if /\A[\-%]+\Z/ =~ target || target.nil?
57
+ if /\A\ufeff?[\-%]+\Z/ =~ target || target.nil?
58
58
  default.define_singleton_method(:is_complete?){ false }
59
59
  default
60
60
  else
@@ -13,7 +13,7 @@ class BookRanking < Mustache
13
13
  @template = <<EOT
14
14
  <div class="imgLRBlock cf">
15
15
  <figure class="imgR">
16
- <a href="{{url}}" target="_blank"><img alt="{{title}}" loading="lazy" src="{{cover}}" style="border:1px solid #808080;" width="100" title="{{title}}" /></a></figure>
16
+ <a href="{{url}}" target="_blank"><img alt="{{title}}" loading="lazy" src="{{cover}}" style="border:1px solid #808080; width:100px;" title="{{title}}" /></a></figure>
17
17
  <p markdown="1"> {{& description}}</p>
18
18
  </div>
19
19
  EOT
@@ -13,7 +13,7 @@ class Casts < Mustache
13
13
  # cap: プロフィール
14
14
 
15
15
  # CSSに下記の登録が必要
16
- # article#contents div.article div.casts>div ~ div { margin-top:8px; }
16
+ # .c-article_content div.casts>div ~ div { margin-top:8px; }
17
17
 
18
18
  @template = <<EOT
19
19
  <div class="casts" style="margin-bottom:30px; padding:13px 13px 3px; border:solid 2px #eee;">
@@ -21,7 +21,7 @@ class Casts < Mustache
21
21
  {{#title_sw}}<h4>{{title}}</h4>{{/title_sw}}
22
22
  <div class="imgLRBlock cf">
23
23
  <figure class="imgL">
24
- <img src="{{fig_src}}" loading="lazy" alt="{{name}}" height="135" width="110" />
24
+ <img src="{{fig_src}}" loading="lazy" alt="{{name}}" style="height:135px;" />
25
25
  </figure>
26
26
  <p class="ovh" markdown="span" style="font-size:14px; line-height:1.7; margin-bottom:10px;"><strong style="font-size:15px;">{{name}}({{huri}})氏</strong><br />{{& caption}}</p>
27
27
  </div>
@@ -68,7 +68,7 @@ EOT
68
68
 
69
69
  def make_caption(l_cap)
70
70
  begin
71
- l_cap.chomp.sub(/^\\/, '').gsub(/\n/, '(((BR)))')
71
+ l_cap.chomp.sub(/^\\/, '').gsub(/\n/, '<br/>')
72
72
  rescue
73
73
  nil
74
74
  end
@@ -10,7 +10,8 @@ module Fig_00
10
10
  a_img[:fig_src] = make_src(h["src"])
11
11
  a_img[:href] = h["href"]
12
12
  a_img[:alt] = make_alt(h["alt"])
13
- a_img[:img_size] = make_img_size(h["width"], h["height"])
13
+ a_img[:img_style] = make_img_style(h["width"], h["height"]) \
14
+ unless h["width"].nil? && h["height"].nil?
14
15
  result << a_img
15
16
  end
16
17
  result
@@ -18,7 +19,7 @@ module Fig_00
18
19
 
19
20
  def caption
20
21
  begin
21
- cap.chomp.sub(/^\\/, '').gsub(/\n/,'(((BR)))')
22
+ cap.chomp.sub(/^\\/, '').gsub(/\n/,'<br/>')
22
23
  rescue
23
24
  nil
24
25
  end
@@ -53,11 +54,13 @@ module Fig_00
53
54
  end
54
55
  end
55
56
 
56
- def make_img_size(l_width, l_height)
57
+ def make_img_style(l_width, l_height)
57
58
  s = []
58
- s << %Q{width="#{l_width}"} unless l_width.nil?
59
- s << %Q{height="#{l_height}"} unless l_height.nil?
60
- s.join(' ').strip
59
+ s << "width:#{l_width};" unless l_width.nil?
60
+ s << "height:#{l_height};" unless l_height.nil?
61
+ unless s.all?{|v| v.nil? }
62
+ %Q{style="#{s.join(' ').strip}" }
63
+ end
61
64
  end
62
65
 
63
66
  end
@@ -17,7 +17,7 @@ class Fig_A < Mustache
17
17
  @template = <<EOT
18
18
  <figure>
19
19
  {{#imgs_list}}
20
- <a href="{{fig_src}}" target="_blank"><img src="{{fig_src}}" loading="lazy" alt="{{alt}}"{{#width}} width="{{width}}"{{/width}}{{#height}} height="{{height}}"{{/height}} /></a>
20
+ <a href="{{fig_src}}" target="_blank"><img src="{{fig_src}}" loading="lazy" alt="{{alt}}" {{& img_style}} /></a>
21
21
  {{/imgs_list}}
22
22
  <figcaption markdown="span">{{#caption}}{{& caption}}<br/>{{/caption}}[画像クリックで拡大表示]</figcaption>
23
23
  </figure>
@@ -18,7 +18,7 @@ class Fig_H < Mustache
18
18
  @template = <<EOT
19
19
  <figure>
20
20
  {{#imgs_list}}
21
- <a href="{{href}}" target="_blank"><img src="{{fig_src}}" loading="lazy" alt="{{alt}}"{{#width}} width="{{width}}"{{/width}}{{#height}} height="{{height}}"{{/height}} /></a>
21
+ <a href="{{href}}" target="_blank"><img src="{{fig_src}}" loading="lazy" alt="{{alt}}" {{& img_style}} /></a>
22
22
  {{/imgs_list}}
23
23
  {{#caption}}<figcaption markdown="span">{{& caption}}</figcaption>{{/caption}}
24
24
  </figure>
@@ -13,12 +13,11 @@ class Fig_N < Mustache
13
13
  # width: 画像幅
14
14
  # height: 画像高さ
15
15
  # cap: キャプション
16
- # from: 出典 << 出典URL
17
16
 
18
17
  @template = <<EOT
19
18
  <figure>
20
19
  {{#imgs_list}}
21
- <img src="{{fig_src}}" loading="lazy" alt="{{alt}}"{{#width}} width="{{width}}"{{/width}}{{#height}} height="{{height}}"{{/height}} />
20
+ <img src="{{fig_src}}" loading="lazy" alt="{{alt}}" {{& img_style}} />
22
21
  {{/imgs_list}}
23
22
  {{#caption}}<figcaption markdown="span">{{caption}}</figcaption>{{/caption}}
24
23
  </figure>
@@ -10,22 +10,26 @@ class Fig_P < Mustache
10
10
 
11
11
  # <<Fig_P>>
12
12
  # src: 画像ファイル名
13
- # name: 姓 名
14
- # huri: ふり・がな
15
13
  # width: 画像幅
16
14
  # height: 画像高さ
15
+ # name: 姓 名
16
+ # huri: ふり・がな
17
+ # title: 肩書き
17
18
  # cap: |
18
- # キャプション
19
+ # プロフィール
19
20
 
20
21
  @template = <<EOT
21
22
  <figure>
22
23
  {{#imgs_list}}
23
- <img src="{{fig_src}}" loading="lazy" alt="{{name}}氏"{{#width}} width="{{width}}"{{/width}}{{#height}} height="{{height}}"{{/height}} />
24
+ <img src="{{fig_src}}" loading="lazy" alt="{{name}}氏" {{& img_style}} />
24
25
  {{/imgs_list}}
25
- <div style="text-align:left; padding:0px 35px;">
26
- <figcaption><strong>{{name}}({{huri}})氏</strong></figcaption>
27
- <figcaption markdown="span">{{caption}}</figcaption>
28
- </div>
26
+ <figcaption style="text-align:left;">
27
+ <strong>{{name}}({{huri}})氏</strong><br/>
28
+ <span markdown="span">{{title}}</span>
29
+ <div markdown="span" style="margin-top:6px;">
30
+ {{{caption}}}
31
+ </div>
32
+ </figcaption>
29
33
  </figure>
30
34
  EOT
31
35
 
@@ -17,7 +17,7 @@ class Fig_Z < Mustache
17
17
  @template = <<EOT
18
18
  <figure>
19
19
  {{#imgs_list}}
20
- <a href="{{fig_src}}" rel="lightbox" target="_blank"><img src="{{fig_src}}" loading="lazy" alt="{{alt}}"{{#width}} width="{{width}}"{{/width}}{{#height}} height="{{height}}"{{/height}} /></a>
20
+ <a href="{{fig_src}}" rel="lightbox" target="_blank"><img src="{{fig_src}}" alt="{{alt}}" {{& img_style}}/></a>
21
21
  {{/imgs_list}}
22
22
  <figcaption markdown="span">{{#caption}}{{& caption}}<br/>{{/caption}}[画像クリックで拡大表示]</figcaption>
23
23
  </figure>
@@ -1,3 +1,3 @@
1
1
  module ZineBrewer
2
- VERSION = "1.9.0"
2
+ VERSION = "1.11.2"
3
3
  end
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.9.0
4
+ version: 1.11.2
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-18 00:00:00.000000000 Z
11
+ date: 2022-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mustache