1 | #!/usr/bin/perl -p |
1 | #!/usr/bin/perl |
2 | |
2 | |
3 | use Pod::Tree; |
3 | use Pod::Tree; |
4 | |
4 | |
5 | sub escape_texi($) { |
5 | sub escape_texi($) { |
6 | local $_ = shift; |
6 | local $_ = shift; |
… | |
… | |
11 | |
11 | |
12 | sub example { |
12 | sub example { |
13 | my $text = $_[0]; |
13 | my $text = $_[0]; |
14 | print "\n\n\@example\n"; |
14 | print "\n\n\@example\n"; |
15 | $text =~ s/\n+$//; |
15 | $text =~ s/\n+$//; |
16 | $text =~ s/([\@\{\}])/@$1/g; |
16 | $text =~ s/([\@\{\}])/\@$1/g; |
17 | print $text; |
17 | print $text; |
18 | print "\n\@end example\n\n"; |
18 | print "\n\@end example\n\n"; |
19 | } |
19 | } |
20 | |
20 | |
21 | while (<>) { |
21 | while (<>) { |
… | |
… | |
68 | # S would mean to use nbsp |
68 | # S would mean to use nbsp |
69 | $walker->($_) for @{$n->get_children}; |
69 | $walker->($_) for @{$n->get_children}; |
70 | } |
70 | } |
71 | } elsif ($n->is_command) { |
71 | } elsif ($n->is_command) { |
72 | if ($n->is_c_head1) { |
72 | if ($n->is_c_head1) { |
73 | print "\n\@subsection "; |
73 | print "\n\@section "; |
74 | $walker->($_) for @{$n->get_children}; |
74 | $walker->($_) for @{$n->get_children}; |
75 | print "\n"; |
75 | print "\n"; |
76 | } elsif ($n->is_c_head2) { |
76 | } elsif ($n->is_c_head2) { |
77 | print "\n\n\@subsubsection "; |
77 | print "\n\n\@subsection "; |
78 | $walker->($_) for @{$n->get_children}; |
78 | $walker->($_) for @{$n->get_children}; |
79 | print "\n"; |
79 | print "\n"; |
80 | } else { |
80 | } else { |
81 | # nop? |
81 | # nop? |
82 | } |
82 | } |