s4

diff s4-funcs.sh @ 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 ae88ca565d08
children 78e904f9be34
line diff
     1.1 --- a/s4-funcs.sh	Thu Dec 28 11:27:06 2023 +0900
     1.2 +++ b/s4-funcs.sh	Sat Apr 06 18:03:05 2024 +0900
     1.3 @@ -693,7 +693,31 @@
     1.4    sed -n '
     1.5  	/^|.*|/ {;	# If the line begin with "|" and has 2 or more "|"
     1.6  	 s,|$,,;				# Remove trailing "|" first
     1.7 +	 s,|\* *&gt;&gt;&gt;&gt;&gt;&gt;|\([^|]*\) *,<th colspan="7">\1</th>,g;
     1.8 +	 s,|\* *&gt;&gt;&gt;&gt;&gt;|\([^|]*\) *,<th colspan="6">\1</th>,g;
     1.9 +	 s,|\* *&gt;&gt;&gt;&gt;|\([^|]*\) *,<th colspan="5">\1</th>,g;
    1.10 +	 s,|\* *&gt;&gt;&gt;|\([^|]*\) *,<th colspan="4">\1</th>,g;
    1.11 +	 s,|\* *&gt;&gt;|\([^|]*\) *,<th colspan="3">\1</th>,g;
    1.12 +	 s,|\* *&gt;|\([^|]*\) *,<th colspan="2">\1</th>,g;
    1.13 +	 s,|\* *^^^^^^\([^|]*\) *,<th rowspan="7">\1</th>,g;
    1.14 +	 s,|\* *^^^^^\([^|]*\) *,<th rowspan="6">\1</th>,g;
    1.15 +	 s,|\* *^^^^\([^|]*\) *,<th rowspan="5">\1</th>,g;
    1.16 +	 s,|\* *^^^\([^|]*\) *,<th rowspan="4">\1</th>,g;
    1.17 +	 s,|\* *^^\([^|]*\) *,<th rowspan="3">\1</th>,g;
    1.18 +	 s,|\* *^\([^|]*\) *,<th rowspan="2">\1</th>,g;
    1.19  	 s,|\* *\([^|]*\) *,<th>\1</th>,g;	# "|*..." to "<th>...</th>"
    1.20 +	 s,| *&gt;&gt;&gt;&gt;&gt;&gt;|\([^|]*\) *,<td colspan="7">\1</td>,g;
    1.21 +	 s,| *&gt;&gt;&gt;&gt;&gt;|\([^|]*\) *,<td colspan="6">\1</td>,g;
    1.22 +	 s,| *&gt;&gt;&gt;&gt;|\([^|]*\) *,<td colspan="5">\1</td>,g;
    1.23 +	 s,| *&gt;&gt;&gt;|\([^|]*\) *,<td colspan="4">\1</td>,g;
    1.24 +	 s,| *&gt;&gt;|\([^|]*\) *,<td colspan="3">\1</td>,g;
    1.25 +	 s,| *&gt;|\([^|]*\) *,<td colspan="2">\1</td>,g;
    1.26 +	 s,| *^^^^^^\([^|]*\) *,<td rowspan="7">\1</td>,g;
    1.27 +	 s,| *^^^^^\([^|]*\) *,<td rowspan="6">\1</td>,g;
    1.28 +	 s,| *^^^^\([^|]*\) *,<td rowspan="5">\1</td>,g;
    1.29 +	 s,| *^^^\([^|]*\) *,<td rowspan="4">\1</td>,g;
    1.30 +	 s,| *^^\([^|]*\) *,<td rowspan="3">\1</td>,g;
    1.31 +	 s,| *^\([^|]*\) *,<td rowspan="2">\1</td>,g;
    1.32  	 s,| *\([^|]*\) *,<td>\1</td>,g;	# "|..."  to "<td>...</td>"
    1.33  	 s,^,<tr>,; s,$,</tr>,;		# Enclose with "<tr>" and "</tr>"
    1.34  	 H;				# Concat this line to HoldSpace