changeset 1038:b8b1b8356b94 draft

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 wrap: on
line diff
--- a/s4-blog.sh	Wed Mar 06 09:55:20 2024 +0900
+++ b/s4-blog.sh	Sat Apr 06 18:03:05 2024 +0900
@@ -609,6 +609,8 @@
 行頭: ## 大見出し, ### 中見出し, #### 小見出し
 行末の2連続スペースまたは ;;; で強制改行(<br>)
 |*見出し列|列2|列3…  と行頭から始まる縦棒区切り行を続けて表
+|*>| でrowspan=\"2\"のカラム、>>で3,>>>で4……、 *なしで td rowspan
+|*^ でcolspan=\"2\"のカラム、^^で3,^^^で4……、 *なしで td colspan
 「 *語群* 」で強調(両側の空白必要、** でもっと強調。*の代わりに _ でも可)
 「~~文~~」 で「文」の部分に打ち消し線。
 - [ ] と - [x] でチェックボックス"
--- a/s4-funcs.sh	Wed Mar 06 09:55:20 2024 +0900
+++ b/s4-funcs.sh	Sat Apr 06 18:03:05 2024 +0900
@@ -693,7 +693,31 @@
   sed -n '
 	/^|.*|/ {;	# If the line begin with "|" and has 2 or more "|"
 	 s,|$,,;				# Remove trailing "|" first
+	 s,|\* *&gt;&gt;&gt;&gt;&gt;&gt;|\([^|]*\) *,<th colspan="7">\1</th>,g;
+	 s,|\* *&gt;&gt;&gt;&gt;&gt;|\([^|]*\) *,<th colspan="6">\1</th>,g;
+	 s,|\* *&gt;&gt;&gt;&gt;|\([^|]*\) *,<th colspan="5">\1</th>,g;
+	 s,|\* *&gt;&gt;&gt;|\([^|]*\) *,<th colspan="4">\1</th>,g;
+	 s,|\* *&gt;&gt;|\([^|]*\) *,<th colspan="3">\1</th>,g;
+	 s,|\* *&gt;|\([^|]*\) *,<th colspan="2">\1</th>,g;
+	 s,|\* *^^^^^^\([^|]*\) *,<th rowspan="7">\1</th>,g;
+	 s,|\* *^^^^^\([^|]*\) *,<th rowspan="6">\1</th>,g;
+	 s,|\* *^^^^\([^|]*\) *,<th rowspan="5">\1</th>,g;
+	 s,|\* *^^^\([^|]*\) *,<th rowspan="4">\1</th>,g;
+	 s,|\* *^^\([^|]*\) *,<th rowspan="3">\1</th>,g;
+	 s,|\* *^\([^|]*\) *,<th rowspan="2">\1</th>,g;
 	 s,|\* *\([^|]*\) *,<th>\1</th>,g;	# "|*..." to "<th>...</th>"
+	 s,| *&gt;&gt;&gt;&gt;&gt;&gt;|\([^|]*\) *,<td colspan="7">\1</td>,g;
+	 s,| *&gt;&gt;&gt;&gt;&gt;|\([^|]*\) *,<td colspan="6">\1</td>,g;
+	 s,| *&gt;&gt;&gt;&gt;|\([^|]*\) *,<td colspan="5">\1</td>,g;
+	 s,| *&gt;&gt;&gt;|\([^|]*\) *,<td colspan="4">\1</td>,g;
+	 s,| *&gt;&gt;|\([^|]*\) *,<td colspan="3">\1</td>,g;
+	 s,| *&gt;|\([^|]*\) *,<td colspan="2">\1</td>,g;
+	 s,| *^^^^^^\([^|]*\) *,<td rowspan="7">\1</td>,g;
+	 s,| *^^^^^\([^|]*\) *,<td rowspan="6">\1</td>,g;
+	 s,| *^^^^\([^|]*\) *,<td rowspan="5">\1</td>,g;
+	 s,| *^^^\([^|]*\) *,<td rowspan="4">\1</td>,g;
+	 s,| *^^\([^|]*\) *,<td rowspan="3">\1</td>,g;
+	 s,| *^\([^|]*\) *,<td rowspan="2">\1</td>,g;
 	 s,| *\([^|]*\) *,<td>\1</td>,g;	# "|..."  to "<td>...</td>"
 	 s,^,<tr>,; s,$,</tr>,;		# Enclose with "<tr>" and "</tr>"
 	 H;				# Concat this line to HoldSpace

yatex.org