zine_brewer 1.1.0 → 1.3.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: 2142217e4515907dcab2b950fc41cb21ba8a886ec04daa5d4ac4cdc6acc6bfbb
4
- data.tar.gz: 1333a38a15cc0b2189ff63b891c8a28a40282705a212283f4e5fa6990d6ac5e6
3
+ metadata.gz: a4a2d9b8d3b0420e7f00e67d9cd814b9d47dee6ee7597468357143e677d2be63
4
+ data.tar.gz: dfada5d6c981ac3686f670c83e52fe86f2351859e2217bef2f49d929888b64a8
5
5
  SHA512:
6
- metadata.gz: b4d750d74c7b68d461c9ca1c42fa74d35abe4c51ff9101cd78d1a2efd8a79a188a25542253ddbef1f2fb2e2c46bcad736d81ce36a0f22347f16e24fb44427fa2
7
- data.tar.gz: 7882f6378598a4714d51f26d7cd3ec0710b79ecf06eb63c7b7793df275693fafc25956ec5e7014e9cfaa8924a329e3a53755fc132abcc76996a7f9a05b9c19f3
6
+ metadata.gz: a5cbb3db19f9d1626cb9439fe4b2ff26910e76c04f512f915e7c1599798a727a663a34bdf9cb0d0eaa3cec3c5571867ba0833e823b35ba46653f5eacf7b44d5a
7
+ data.tar.gz: e0dd6c0e92d1fe3204f7e904b5edb133479d597772d08c6024b2773802768b3e37335d9aadbebffced13375ba97c2341225c3f8ef12a88384cbb2e50cb3f8912
data/README.md CHANGED
@@ -20,7 +20,7 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- $ zine_brewer [kramdown_document_filename]
23
+ $ zine_brewer [kramdown_document_filepath]
24
24
 
25
25
  * The header part is converted and written out as "proof/header.txt".
26
26
  * The body part is converted and written out as "proof/body.txt".
@@ -83,7 +83,7 @@ ZineBrewerで扱う原稿は「ヘッダー」と「本文」に分かれます
83
83
 
84
84
  ヘッダーと本文の境界には、本文ページの起こしを指示する`<%-- page -->`を記述します。
85
85
 
86
- **【注意】ヘッダーの最後に記述する`■記事ID■:0000`は、原則として記述必須です。**例外として、原稿を入れているフォルダの名前を記事ID(「1234」など)にしている場合には省略できます。
86
+ **なお、ヘッダーの最後に記述する`■記事ID■:0000`は、原則として記述必須です。** 例外として、原稿を入れているフォルダの名前を記事ID(「1234」など)にしている場合には省略できます。
87
87
 
88
88
  上記例をZineBrewerで変換した場合、ヘッダーは次のように出力されます(proof/header.txt)。
89
89
 
@@ -108,6 +108,31 @@ ZineBrewerで扱う原稿は「ヘッダー」と「本文」に分かれます
108
108
 
109
109
  ### 本文
110
110
 
111
+ 本文をHTMLに変換したファイルは、proof/body.txtとして出力されます。
112
+
113
+ #### ■ページの起こし
114
+
115
+ **本文の各ページの先頭には、ページの起こしとして必ず`<%-- page -->`を記述してください。** 1ページ目の起こしは、ヘッダーとの境界にもなります。
116
+
117
+ ```
118
+ (ヘッダー)
119
+ ……
120
+
121
+ ■記事ID■:1234
122
+
123
+ <%-- page -->
124
+
125
+ 本文1ページ目
126
+
127
+ <%-- page -->
128
+
129
+ 本文2ページ目
130
+
131
+ <%-- page -->
132
+
133
+ 本文3ページ目
134
+ ```
135
+
111
136
  #### ■図の書き方
112
137
 
113
138
  図は「拡大なし」「拡大あり」「拡大あり(lightbox)」「ハイパーリンク」「プロフィール」の5種類を記述できます。いずれも`<<Fig-●>>`(●にはアルファベット**大文字**1字が入る)から書き出します。
