-
Notifications
You must be signed in to change notification settings - Fork 0
/
htbl.tes
executable file
·116 lines (105 loc) · 3.22 KB
/
htbl.tes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/usr/local/bin/sciteco -m
!* htbl.tes <input> <output> *!
!* Troff tbl "drop-in" replacement *!
0,2EJ !* FIXME: Memory limiting is too slow *!
LR 0X#in 2LR 0X#ou EBN#in EB -EF
<
!*
* <table> will implicitly close <p>'s so we must recalculate the margin.
* we do this using the same formula as <p> indentions are calculated by post-grohtml
* except for the line-length which is apparently always 6.5i (the default)
*!
FS.TS.nr tbl-margin ((\n[.in]+\n[.o])*100+(6.5i/2))/6.5i-((6.5i/2)/6.5i)
.nr tbl-width 100-\n[tbl-margin]
.HTML <table class="tbl" style="margin-left:\n[tbl-margin]%";
9U.[tab]
L.U.f L.-1U.t I^J
Q.f,Q.t:Sbox"S
L I border="1" frame="box"
Q.f,Q.t:Sallbox"S
L I rules="all"
|
I rules="none"
'
'
Q.f,Q.t:Sexpand"S L I width="\n[tbl-width]%" '
Q.f,Q.t:Stab("S 0AU.[tab] '
Q.fJ K-D LR I> L
1u.[row] 1u.[col]
@.r{
.[format.\.[row].\.[col].align] 0U.[format.\.[row].\.[col].bold] 0U.[format.\.[row].\.[col].italic]
1U.[format.\.[row].\.[col].rowspan] 1U.[format.\.[row].\.[col].colspan]
0U.[format.\.[row].hsep]
} :M.r
<
0a-L"=.[format.\.[row].\.[col].align]left'
0a-C"=.[format.\.[row].\.[col].align]center'
0a-R"=.[format.\.[row].\.[col].align]right'
0a-B"=1U.[format.\.[row].\.[col].bold]'
0a-I"=1U.[format.\.[row].\.[col].italic]'
0a- "=%.[col] :M.r'
0a-,"=%.[row] 1u.[col] :M.r' 0a-10"=%.[row] 1u.[col] :M.r'
0a-."=1;'
D>
k q.[row]u.[frows] q.[col]u.[fcols] 1u.[row] 1u.[col] .u.#bd
<
Q.[row]-Q.[frows]">
EU.[format.\.[row].\.[col].align]Q.[format.\.[frows].\.[col].align]
Q.[format.\.[frows].\.[col].bold]U.[format.\.[row].\.[col].bold]
Q.[format.\.[frows].\.[col].italic]U.[format.\.[row].\.[col].italic]
Q.[format.\.[frows].\.[col].rowspan]U.[format.\.[row].\.[col].rowspan]
Q.[format.\.[frows].\.[col].colspan]U.[format.\.[row].\.[col].colspan]
:Q.[format.\.[row].hsep]"<
0U.[format.\.[row].hsep]
'
'
.-1,.+2:S^J=^J"S 1U.[format.\.[row].hsep] '
.,.+3:ST{^J"S
.,S^JT}.-3X.[data.\.[row].\.[col]] C 1
|
.,.+2:S\^^"S
0U.[format.\.[row].\.[col].rowspan]
Q.[row]-1U.#cr
<Q.[format.\.#cr.\.[col].rowspan]">1;' -%.#cr>
%.[format.\.#cr.\.[col].rowspan]
'
.U.f S[U.[tab],^J]
Q.f,.-1X.[data.\.[row].\.[col]] 0
'
U.[data.\.[row].\.[col].block]
-A-Q.[tab]"=
%.[col]
|
%.[row] 1U.[col] .,.+4:S.TE^J"S1;'
'
>
q.#bd,.D
q.[row]-1u.[drows] 1u.[row]
q.[drows]<
I.HTML <tr>^J
1u.[col]
q.[fcols]<
Q.[format.\.[row].\.[col].rowspan]">
I.HTML <td rowspan="\.[format.\.[row].\.[col].rowspan]" colspan="\.[format.\.[row].\.[col].colspan]"
I style="border-top:\.[format.\.[row].hsep]px solid"
q.[data.\.[row].\.[col].block]"=
I align="Q.[format.\.[row].\.[col].align]">
Q.[format.\.[row].\.[col].bold]"N I<b> '
Q.[format.\.[row].\.[col].italic]"N I<i> '
G.[data.\.[row].\.[col]]
Q.[format.\.[row].\.[col].bold]"N I</b> '
Q.[format.\.[row].\.[col].italic]"N I</i> '
I</td>^J
|
I>^J
G.[data.\.[row].\.[col]]
I^J.HTML </td>^J
'
'
%.[col]>
I.HTML </tr>^J
%.[row]>
I.HTML </table>^J
>
EWQ#ou
EX