line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
############################################################################# |
2
|
|
|
|
|
|
|
# (c) by Tels 2004. Part of Convert::Wiki |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# represents a headline node |
5
|
|
|
|
|
|
|
############################################################################# |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package Convert::Wiki::Node::Head; |
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
30073
|
use 5.006001; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
145
|
|
10
|
4
|
|
|
4
|
|
22
|
use strict; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
139
|
|
11
|
4
|
|
|
4
|
|
21
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
164
|
|
12
|
|
|
|
|
|
|
|
13
|
4
|
|
|
4
|
|
326
|
use Convert::Wiki::Node; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
111
|
|
14
|
|
|
|
|
|
|
|
15
|
4
|
|
|
4
|
|
21
|
use vars qw/$VERSION @ISA/; |
|
4
|
|
|
|
|
15
|
|
|
4
|
|
|
|
|
1023
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
@ISA = qw/Convert::Wiki::Node/; |
18
|
|
|
|
|
|
|
$VERSION = '0.04'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
############################################################################# |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _init |
23
|
|
|
|
|
|
|
{ |
24
|
17
|
|
|
17
|
|
30
|
my ($self,$args) = @_; |
25
|
|
|
|
|
|
|
|
26
|
17
|
|
50
|
|
|
676
|
$self->{level} ||= 1; |
27
|
|
|
|
|
|
|
|
28
|
17
|
|
|
|
|
74
|
$self->SUPER::_init($args); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub _as_wiki |
32
|
|
|
|
|
|
|
{ |
33
|
15
|
|
|
15
|
|
24
|
my ($self,$txt) = @_; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# if we are the first headline, we get level 1 |
36
|
15
|
100
|
|
|
|
57
|
if (!defined $self->prev_by_type('head')) |
37
|
|
|
|
|
|
|
{ |
38
|
9
|
|
|
|
|
19
|
$self->{level} = 1; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
# if we follow right on another headline, take it's level plus 1 |
41
|
15
|
|
|
|
|
57
|
my $prev = $self->prev(); |
42
|
15
|
100
|
100
|
|
|
66
|
if (defined $prev && $prev->type() eq 'head') |
43
|
|
|
|
|
|
|
{ |
44
|
2
|
|
|
|
|
5
|
$self->{level} = $prev->{level} + 1; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
15
|
|
|
|
|
47
|
my $p = '=' x ($self->{level} + 1); # level 1: == |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# "== Foo ==\n\n" |
50
|
15
|
|
|
|
|
76
|
$p . ' ' . $txt . ' ' . $p . "\n\n"; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
__END__ |