Added entries about removal of some bare except clauses from logging.
[python.git] / Doc / perl / ltxmarkup.perl
blob1a0f7e193131428eaeec1bff48500e063b94eefe
1 # LaTeX2HTML support for the ltxmarkup package. Doesn't do indexing.
3 package main;
6 sub ltx_next_argument{
7 my $param;
8 $param = missing_braces()
9 unless ((s/$next_pair_pr_rx/$param=$2;''/eo)
10 ||(s/$next_pair_rx/$param=$2;''/eo));
11 return $param;
15 sub do_cmd_macro{
16 local($_) = @_;
17 my $macro = ltx_next_argument();
18 return "<tt class='macro'>&#92;$macro</tt>" . $_;
21 sub do_cmd_env{
22 local($_) = @_;
23 my $env = ltx_next_argument();
24 return "<tt class='environment'>&#92;$env</tt>" . $_;
27 sub ltx_process_params{
28 # Handle processing of \p and \op for parameter specifications for
29 # envdesc and macrodesc. It's done this way to avoid defining do_cmd_p()
30 # and do_cmd_op() functions, which would be interpreted outside the context
31 # in which these commands are legal, and cause LaTeX2HTML to think they're
32 # defined. This way, other uses of \p and \op are properly flagged as
33 # unknown macros.
34 my $s = @_[0];
35 $s =~ s%\\op<<(\d+)>>(.+)<<\1>>%<tt>[</tt><var>$2</var><tt>]</tt>%;
36 while ($s =~ /\\p<<(\d+)>>(.+)<<\1>>/) {
37 $s =~ s%\\p<<(\d+)>>(.+)<<\1>>%<tt>{</tt><var>$2</var><tt>}</tt>%;
39 return $s;
42 sub do_env_macrodesc{
43 local($_) = @_;
44 my $macro = ltx_next_argument();
45 my $params = ltx_process_params(ltx_next_argument());
46 return "\n<dl class='macrodesc'>"
47 . "\n<dt><b><tt class='macro'>&#92;$macro</tt></b>"
48 . "\n $params</dt>"
49 . "\n<dd>"
50 . $_
51 . '</dd></dl>';
54 sub do_env_envdesc{
55 local($_) = @_;
56 my $env = ltx_next_argument();
57 my $params = ltx_process_params(ltx_next_argument());
58 return "\n<dl class='envdesc'>"
59 . "\n<dt><tt>&#92;begin{<b class='environment'>$env</b>}</tt>"
60 . "\n $params"
61 . "\n<br /><tt>&#92;end{<b class='environment'>$env</b>}</tt></dt>"
62 . "\n<dd>"
63 . $_
64 . '</dd></dl>';
67 1; # Must end with this, because Perl is bogus.