line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormatNroff; |
2
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
2798
|
use strict; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
241
|
|
4
|
7
|
|
|
7
|
|
31
|
use warnings; |
|
7
|
|
|
|
|
11
|
|
|
7
|
|
|
|
|
218
|
|
5
|
7
|
|
|
7
|
|
95
|
use 5.004; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
261
|
|
6
|
7
|
|
|
7
|
|
28
|
use parent 'HTML::Formatter'; |
|
7
|
|
|
|
|
7
|
|
|
7
|
|
|
|
|
44
|
|
7
|
|
|
|
|
|
|
|
8
|
7
|
|
|
7
|
|
33278
|
use HTML::FormatNroff::Table::Nroff; |
|
7
|
|
|
|
|
19
|
|
|
7
|
|
|
|
|
14184
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = 0.6; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub default_values { |
13
|
|
|
|
|
|
|
( |
14
|
7
|
|
|
7
|
0
|
344358
|
name => "", # man page name |
15
|
|
|
|
|
|
|
section => 1, # section of manual |
16
|
|
|
|
|
|
|
man_date => "", # date for section |
17
|
|
|
|
|
|
|
project => "", # name of project |
18
|
|
|
|
|
|
|
tables => [], |
19
|
|
|
|
|
|
|
fonts => [], |
20
|
|
|
|
|
|
|
current_table => undef, |
21
|
|
|
|
|
|
|
ignore => 0, |
22
|
|
|
|
|
|
|
man_header => 1, |
23
|
|
|
|
|
|
|
page_width => "6", |
24
|
|
|
|
|
|
|
divs => [], |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub dt_start { |
29
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
0
|
$self->vspace(1); |
32
|
0
|
|
|
|
|
0
|
$self->textout( "\n.ti +" . $self->{'lm'} . "\n " ); |
33
|
0
|
|
|
|
|
0
|
1; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub dd_start { |
37
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
0
|
$self->adjust_lm(+6); |
40
|
0
|
|
|
|
|
0
|
$self->vspace(0); |
41
|
0
|
|
|
|
|
0
|
$self->textout( "\n.ti +" . $self->{'lm'} . "\n " ); |
42
|
0
|
|
|
|
|
0
|
1; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub configure { |
46
|
7
|
|
|
7
|
1
|
79
|
my ( $self, $arg ) = @_; |
47
|
|
|
|
|
|
|
|
48
|
7
|
|
|
|
|
27
|
my $key; |
49
|
7
|
|
|
|
|
31
|
foreach $key ( keys %$arg ) { |
50
|
28
|
|
|
|
|
98
|
$self->{$key} = $$arg{$key}; |
51
|
|
|
|
|
|
|
} |
52
|
7
|
|
|
|
|
25
|
$self; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub begin { |
56
|
7
|
|
|
7
|
1
|
1338
|
my $self = shift; |
57
|
7
|
|
|
|
|
47
|
$self->HTML::Formatter::begin; |
58
|
7
|
|
|
|
|
201
|
$self->{lm} = 0; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub end { |
62
|
7
|
|
|
7
|
1
|
574
|
shift->collect("\n"); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub html_start { |
66
|
8
|
|
|
8
|
1
|
1247
|
my $self = shift; |
67
|
|
|
|
|
|
|
|
68
|
8
|
50
|
|
|
|
38
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
69
|
|
|
|
|
|
|
|
70
|
8
|
100
|
|
|
|
32
|
unless ( $self->{man_header} ) { return 1; } |
|
4
|
|
|
|
|
13
|
|
71
|
|
|
|
|
|
|
|
72
|
4
|
50
|
|
|
|
41
|
unless ( $self->{man_date} ) { |
73
|
0
|
|
|
|
|
0
|
my ( $sec, $min, $hr, $mday, $mon, $year, $wday, $yday, $isdst ) = |
74
|
|
|
|
|
|
|
localtime(); |
75
|
0
|
|
|
|
|
0
|
my $this_mon = ( |
76
|
|
|
|
|
|
|
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', |
77
|
|
|
|
|
|
|
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' |
78
|
|
|
|
|
|
|
)[$mon]; |
79
|
0
|
|
|
|
|
0
|
$self->{man_date} = "$mday" . " $this_mon" . " $year"; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
4
|
|
|
|
|
66
|
$self->out( ".TH \"" |
83
|
|
|
|
|
|
|
. $self->{name} . "\" \"" |
84
|
|
|
|
|
|
|
. $self->{section} . "\" \"" |
85
|
|
|
|
|
|
|
. $self->{man_date} . "\" \"" |
86
|
|
|
|
|
|
|
. $self->{project} |
87
|
|
|
|
|
|
|
. "\"" ); |
88
|
4
|
|
|
|
|
31
|
1; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub font_start { |
92
|
7
|
|
|
7
|
1
|
12
|
my ( $self, $font ) = @_; |
93
|
|
|
|
|
|
|
|
94
|
7
|
|
|
|
|
8
|
push( @{ $self->{'fonts'} }, $font ); |
|
7
|
|
|
|
|
15
|
|
95
|
|
|
|
|
|
|
|
96
|
7
|
|
|
|
|
27
|
$self->textout( '\f' . "$font" ); |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub font_end { |
100
|
7
|
|
|
7
|
1
|
14
|
my ($self) = @_; |
101
|
|
|
|
|
|
|
|
102
|
7
|
|
|
|
|
8
|
pop( @{ $self->{'fonts'} } ); |
|
7
|
|
|
|
|
13
|
|
103
|
|
|
|
|
|
|
|
104
|
7
|
|
|
|
|
8
|
my $font = pop( @{ $self->{'fonts'} } ); |
|
7
|
|
|
|
|
13
|
|
105
|
7
|
|
|
|
|
8
|
push( @{ $self->{'fonts'} }, $font ); |
|
7
|
|
|
|
|
12
|
|
106
|
|
|
|
|
|
|
|
107
|
7
|
50
|
|
|
|
21
|
unless ($font) { |
108
|
7
|
|
|
|
|
9
|
$font = 'R'; |
109
|
|
|
|
|
|
|
} |
110
|
7
|
|
|
|
|
20
|
$self->textout( '\f' . "$font" ); |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub i_start { |
114
|
1
|
|
|
1
|
1
|
25
|
my $self = shift; |
115
|
|
|
|
|
|
|
|
116
|
1
|
50
|
|
|
|
4
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
117
|
|
|
|
|
|
|
|
118
|
1
|
|
|
|
|
8
|
$self->font_start('I'); |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub i_end { |
122
|
1
|
|
|
1
|
1
|
28
|
my $self = shift; |
123
|
|
|
|
|
|
|
|
124
|
1
|
50
|
|
|
|
11
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
125
|
|
|
|
|
|
|
|
126
|
1
|
|
|
|
|
3
|
$self->font_end(); |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
sub b_start { |
130
|
2
|
|
|
2
|
1
|
60
|
my $self = shift; |
131
|
|
|
|
|
|
|
|
132
|
2
|
50
|
|
|
|
12
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
133
|
|
|
|
|
|
|
|
134
|
2
|
|
|
|
|
8
|
$self->font_start('B'); |
135
|
2
|
|
|
|
|
10
|
1; |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
sub b_end { |
139
|
2
|
|
|
2
|
1
|
57
|
my $self = shift; |
140
|
|
|
|
|
|
|
|
141
|
2
|
50
|
|
|
|
11
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
142
|
|
|
|
|
|
|
|
143
|
2
|
|
|
|
|
9
|
$self->font_end(); |
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
sub table_start { |
147
|
3
|
|
|
3
|
1
|
102
|
my ( $self, $node ) = @_; |
148
|
|
|
|
|
|
|
|
149
|
3
|
50
|
|
|
|
15
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
150
|
|
|
|
|
|
|
|
151
|
3
|
50
|
|
|
|
45
|
if ( defined( $self->{'current_table'} ) ) { |
152
|
0
|
|
|
|
|
0
|
push( @{ $self->{'tables'} }, $self->{'current_table'} ); |
|
0
|
|
|
|
|
0
|
|
153
|
|
|
|
|
|
|
} |
154
|
|
|
|
|
|
|
|
155
|
3
|
|
|
|
|
12
|
my %attr = ( page_width => $self->{'page_width'}, ); |
156
|
|
|
|
|
|
|
|
157
|
3
|
|
|
|
|
8
|
for (qw{align width}) { |
158
|
6
|
50
|
|
|
|
71
|
$attr{$_} = lc( $node->attr('$_') ) if defined $node->attr('$_'); |
159
|
|
|
|
|
|
|
} |
160
|
|
|
|
|
|
|
|
161
|
3
|
100
|
|
|
|
41
|
unless ( $node->attr('align') ) { |
162
|
2
|
50
|
|
|
|
22
|
if ( $self->{'center'} ) { |
163
|
0
|
|
|
|
|
0
|
$attr{align} = 'center'; |
164
|
|
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
} |
166
|
|
|
|
|
|
|
|
167
|
3
|
|
|
|
|
66
|
$self->{'current_table'} = HTML::FormatNroff::Table::Nroff->new( $self, %attr ); |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
sub tr_start { |
171
|
7
|
|
|
7
|
1
|
196
|
my ( $self, $node ) = @_; |
172
|
|
|
|
|
|
|
|
173
|
7
|
50
|
|
|
|
24
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
174
|
|
|
|
|
|
|
|
175
|
7
|
|
|
|
|
11
|
my %attr = (); |
176
|
|
|
|
|
|
|
|
177
|
7
|
|
|
|
|
16
|
for (qw{align width}) { |
178
|
14
|
50
|
|
|
|
94
|
$attr{$_} = lc( $node->attr('$_') ) if defined $node->attr('$_'); |
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
|
181
|
7
|
|
|
|
|
84
|
$self->{'current_table'}->add_row(%attr); |
182
|
|
|
|
|
|
|
} |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
sub tr_end { |
185
|
7
|
|
|
7
|
1
|
195
|
my ($self) = @_; |
186
|
|
|
|
|
|
|
} |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
sub a_start { |
189
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
190
|
|
|
|
|
|
|
} |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
sub a_end { |
193
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
sub td_start { |
197
|
9
|
|
|
9
|
1
|
259
|
my ( $self, $node ) = @_; |
198
|
|
|
|
|
|
|
|
199
|
9
|
50
|
|
|
|
31
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
200
|
|
|
|
|
|
|
|
201
|
9
|
|
|
|
|
28
|
$self->start_data($node); |
202
|
|
|
|
|
|
|
} |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
sub td_end { |
205
|
9
|
|
|
9
|
1
|
288
|
my $self = shift; |
206
|
|
|
|
|
|
|
|
207
|
9
|
50
|
|
|
|
30
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
208
|
|
|
|
|
|
|
|
209
|
9
|
|
|
|
|
37
|
$self->{'current_table'}->end_data(); |
210
|
|
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
sub th_start { |
213
|
4
|
|
|
4
|
1
|
135
|
my ( $self, $node ) = @_; |
214
|
|
|
|
|
|
|
|
215
|
4
|
50
|
|
|
|
28
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
216
|
|
|
|
|
|
|
|
217
|
4
|
|
|
|
|
17
|
$self->start_data( $node, 'header' ); |
218
|
|
|
|
|
|
|
} |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
# internal helping routine for processing table cells |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
sub start_data { |
223
|
13
|
|
|
13
|
0
|
16
|
my ( $self, $node, $header ) = @_; |
224
|
|
|
|
|
|
|
|
225
|
13
|
50
|
|
|
|
29
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
226
|
|
|
|
|
|
|
|
227
|
13
|
|
|
|
|
32
|
my %attr = ( header => $header, ); |
228
|
|
|
|
|
|
|
|
229
|
13
|
|
|
|
|
31
|
for (qw{align valign nowrap rowspan colspan}) { |
230
|
65
|
50
|
|
|
|
522
|
$attr{$_} = lc( $node->attr('$_') ) if defined $node->attr('$_'); |
231
|
|
|
|
|
|
|
} |
232
|
|
|
|
|
|
|
|
233
|
13
|
|
|
|
|
203
|
$self->{'current_table'}->start_data(%attr); |
234
|
|
|
|
|
|
|
} |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
sub th_end { |
237
|
4
|
|
|
4
|
1
|
179
|
my $self = shift; |
238
|
|
|
|
|
|
|
|
239
|
4
|
50
|
|
|
|
15
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
240
|
|
|
|
|
|
|
|
241
|
4
|
|
|
|
|
37
|
$self->{'current_table'}->end_data(); |
242
|
|
|
|
|
|
|
} |
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
sub table_end { |
245
|
3
|
|
|
3
|
1
|
134
|
my $self = shift; |
246
|
|
|
|
|
|
|
|
247
|
3
|
50
|
|
|
|
14
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
248
|
|
|
|
|
|
|
|
249
|
3
|
|
|
|
|
23
|
$self->{'current_table'}->output(); |
250
|
3
|
|
|
|
|
19
|
$self->{'current_table'} = pop( @{ $self->{'tables'} } ); |
|
3
|
|
|
|
|
17
|
|
251
|
|
|
|
|
|
|
} |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
sub p_start { |
254
|
1
|
|
|
1
|
1
|
24
|
my $self = shift; |
255
|
|
|
|
|
|
|
|
256
|
1
|
50
|
|
|
|
3
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
257
|
|
|
|
|
|
|
|
258
|
1
|
|
|
|
|
3
|
$self->textout("\n.PP\n"); |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
} |
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
sub p_end { |
263
|
1
|
|
|
1
|
1
|
37
|
my $self = shift; |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
} |
266
|
|
|
|
|
|
|
|
267
|
0
|
|
|
0
|
1
|
0
|
sub goto_lm { |
268
|
|
|
|
|
|
|
} |
269
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
sub br_start { |
271
|
1
|
|
|
1
|
1
|
27
|
my $self = shift; |
272
|
|
|
|
|
|
|
|
273
|
1
|
50
|
|
|
|
9
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
274
|
|
|
|
|
|
|
|
275
|
1
|
|
|
|
|
2
|
$self->textout("\n.br\n"); |
276
|
|
|
|
|
|
|
} |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
sub hr_start { |
279
|
2
|
|
|
2
|
1
|
193
|
my $self = shift; |
280
|
|
|
|
|
|
|
|
281
|
2
|
50
|
|
|
|
12
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
282
|
|
|
|
|
|
|
|
283
|
2
|
|
|
|
|
6
|
$self->textout("\n.br\n.ta 6.5i\n.tc _\n\t\n.br\n"); |
284
|
|
|
|
|
|
|
} |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
sub header_start { |
287
|
2
|
|
|
2
|
1
|
195
|
my ( $self, $level, $node ) = @_; |
288
|
|
|
|
|
|
|
|
289
|
2
|
50
|
|
|
|
13
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
290
|
|
|
|
|
|
|
|
291
|
2
|
|
|
|
|
12
|
$self->textout("\n.SH "); |
292
|
2
|
|
|
|
|
20
|
1; |
293
|
|
|
|
|
|
|
} |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
sub header_end { |
296
|
2
|
|
|
2
|
1
|
101
|
my ( $self, $level, $node ) = @_; |
297
|
|
|
|
|
|
|
|
298
|
2
|
50
|
|
|
|
9
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
299
|
|
|
|
|
|
|
|
300
|
2
|
|
|
|
|
7
|
$self->textout("\n"); |
301
|
2
|
|
|
|
|
12
|
1; |
302
|
|
|
|
|
|
|
} |
303
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
sub out { |
305
|
269
|
|
|
269
|
1
|
1162
|
my $self = shift; |
306
|
269
|
|
|
|
|
228
|
my $text = shift; |
307
|
|
|
|
|
|
|
|
308
|
269
|
50
|
|
|
|
458
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
309
|
|
|
|
|
|
|
|
310
|
269
|
100
|
|
|
|
436
|
if ( defined $self->{vspace} ) { |
311
|
4
|
|
|
|
|
10
|
$self->nl( $self->{vspace} ); |
312
|
4
|
|
|
|
|
5
|
$self->{vspace} = undef; |
313
|
|
|
|
|
|
|
} |
314
|
|
|
|
|
|
|
|
315
|
269
|
50
|
|
|
|
392
|
if ($text) { |
316
|
269
|
|
|
|
|
467
|
$self->collect($text); |
317
|
|
|
|
|
|
|
} |
318
|
|
|
|
|
|
|
} |
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
sub pre_out { |
321
|
0
|
|
|
0
|
1
|
0
|
my ( $self, $pre ) = @_; |
322
|
|
|
|
|
|
|
|
323
|
0
|
0
|
|
|
|
0
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
324
|
|
|
|
|
|
|
|
325
|
0
|
0
|
|
|
|
0
|
if ( defined $self->{vspace} ) { |
326
|
0
|
|
|
|
|
0
|
$self->nl( $self->{vspace} ); |
327
|
0
|
|
|
|
|
0
|
$self->{vspace} = undef; |
328
|
|
|
|
|
|
|
} |
329
|
0
|
|
|
|
|
0
|
my $indent = ' ' x $self->{lm}; |
330
|
0
|
|
|
|
|
0
|
$pre =~ s/^/$indent/mg; |
331
|
0
|
|
|
|
|
0
|
$self->collect($pre); |
332
|
0
|
|
|
|
|
0
|
$self->{'out'}++; |
333
|
|
|
|
|
|
|
} |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
sub nl { |
336
|
4
|
|
|
4
|
1
|
4
|
my ( $self, $cnt ) = @_; |
337
|
|
|
|
|
|
|
|
338
|
4
|
50
|
|
|
|
7
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
339
|
|
|
|
|
|
|
|
340
|
4
|
|
|
|
|
10
|
$self->collect("\n.sp $cnt\n"); |
341
|
4
|
|
|
|
|
15
|
$self->{'out'}++; |
342
|
|
|
|
|
|
|
} |
343
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
sub adjust_lm { |
345
|
8
|
|
|
8
|
1
|
194
|
my ( $self, $indent ) = @_; |
346
|
|
|
|
|
|
|
|
347
|
8
|
|
|
|
|
18
|
$self->{lm} += $indent; |
348
|
|
|
|
|
|
|
} |
349
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
sub adjust_rm { |
351
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
352
|
|
|
|
|
|
|
} |
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
sub bullet { |
355
|
3
|
|
|
3
|
1
|
89
|
my ( $self, $tag ) = @_; |
356
|
|
|
|
|
|
|
|
357
|
3
|
50
|
|
|
|
9
|
if ( $self->{'lm'} > 0 ) { |
358
|
3
|
|
|
|
|
17
|
$self->textout( "\n.ti +" . $self->{'lm'} . "\n$tag " ); |
359
|
|
|
|
|
|
|
} |
360
|
|
|
|
|
|
|
} |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
sub textflow { |
363
|
43
|
|
|
43
|
1
|
1395
|
my ( $self, $node ) = @_; |
364
|
|
|
|
|
|
|
|
365
|
43
|
50
|
|
|
|
105
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
366
|
|
|
|
|
|
|
|
367
|
43
|
100
|
100
|
|
|
186
|
if ( ( !defined( $self->{'current_table'} ) ) |
368
|
|
|
|
|
|
|
and $self->{'center'} ) { |
369
|
3
|
|
|
|
|
11
|
$self->textout("\n.ce\n"); |
370
|
|
|
|
|
|
|
} |
371
|
43
|
100
|
|
|
|
103
|
if ( $self->{'underline'} ) { |
372
|
1
|
|
|
|
|
2
|
$self->textout("\n.ul\n"); |
373
|
|
|
|
|
|
|
} |
374
|
|
|
|
|
|
|
|
375
|
43
|
100
|
|
|
|
93
|
if ( $self->{'lm'} > 0 ) { |
376
|
6
|
|
|
|
|
8
|
my $repl = "\n.ti +" . $self->{'lm'} . "\n "; |
377
|
6
|
|
|
|
|
8
|
$node =~ s/\n/$repl/; |
378
|
|
|
|
|
|
|
} |
379
|
|
|
|
|
|
|
|
380
|
43
|
100
|
|
|
|
81
|
if ( defined( $self->{'current_table'} ) ) { |
381
|
|
|
|
|
|
|
|
382
|
16
|
100
|
|
|
|
55
|
$self->{'current_table'}->add_text($node) |
383
|
|
|
|
|
|
|
or $self->SUPER::textflow($node); |
384
|
|
|
|
|
|
|
} |
385
|
|
|
|
|
|
|
else { |
386
|
27
|
|
|
|
|
114
|
$self->SUPER::textflow($node); |
387
|
|
|
|
|
|
|
} |
388
|
|
|
|
|
|
|
} |
389
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
sub textout { |
391
|
29
|
|
|
29
|
0
|
36
|
my ( $self, $text ) = @_; |
392
|
|
|
|
|
|
|
|
393
|
29
|
50
|
|
|
|
54
|
if ( $self->{ignore} ) { return 1; } |
|
0
|
|
|
|
|
0
|
|
394
|
|
|
|
|
|
|
|
395
|
29
|
100
|
|
|
|
61
|
if ( defined( $self->{'current_table'} ) ) { |
396
|
8
|
50
|
|
|
|
20
|
$self->{'current_table'}->add_text($text) |
397
|
|
|
|
|
|
|
|| $self->out($text); |
398
|
|
|
|
|
|
|
} |
399
|
|
|
|
|
|
|
else { |
400
|
21
|
|
|
|
|
37
|
$self->out($text); |
401
|
|
|
|
|
|
|
} |
402
|
|
|
|
|
|
|
} |
403
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
sub blockquote_start { |
405
|
0
|
|
|
0
|
1
|
|
my ( $self, $node ) = @_; |
406
|
|
|
|
|
|
|
|
407
|
0
|
|
|
|
|
|
$self->textout("\n.PP\n.in +5\n"); |
408
|
|
|
|
|
|
|
} |
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
sub blockquote_end { |
411
|
0
|
|
|
0
|
1
|
|
my ( $self, $node ) = @_; |
412
|
|
|
|
|
|
|
|
413
|
0
|
|
|
|
|
|
$self->textout("\n.in -5\n.PP\n"); |
414
|
|
|
|
|
|
|
} |
415
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
# all the push/pop is so we can safely ignore nested divs. |
417
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
sub div_start { |
419
|
0
|
|
|
0
|
1
|
|
my ( $self, $node ) = @_; |
420
|
|
|
|
|
|
|
|
421
|
0
|
|
|
|
|
|
my $type = lc $node->attr('type'); |
422
|
|
|
|
|
|
|
|
423
|
0
|
|
|
|
|
|
push( @{ $self->{'divs'} }, $type ); |
|
0
|
|
|
|
|
|
|
424
|
|
|
|
|
|
|
|
425
|
0
|
0
|
|
|
|
|
if ( $type =~ /nroff_ignore/ ) { |
426
|
0
|
|
|
|
|
|
$self->{'ignore'} = 1; |
427
|
|
|
|
|
|
|
} |
428
|
|
|
|
|
|
|
} |
429
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
sub div_end { |
431
|
0
|
|
|
0
|
0
|
|
my ( $self, $node ) = @_; |
432
|
|
|
|
|
|
|
|
433
|
0
|
|
|
|
|
|
my $type = pop( @{ $self->{'divs'} } ); |
|
0
|
|
|
|
|
|
|
434
|
|
|
|
|
|
|
|
435
|
0
|
0
|
|
|
|
|
if ( $type =~ /nroff_ignore/ ) { |
436
|
0
|
|
|
|
|
|
$self->{ignore} = 0; |
437
|
|
|
|
|
|
|
} |
438
|
|
|
|
|
|
|
} |
439
|
|
|
|
|
|
|
|
440
|
|
|
|
|
|
|
sub meta_start { |
441
|
0
|
|
|
0
|
1
|
|
my ( $self, $node ) = @_; |
442
|
|
|
|
|
|
|
|
443
|
0
|
|
|
|
|
|
my $meta_name = lc $node->attr('NAME'); |
444
|
0
|
0
|
|
|
|
|
unless ( $meta_name eq 'nroff-control' ) { |
445
|
0
|
|
|
|
|
|
return 1; |
446
|
|
|
|
|
|
|
} |
447
|
0
|
|
|
|
|
|
my $meta_content = lc $node->attr('CONTENT'); |
448
|
|
|
|
|
|
|
|
449
|
0
|
0
|
|
|
|
|
if ( $meta_content eq 'ignore_start' ) { |
450
|
0
|
|
|
|
|
|
$self->{'ignore'} = 1; |
451
|
|
|
|
|
|
|
} |
452
|
|
|
|
|
|
|
else { |
453
|
0
|
|
|
|
|
|
$self->{'ignore'} = 0; |
454
|
|
|
|
|
|
|
} |
455
|
|
|
|
|
|
|
} |
456
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
1; |
458
|
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
__END__ |