diff --git a/README.md b/README.md index 2dd6615..3b6f598 100644 --- a/README.md +++ b/README.md @@ -337,27 +337,27 @@ GitHub Flavored Markdown のFenced code blocks記法にも対応しています キャプション -### 注釈、リンク +### 脚注、リンク -次の2つの記法が使えます。紙面ではいずれも注釈になり、両者の違いはありません。 +次の2つの記法が使えます。紙面ではいずれも脚注になり、両者の違いはありません。 [リンクの対象](URL) - 注釈の対象(注:注釈文。) + 脚注の対象(注:脚注文。) たとえば次のように書きます。 [RubyMotion](http://rubymotion.com/)は、RubyでiOSアプリを作るれるツールです(注:日本円で20,000円程度です。)。 #### 注意事項 -注釈文も「です・ます」調で統一してください。 -また、注釈文の末尾にも「。」は必要です。 +脚注文も「です・ます」調で統一してください。 +また、脚注文の末尾にも「。」は必要です。 -文末からの注釈の場合、以下のように末尾は「。)。」となります。 +文末からの脚注の場合、以下のように末尾は「。)。」となります。 -* ☓:〜です(注:注釈文です)。 -* ☓:〜です。(注:注釈文です。) -* ○:〜です(注:注釈文です。)。 +* ☓:〜です(注:脚注文です)。 +* ☓:〜です。(注:脚注文です。) +* ○:〜です(注:脚注文です。)。 ### 表 @@ -401,9 +401,9 @@ GitHub Flavored Markdownとは異なり、複数行に分けて書いても1行
#### コラムタイトル 本文 - ##### コラム小見出し + ##### コラム内見出し 本文 - ##### コラム小見出し + ##### コラム内見出し 本文
@@ -526,7 +526,7 @@ md2inao デベロッパー向け情報 "◆>=◆" : "<2267>", "◆=>◆" : "<2266>", - "◆WDB◆" : "#" + "◆WDB◆" : "WDB" } } ``` @@ -548,6 +548,13 @@ md2inao デベロッパー向け情報 - InDesign になったテキストを置換したい時はこちら - md 中の `` は after_filter 前に` ◆…◆` になります +過去のInDesignのスタイル名で出力したい場合 +------------------------- + +WEB+DB PRESS Vol.116(2020年4月発売)から、InDesignのバージョンアップに伴い、InDesignのスタイル名を[変更しました](https://github.com/naoya/md2inao/pull/126)。 + +古い書籍の改訂時など、過去のスタイル名のまま変換したい場合は、タグ[「old\-style\-name](https://github.com/naoya/md2inao/releases/tag/old-style-name)段階のものを使用してください。 + Authors ---------- diff --git a/config/id_filter.json b/config/id_filter.json index 518b000..5ef3d92 100644 --- a/config/id_filter.json +++ b/config/id_filter.json @@ -1,6 +1,6 @@ { "before_filter": { - "" : "", + "" : "", "" : "", "" : "", "" : "" @@ -20,7 +20,7 @@ "◆>=◆" : "<2267>", "◆=>◆" : "<2266>", - "◆WDB◆" : "#", + "◆WDB◆" : "WDB", "㈱" : "<3231>", "(株)" : "<3231>", diff --git a/lib/Text/Md2Inao.pm b/lib/Text/Md2Inao.pm index 03c1d8d..cc847cf 100644 --- a/lib/Text/Md2Inao.pm +++ b/lib/Text/Md2Inao.pm @@ -22,14 +22,14 @@ use Text::Md2Inao::Logger; # alpha: アルファベット has default_list => ( is => 'rw', isa => 'Str' ); -# リストの文字数上限 +# コードの文字数上限 # WEB+DB PRESSの場合、リストは、1行63桁(文字)まで # 書籍の場合、リストは1行69桁(文字)まで has max_list_length => ( is => 'rw', isa => 'Num' ); -# 本文埋め込みリストの文字数上限 -# WEB+DB PRESSの場合、本文リストは1行55桁(文字)まで -# 書籍の場合、本文リストは1行73桁(文字)まで +# 本文埋め込みコードの文字数上限 +# WEB+DB PRESSの場合、本文コードは1行55桁(文字)まで +# 書籍の場合、本文コードは1行73桁(文字)まで has max_inline_list_length => ( is => 'rw', isa => 'Num' ); # 空行のスタイル @@ -76,7 +76,7 @@ sub replace_markdown_extra_footnote { my %footnotes_used; my @lines = split /\n/, $text; - ## 脚注の注釈を収集 + ## 脚注の脚注文を収集 for (@lines) { if (m/^\[\^(\w+)\]:(.+)$/) { my ($k, $v) = ($1, $2); diff --git a/lib/Text/Md2Inao/Builder/InDesign.pm b/lib/Text/Md2Inao/Builder/InDesign.pm index c704c9c..4d42f72 100644 --- a/lib/Text/Md2Inao/Builder/InDesign.pm +++ b/lib/Text/Md2Inao/Builder/InDesign.pm @@ -146,7 +146,7 @@ case text => sub { if ($text =~ m!\(注:! or $c->in_footnote) { $text = replace_note_parenthesis($c, $text, '注'); - $text =~ s!◆注/◆!!g; + $text =~ s!◆注/◆!!g; $text =~ s!◆/注◆!!g; } @@ -185,7 +185,7 @@ case "h4" => sub { case "h5" => sub { my ($c, $h) = @_; - return sprintf "%s\n", $c->parse_element($h); + return sprintf "%s\n", $c->parse_element($h); }; case strong => sub { @@ -211,7 +211,7 @@ case em => sub { case code => sub { my ($c, $h) = @_; - return sprintf "%s", $c->parse_element($h); + return sprintf "%s", $c->parse_element($h); }; case p => sub { @@ -355,14 +355,14 @@ case pre => sub { $text = escape_html($text); - my $list_label = 'リスト'; - my $comment_label = 'リストコメント'; + my $list_label = 'コード'; + my $comment_label = 'コードコメント'; # 「!!! cmd」で始まるコードブロックはコマンドライン(黒背景) if ($text =~ /!!!(\s+)?cmd/) { $text =~ s/.+?\n//; - $list_label .= '白文字'; - $comment_label .= '白地黒文字'; + $list_label .= '黒地白文字'; + $comment_label .= '黒地白文字用'; } ## リストスタイル @@ -377,7 +377,7 @@ case pre => sub { } else { if ($max > $c->max_inline_list_length) { - log warn => "本文埋め込みリストは" . $c->max_inline_list_length . "文字まで!(現在${max}使用):\n$text\n\n"; + log warn => "本文埋め込みコードは" . $c->max_inline_list_length . "文字まで!(現在${max}使用):\n$text\n\n"; } } @@ -389,7 +389,7 @@ case pre => sub { } # コード内強調 - $text =~ s!\*\*(.+?)\*\*!$1!g; + $text =~ s!\*\*(.+?)\*\*!$1!g; # コード内イタリック $text =~ s!\___(.+?)\___!$1!g; @@ -428,7 +428,7 @@ case a => sub { my $url = $h->attr('href'); my $title = $c->parse_element($h); if ($url and $title) { - return sprintf "%s%s", $title, $url; + return sprintf "%s%s", $title, $url; } else { return fallback_to_escaped_html($h); } diff --git a/lib/Text/Md2Inao/Builder/Inao.pm b/lib/Text/Md2Inao/Builder/Inao.pm index 02bc7eb..0c9d75c 100644 --- a/lib/Text/Md2Inao/Builder/Inao.pm +++ b/lib/Text/Md2Inao/Builder/Inao.pm @@ -240,7 +240,7 @@ case pre => sub { } else { if ($max > $c->max_inline_list_length) { - log warn => "本文埋め込みリストは" . $c->max_inline_list_length . "文字まで!(現在${max}使用):\n$text\n\n"; + log warn => "本文埋め込みコードは" . $c->max_inline_list_length . "文字まで!(現在${max}使用):\n$text\n\n"; } } diff --git a/t/30_indesign_basic_syntax.t b/t/30_indesign_basic_syntax.t index 71f83ed..b750e76 100644 --- a/t/30_indesign_basic_syntax.t +++ b/t/30_indesign_basic_syntax.t @@ -76,13 +76,13 @@ _a-zA-Z0-9!"#$%&'()-=^@`[]{};+:*<>,./?_ --- in md2inao これは`インラインのコード`です --- expected -これはインラインのコードです +これはインラインのコードです === footnote --- in md2inao -これは(注:ここは注釈です)です +これは(注:ここは脚注です)です --- expected -これはここは注釈ですです +これはここは脚注ですです === red --- in md2inao @@ -118,14 +118,14 @@ _a-zA-Z0-9!"#$%&'()-=^@`[]{};+:*<>,./?_  コラム本文コラム本文コラム本文コラム本文コラム本文コラム本文コラム本文コラム本文コラム本文コラム本文コラム。 -##### コラム小見出し +##### コラム内見出し  コラム内でも**強調**や_イタリックabc_などが使えます。 --- expected コラム見出し  コラム本文コラム本文コラム本文コラム本文コラム本文コラム本文コラム本文コラム本文コラム本文コラム本文コラム。 -コラム小見出し +コラム内見出し  コラム内でも強調イタリックabcなどが使えます。 === list @@ -224,9 +224,9 @@ _a-zA-Z0-9!"#$%&'()-=^@`[]{};+:*<>,./?_ === numbers in body --- in md2inao - 箇条書き以外の本文やリスト中で番号を書きたいときは、(d1)、(d2)、(c1)、(c2)、(s1)、(s2)、(a1)、(a2)のように書いてください。 + 箇条書き以外の本文やコード中で番号を書きたいときは、(d1)、(d2)、(c1)、(c2)、(s1)、(s2)、(a1)、(a2)のように書いてください。 --- expected - 箇条書き以外の本文やリスト中で番号を書きたいときは、<2776><2777><2460><2461>12abのように書いてください。 + 箇条書き以外の本文やコード中で番号を書きたいときは、<2776><2777><2460><2461>12abのように書いてください。 === numbers in body but escaped --- in md2inao @@ -236,9 +236,9 @@ _a-zA-Z0-9!"#$%&'()-=^@`[]{};+:*<>,./?_ === numbers in body and lists --- in md2inao -### 本文やリスト中での番号 +### 本文やコード中での番号 - 箇条書き以外の本文やリスト中で番号を書きたいときは、(d1)、(d2)、(c1)、(c2)、(s1)、(s2)、(a1)、(a2)のように書いてください。 + 箇条書き以外の本文やコード中で番号を書きたいときは、(d1)、(d2)、(c1)、(c2)、(s1)、(s2)、(a1)、(a2)のように書いてください。
  1. hogehogeをします
  2. @@ -254,18 +254,18 @@ _a-zA-Z0-9!"#$%&'()-=^@`[]{};+:*<>,./?_ alert(\c1); // \でエスケープできます } --- expected -本文やリスト中での番号 - 箇条書き以外の本文やリスト中で番号を書きたいときは、<2776><2777><2460><2461>12abのように書いてください。 +本文やコード中での番号 + 箇条書き以外の本文やコード中で番号を書きたいときは、<2776><2777><2460><2461>12abのように書いてください。 1hogehogeをします 2fugafugaと1の結果を足し合わせます  リスト1.1<2460>ではアラートを出しています。<2461>でもアラートを出しています。(a1)エスケープできます。 リスト1.1 キャプション(コードのタイトル) -function hoge() { - alert(foo); … <2460> - alert(bar); … <2461> - alert(c1); // <005C><005C>でエスケープできます -} +function hoge() { + alert(foo); … <2460> + alert(bar); … <2461> + alert(c1); // <005C><005C>でエスケープできます +} === pre @@ -275,9 +275,9 @@ _a-zA-Z0-9!"#$%&'()-=^@`[]{};+:*<>,./?_ } --- expected -function bar(b) { - alert(b); -} +function bar(b) { + alert(b); +} === pre --- in md2inao @@ -288,9 +288,9 @@ function bar(b) { ``` --- expected -function bar(b) { - alert(b); -} +function bar(b) { + alert(b); +} === notes in pre --- in md2inao @@ -299,9 +299,9 @@ function bar(b) { } --- expected -function bar(b) { - alert(b); コメント -} +function bar(b) { + alert(b); コメント +} === notes in pre --- in md2inao @@ -312,9 +312,9 @@ function bar(b) { ``` --- expected -function bar(b) { - alert(b); コメント -} +function bar(b) { + alert(b); コメント +} === notes in pre #2 --- in md2inao @@ -324,10 +324,10 @@ function bar(b) { } --- expected - 見出し的にも使えます -function bar(b) { - alert(b); -} + 見出し的にも使えます +function bar(b) { + alert(b); +} === notes in pre #2 --- in md2inao @@ -339,10 +339,10 @@ function bar(b) { ``` --- expected - 見出し的にも使えます -function bar(b) { - alert(b); -} + 見出し的にも使えます +function bar(b) { + alert(b); +} === caption in pre --- in md2inao @@ -350,7 +350,7 @@ function bar(b) { use strict; --- expected リスト1.1 キャプション -use strict; +use strict; === caption in pre --- in md2inao @@ -360,7 +360,7 @@ use strict; ``` --- expected リスト1.1 キャプション -use strict; +use strict; === em/italic in pre --- in md2inao @@ -368,8 +368,8 @@ use strict; ___foo('bar');___ // コード内___イタリックabc___ --- expected -use strict; -foo('bar'); // コード内イタリックabc +use strict; +foo('bar'); // コード内イタリックabc === em/italic in pre --- in md2inao @@ -379,8 +379,8 @@ ___foo('bar');___ // コード内___イタリックabc___ ``` --- expected -use strict; -foo('bar'); // コード内イタリックabc +use strict; +foo('bar'); // コード内イタリックabc === pre for command --- in md2inao @@ -395,13 +395,13 @@ ___foo('bar');___ // コード内___イタリックabc___ } --- expected 図1.1 キャプション(コマンドのタイトル) -$ command foo // コマンド内強調 -bar こんな風にコメントがつけられます - - 見出し的にも使えます -function bar(b) { - alert(b); -} +$ command foo // コマンド内強調 +bar こんな風にコメントがつけられます + + 見出し的にも使えます +function bar(b) { + alert(b); +} === pre for command --- in md2inao @@ -418,13 +418,13 @@ function bar(b) { ``` --- expected 図1.1 キャプション(コマンドのタイトル) -$ command foo // コマンド内強調 -bar こんな風にコメントがつけられます - - 見出し的にも使えます -function bar(b) { - alert(b); -} +$ command foo // コマンド内強調 +bar こんな風にコメントがつけられます + + 見出し的にも使えます +function bar(b) { + alert(b); +} === pre for command, no caption --- in md2inao @@ -434,9 +434,9 @@ function bar(b) { } --- expected -function bar(b) { - alert(b); コメント -} +function bar(b) { + alert(b); コメント +} === pre for command, no caption --- in md2inao @@ -448,9 +448,9 @@ function bar(b) { ``` --- expected -function bar(b) { - alert(b); コメント -} +function bar(b) { + alert(b); コメント +} === list --- in md2inao * ハイフンになる @@ -465,21 +465,21 @@ function bar(b) { a --- expected -* ハイフンになる +* ハイフンになる -a +a -* ハイフンにならない -* ハイフンになる +* ハイフンにならない +* ハイフンになる -a +a === anchor --- in md2inao [RubyMotion](http://rubymotion.com) --- expected -RubyMotionhttp://rubymotion.com +RubyMotionhttp://rubymotion.com === img --- in md2inao diff --git a/t/32_indesign_free_replacer.t b/t/32_indesign_free_replacer.t index 4ca0640..fb13d78 100644 --- a/t/32_indesign_free_replacer.t +++ b/t/32_indesign_free_replacer.t @@ -47,13 +47,13 @@ __END__ --- in md2inao ◆WDB◆ --- expected -# +WDB === sup --- in md2inao 上付き(ゴシック、コラムなどでの注記用) --- expected -上付き(ゴシック、コラムなどでの注記用) +上付き(ゴシック、コラムなどでの注記用) === sup --- in md2inao @@ -127,12 +127,12 @@ my_app ``` --- expected -my_app -├── lib -│ ├── MyApp -│ │ └── Controller -│ │ └── Example.pm -│ └── MyApp.pm +my_app +├── lib +│ ├── MyApp +│ │ └── Controller +│ │ └── Example.pm +│ └── MyApp.pm === fullwidth tilde to wave dash --- in md2inao diff --git a/t/33_indesign_escape_html.t b/t/33_indesign_escape_html.t index dd74d1a..6a2675a 100644 --- a/t/33_indesign_escape_html.t +++ b/t/33_indesign_escape_html.t @@ -36,7 +36,7 @@ This is not html <code> This is not html `` --- expected -This is not html <005C>> +This is not html <005C>> === list context --- in md2inao @@ -48,9 +48,9 @@ Hello, World; --- expected -<005C>> -<005C>><005C>> -<005C>> +<005C>> +<005C>><005C>> +<005C>> Hello, World; === passing througed tags diff --git a/t/34_blank_style.t b/t/34_blank_style.t index e885dfb..4516ac5 100644 --- a/t/34_blank_style.t +++ b/t/34_blank_style.t @@ -34,7 +34,7 @@ __END__ --- expected -use strict; +use strict; === --- in md2inao diff --git a/t/40_use_math.t b/t/40_use_math.t index 379c711..3e4bb52 100644 --- a/t/40_use_math.t +++ b/t/40_use_math.t @@ -20,9 +20,9 @@ The following lines are note inline maths. Inline math text $x_1$ and $\Delta x_2$ should be preserved as-is.The following lines are note inline maths. -$ 1 -$ 2 -$ 3 +$ 1 +$ 2 +$ 3 === inline math inao --- in md2inao UseMath: true diff --git a/t/99_rt_ruby_in_footnote.t b/t/99_rt_ruby_in_footnote.t index afda576..6021981 100644 --- a/t/99_rt_ruby_in_footnote.t +++ b/t/99_rt_ruby_in_footnote.t @@ -11,11 +11,11 @@ __END__ ○○います(注:あいう辟易(へき えき)えお)。 --- expected -○○いますあいう辟易えお。 +○○いますあいう辟易えお。 === groupruby --- in md2id ○○います(注:あいう欠伸(あくび)えお)。 --- expected -○○いますあいう欠伸えお。 +○○いますあいう欠伸えお