1 | #!/usr/bin/perl |
1 | #!/usr/bin/perl |
2 | |
2 | |
3 | # TODO: texinfo fails on @cinde xin title elements etc. *sigh* |
3 | # TODO: texinfo fails on @cindex in title elements etc. *sigh* |
4 | |
4 | |
5 | use Pod::POM; |
5 | use Pod::POM; |
6 | |
6 | |
7 | sub escape_texi($) { |
7 | sub escape_texi($) { |
8 | local $_ = shift; |
8 | local $_ = shift; |
… | |
… | |
27 | sub out { |
27 | sub out { |
28 | $ctx[-1]{out} .= join "", @_; |
28 | $ctx[-1]{out} .= join "", @_; |
29 | } |
29 | } |
30 | |
30 | |
31 | sub TEX::view_seq_code { "\@t{$_[1]}" } |
31 | sub TEX::view_seq_code { "\@t{$_[1]}" } |
|
|
32 | sub TEX::view_seq_file { "\@file{$_[1]}" } |
32 | sub TEX::view_seq_bold { "\@strong{$_[1]}" } |
33 | sub TEX::view_seq_bold { "\@strong{$_[1]}" } |
33 | sub TEX::view_seq_italic { "\@emph{$_[1]}" } |
34 | sub TEX::view_seq_italic { "\@emph{$_[1]}" } |
34 | |
35 | |
35 | sub TEX::view_seq_space { escape_texi $_[1] } |
36 | sub TEX::view_seq_space { escape_texi $_[1] } |
36 | sub TEX::view_seq_text { escape_texi $_[1] } |
37 | sub TEX::view_seq_text { escape_texi $_[1] } |
… | |
… | |
92 | out "\n\n\@itemize\n"; |
93 | out "\n\n\@itemize\n"; |
93 | $walker->($_) for $n->content; |
94 | $walker->($_) for $n->content; |
94 | out "\@end itemize\n\n"; |
95 | out "\@end itemize\n\n"; |
95 | |
96 | |
96 | } elsif ($t eq "item") { |
97 | } elsif ($t eq "item") { |
97 | out "\n\n\@item\n\@b{" . $n->title . "}\n\n"; |
98 | out "\n\n\@item\n" . $n->title . "\n\n"; |
98 | |
99 | |
99 | if ($n->title->present (TXT::) =~ /^\s*([a-zA-Z0-9\-\_]+)\s*=/) { |
100 | if ($n->title->present (TXT::) =~ /^\s*([a-zA-Z0-9\-\_]+)\s*=/) { |
100 | out "\@cindex $1\n"; |
101 | out "\@cindex $1\n"; |
101 | } |
102 | } |
102 | $walker->($_) for $n->content; |
103 | $walker->($_) for $n->content; |