@@ -118,7 +143,7 @@ ZineBrewerで扱う原稿は「ヘッダー」と「本文」に分かれます
118
143
  ```
119
144
  <<Fig_N>>
120
145
  src: [画像ファイル名] ※例 1234_fig.png
121
- widrh: [画像を表示するときの幅を指定] ※例 400px
146
+ width: [画像を表示するときの幅を指定] ※例 400px
122
147
  height: [画像を表示するときの高さを指定] ※例 300px
123
148
  cap: [キャプション] ※例 2020年調査のグラフ
124
149
  ```
@@ -127,7 +152,7 @@ cap: [キャプション] ※例 2020年調査のグラフ
127
152
  ```
128
153
  <<Fig_A>>
129
154
  src: [画像ファイル名] ※例 1234_fig.png
130
- widrh: [画像を表示するときの幅を指定] ※例 400px
155
+ width: [画像を表示するときの幅を指定] ※例 400px
131
156
  height: [画像を表示するときの高さを指定] ※例 300px
132
157
  cap: [キャプション] ※例 2020年調査のグラフ
133
158
  ```
@@ -136,7 +161,7 @@ cap: [キャプション] ※例 2020年調査のグラフ
136
161
  ```
137
162
  <<Fig_Z>>
138
163
  src: [画像ファイル名] ※例 1234_fig.png
139
- widrh: [画像を表示するときの幅を指定] ※例 400px
164
+ width: [画像を表示するときの幅を指定] ※例 400px
140
165
  height: [画像を表示するときの高さを指定] ※例 300px
141
166
  cap: [キャプション] ※例 2020年調査のグラフ
142
167
  ```
@@ -146,7 +171,7 @@ cap: [キャプション] ※例 2020年調査のグラフ
146
171
  <<Fig_H>>
147
172
  src: [画像ファイル名] ※例 1234_book01.png
148
173
  href: [リンク先のURL] ※例 https://www.amazon.co.jp/dp/4798142417
149
- widrh: [画像を表示するときの幅を指定] ※例 200px
174
+ width: [画像を表示するときの幅を指定] ※例 200px
150
175
  height: [画像を表示するときの高さを指定] ※例 150px
151
176
  cap: [キャプション] ※例 書籍『スターティングGo言語』
152
177
  ```
@@ -155,7 +180,7 @@ cap: [キャプション] ※例 書籍『スターティングGo言語』
155
180
  ```
156
181
  <<Fig_P>>
157
182
  src: [画像ファイル名] ※例 1234_ichigo.jpg
158
- widrh: [画像を表示するときの幅を指定] ※例 600px
183
+ width: [画像を表示するときの幅を指定] ※例 600px
159
184
  height: [画像を表示するときの高さを指定] ※例 400px
160
185
  name: [名前] ※例 市古 明典
161
186
  huri: [ふりがな] ※例 いちご あきのり
@@ -243,6 +268,7 @@ src: fig.png <--- 1234_fig.png と書いたのと同じになる
243
268
 
244
269
  ```
245
270
  (本文)
271
+ ……
246
272
 
247
273
  {%background-color:#e6e6e6; %padding:1em;}
248
274
  ===div
@@ -257,13 +283,142 @@ width: 450px
257
283
 
258
284
  #### ■画像回り込みの書き方
259
285
 
260
- divブロックの応用として、本文テキストの画像回り込み指定があります。スタイル指定と合わせて、次に用に記述します。
286
+ 本文テキストの画像回り込み指定は、画像と回り込ませる本文テキストとを、`===wraparound`と`==/wraparound`で挟んでやることで行えます。
287
+
288
+ ただし、画像を右に置くか左に置くかの指定も必要です。画像の記述`<<Fig_●>>`の上に、画像を右に置く場合には`{:.imgR}`、左に置く場合には`{:.imgL}`と記述します。
289
+
290
+ 次の例では、画像を右に置き、その周りに本文テキストを回り込ませます。
261
291
 
262
292
  ```
