s4

changeset 1038:b8b1b8356b94

Add translation of |>| for colspan, |^ for rowspan
author HIROSE Yuuji <yuuji@gentei.org>
date Sat, 06 Apr 2024 18:03:05 +0900
parents 634fee6a6bd2
children 68a01c699acb
files s4-blog.sh s4-funcs.sh
diffstat 2 files changed, 26 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/s4-blog.sh	Wed Mar 06 09:55:20 2024 +0900
     1.2 +++ b/s4-blog.sh	Sat Apr 06 18:03:05 2024 +0900
     1.3 @@ -609,6 +609,8 @@
     1.4  行頭: ## 大見出し, ### 中見出し, #### 小見出し
     1.5  行末の2連続スペースまたは ;;; で強制改行(<br>)
     1.6  |*見出し列|列2|列3…  と行頭から始まる縦棒区切り行を続けて表
     1.7 +|*>| でrowspan=\"2\"のカラム、>>で3,>>>で4……、 *なしで td rowspan
     1.8 +|*^ でcolspan=\"2\"のカラム、^^で3,^^^で4……、 *なしで td colspan
     1.9  「 *語群* 」で強調(両側の空白必要、** でもっと強調。*の代わりに _ でも可)
    1.10  「~~文~~」 で「文」の部分に打ち消し線。
    1.11  - [ ] と - [x] でチェックボックス"
     2.1 --- a/s4-funcs.sh	Wed Mar 06 09:55:20 2024 +0900
     2.2 +++ b/s4-funcs.sh	Sat Apr 06 18:03:05 2024 +0900
     2.3 @@ -693,7 +693,31 @@
     2.4    sed -n '
     2.5  	/^|.*|/ {;	# If the line begin with "|" and has 2 or more "|"
     2.6  	 s,|$,,;				# Remove trailing "|" first
     2.7 +	 s,|\* *&gt;&gt;&gt;&gt;&gt;&gt;|\([^|]*\) *,<th colspan="7">\1</th>,g;
     2.8 +	 s,|\* *&gt;&gt;&gt;&gt;&gt;|\([^|]*\) *,<th colspan="6">\1</th>,g;
     2.9 +	 s,|\* *&gt;&gt;&gt;&gt;|\([^|]*\) *,<th colspan="5">\1</th>,g;
    2.10 +	 s,|\* *&gt;&gt;&gt;|\([^|]*\) *,<th colspan="4">\1</th>,g;
    2.11 +	 s,|\* *&gt;&gt;|\([^|]*\) *,<th colspan="3">\1</th>,g;
    2.12 +	 s,|\* *&gt;|\([^|]*\) *,<th colspan="2">\1</th>,g;
    2.13 +	 s,|\* *^^^^^^\([^|]*\) *,<th rowspan="7">\1</th>,g;
    2.14 +	 s,|\* *^^^^^\([^|]*\) *,<th rowspan="6">\1</th>,g;
    2.15 +	 s,|\* *^^^^\([^|]*\) *,<th rowspan="5">\1</th>,g;
    2.16 +	 s,|\* *^^^\([^|]*\) *,<th rowspan="4">\1</th>,g;
    2.17 +	 s,|\* *^^\([^|]*\) *,<th rowspan="3">\1</th>,g;
    2.18 +	 s,|\* *^\([^|]*\) *,<th rowspan="2">\1</th>,g;
    2.19  	 s,|\* *\([^|]*\) *,<th>\1</th>,g;	# "|*..." to "<th>...</th>"
    2.20 +	 s,| *&gt;&gt;&gt;&gt;&gt;&gt;|\([^|]*\) *,<td colspan="7">\1</td>,g;
    2.21 +	 s,| *&gt;&gt;&gt;&gt;&gt;|\([^|]*\) *,<td colspan="6">\1</td>,g;
    2.22 +	 s,| *&gt;&gt;&gt;&gt;|\([^|]*\) *,<td colspan="5">\1</td>,g;
    2.23 +	 s,| *&gt;&gt;&gt;|\([^|]*\) *,<td colspan="4">\1</td>,g;
    2.24 +	 s,| *&gt;&gt;|\([^|]*\) *,<td colspan="3">\1</td>,g;
    2.25 +	 s,| *&gt;|\([^|]*\) *,<td colspan="2">\1</td>,g;
    2.26 +	 s,| *^^^^^^\([^|]*\) *,<td rowspan="7">\1</td>,g;
    2.27 +	 s,| *^^^^^\([^|]*\) *,<td rowspan="6">\1</td>,g;
    2.28 +	 s,| *^^^^\([^|]*\) *,<td rowspan="5">\1</td>,g;
    2.29 +	 s,| *^^^\([^|]*\) *,<td rowspan="4">\1</td>,g;
    2.30 +	 s,| *^^\([^|]*\) *,<td rowspan="3">\1</td>,g;
    2.31 +	 s,| *^\([^|]*\) *,<td rowspan="2">\1</td>,g;
    2.32  	 s,| *\([^|]*\) *,<td>\1</td>,g;	# "|..."  to "<td>...</td>"
    2.33  	 s,^,<tr>,; s,$,</tr>,;		# Enclose with "<tr>" and "</tr>"
    2.34  	 H;				# Concat this line to HoldSpace