293
+ (本文)
294
+ ……
295
+
296
+ ===wraparound
297
+
298
+ {:.imgR}
299
+ <<Fig_N>>
300
+ src: 1234_fig.png
301
+ width: 200px
302
+
303
+  回り込ませる本文テキスト〜
304
+ ==/wraparound
305
+ ```
306
+
307
+ また、画像の周りに本文テキストを回り込ませないようにする場合には、本文テキストの各段落の上に`{:.ovh}`という記述を加えます。
308
+
309
+ ```
310
+ (本文)
311
+ ……
312
+
313
+ ===wraparound
314
+
315
+ {:.imgR}
316
+ <<Fig_N>>
317
+ src: 1234_fig.png
318
+ width: 200px
319
+
320
+ {:.ovh}
321
+  回り込ませない本文テキスト(段落1)〜
322
+
323
+ {:.ovh}
324
+  回り込ませない本文テキスト(段落2)〜
325
+ ==/wraparound
263
326
  ```
264
327
 
328
+ #### ■脚注の書き方
329
+
330
+ 次のように、本文テキスト中の脚注を付けたい言葉などに`[^1]`などとアンカーを付け、脚注を置きたい場所に`[^1]: 〜`という形で脚注本体を書きます。脚注本体のコロンを忘れなく。脚注番号で使えるのは半角数字のみです。
331
+
332
+ ```
333
+  ほら、ここに難しい専門用語[^1]が1つ。ここにも意味の分からない専門用語[^2]がもう1つ。
334
+
335
+  それからいろんな話がありつつ、この下に脚注を置きたいのなら、次のように記述します。
336
+
337
+ [^1]: 難しい専門用語の意味。もちろん[リンク](https://www.example.com)も置けますよ。
338
+
339
+ [^2]: 意味の分からない専門用語の意味。
340
+ ```
341
+
342
+ なお、ZineBrewerでは、コラムに`footnotes`クラスを適用したスタイルで脚注本体を表示するようになっています。通常のコラムの形ではスカスカした見た目になってしまうので、追加CSSでスタイルを当てることをお勧めします。
343
+
344
+ #### ■定義表の書き方
345
+
346
+ 定義リストの記述を`===dtable`〜`==/dtable`で挟むと、左に項目、右に内容のテーブル(表)ができます。
347
+
348
+ 例えば、次のように記述すると、
349
+
350
+ ```
351
+ {:caption="イベント概要"}
352
+ ===dtable
353
+ イベント名
354
+ : HRzine Day 2020 Autumn
355
+
356
+ テーマ
357
+ : ニューノーマルが来た!〜人事・労務がいま整えるべきこと〜
358
+
359
+ 日時
360
+ : 2020年10月21日(水) 13:00~18:35
361
+
362
+ 会場
363
+ : オンライン
364
+ ==/dtable
365
+ ```
366
+
367
+ 次のように表示されます。
368
+
369
+ ![dtable](https://user-images.githubusercontent.com/24837059/94995269-32e6e680-05d8-11eb-86ed-074e650ff2eb.png)
370
+
265
371
  #### ■スタイルの書き方
266
372
 
373
+ 最後に、スタイルの記述方法を説明します。
374
+
375
+ Kramdown(拡張Markdown)では、文字や段落にHTMLの属性を付けることができます。例えば、次のように記述すると、太字部分が赤色になり下線も引かれます。
376
+
377
+ ```
378
+ ここは次の試験で**必ず出題する**{:style="color:red; text-decoration:underline;"}ところだから、しっかり勉強してきなさい。
379
+ ```
380
+
381
+ これは、`**必ず出題する**{:style="color:red; text-decoration:underline;"}`という部分は、`<strong style="color:red; text-decoration:underline;">必ず出題する</strong>`と変換されるためです。
382
+
383
+ ZineBrewerでは、styleのところをもう少し簡潔に書けるようにしてあります。style属性中の指定**一つひとつ**を、パーセント記号とセミコロンで括ります。
384
+
385
+ ```
386
+ ここは次の試験で**必ず出題する**{:%color:red; %text-decoration:underline;}ところだから、しっかり勉強してきなさい。
387
+ ```
388
+
389
+ また、太字にしないで、ただ赤字・下線引きにしたい場合には、次のように記述します。
390
+
391
+ ```
392
+ ここは次の試験で[[必ず出題する]]{:%color:red; %text-decoration:underline;}ところだから、しっかり勉強してきなさい。
393
+ ```
394
+
395
+ 段落に対してスタイルを当てる場合には、段落の直前あるいは直後にスタイルを記述します。例えば、次のように記述すると、段落の背景に薄い赤色に敷くことができます(余白も少しとっています)。
396
+
397
+ ```
398
+ {:%background-color:#ffe6e6; %padding:15px;}
399
+ ここは次の試験で必ず出題するところだから、しっかり勉強してきなさい。
400
+ ```
401
+
402
+ 行頭の丸数字などを頭出し(ぶら下げ)したいことがあると思いますが、それは次のように記述します。
403
+
404
+ ```
405
+ {:%padding-left:1em; %text-indent:-1em;}
406
+ ①このように書いてやると、「①」の部分だけ左につきだし、以降の文章が引っ込んだ形で表示できます。
407
+ ```
408
+
409
+ ![Hanging Indent](https://user-images.githubusercontent.com/24837059/94996073-59f3e700-05dd-11eb-87f7-8a16be840f6f.png)
410
+
411
+ #### id属性、class属性、その他の属性
412
+
413
+ Kramdown(拡張Markdown)の`{: }`の中には、次のようにしてid属性とclass属性を記述できます。
414
+
415
+ ```
416
+ {:#id_1234 .footnotes}
417
+ id属性は#、class属性は.を使って記述できます。
418
+ ```
419
+
420
+ その他の属性はstyle以外、略記方法はありませんが、HTMLと同様に`{:rel="lightbox}"`とイコールを使った書き方にすれば、何でも指定できます。
421
+
267
422
  ## License
268
423
 
269
424
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
File without changes
@@ -1,5 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
+ require 'mustache'
4
+
3
5
  class BookRanking < Mustache
4
6
 
5
7
  # <<BookRanking>>
@@ -1,5 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
+ require 'mustache'
4
+
3
5
  class Casts < Mustache
4
6
 
5
7
  # <<Casts>>
@@ -1,5 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
+ require 'mustache'
4
+
3
5
  require_relative 'fig/module_fig_base'
4
6
  require_relative 'fig/module_fig_plus'
5
7
 
@@ -1,5 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
+ require 'mustache'
4
+
3
5
  require_relative 'fig/module_fig_base'
4
6
  require_relative 'fig/module_fig_plus'
5
7
 
@@ -1,5 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
+ require 'mustache'
4
+
3
5
  require_relative 'fig/module_fig_base'
4
6
  require_relative 'fig/module_fig_plus'
5
7
 
@@ -1,5 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
+ require 'mustache'
4
+
3
5
  require_relative 'fig/module_fig_base'
4
6
 
5
7
  class Fig_P < Mustache
@@ -1,5 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
+ require 'mustache'
4
+
3
5
  require_relative 'fig/module_fig_base'
4
6
  require_relative 'fig/module_fig_plus'
5
7
 
@@ -1,3 +1,3 @@
1
1
  module ZineBrewer
2
- VERSION = "1.1.0"
2
+ VERSION = "1.3.2"
3
3
  end
@@ -24,5 +24,6 @@ Gem::Specification.new do |spec|
24
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
25
  spec.require_paths = ["lib"]
26
26
 
27
+ spec.add_runtime_dependency "mustache"
27
28
  spec.add_runtime_dependency "darkmouun"
28
29
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zine_brewer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.3.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: 2020-10-03 00:00:00.000000000 Z
11
+ date: 2020-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: mustache
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: darkmouun
15
29
  requirement: !ruby/object:Gem::Requirement