File: html3_0.pl

package info (click to toggle)
latex2html 2000-beta1-5
  • links: PTS
  • area: main
  • in suites: woody
  • size: 6,696 kB
  • ctags: 3,087
  • sloc: perl: 29,736; makefile: 828; sh: 308
file content (82 lines) | stat: -rw-r--r-- 2,666 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
### File: html3.0.pl
### Language definitions for HTML 3.0
### Written by Marcus E. Hennecke <marcush@leland.stanford.edu>
### Version 0.4,  February 2, 1996

## Copyright (C) 1995 by Marcus E. Hennecke
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.

## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

### Extend declarations
%declarations = (
#     'tiny', '<SMALL CLASS="TINY"></SMALL>',
#     'scriptsize', '<SMALL CLASS="SCRIPT"></SMALL>',
#     'footnotesize', '<SMALL CLASS="FOOTNOTE"></SMALL>',
#     'small', '<SMALL CLASS="SMALL"></SMALL>',
#     'large', '<BIG CLASS="LARGE"></BIG>',
#     'Large', '<BIG CLASS="XLARGE"></BIG>',
#     'LARGE', '<BIG CLASS="XXLARGE"></BIG>',
#     'huge', '<BIG CLASS="HUGE"></BIG>',
#     'Huge', '<BIG CLASS="XHUGE"></BIG>',
     'centering', '<DIV ALIGN="CENTER"></DIV>',
     'center', '<DIV ALIGN="CENTER"></DIV>',
     'flushleft', '<DIV ALIGN="LEFT"></DIV>',
     'raggedright', '<DIV ALIGN="LEFT"></DIV>',
     'flushright', '<DIV ALIGN="RIGHT"></DIV>',
     'raggedleft', '<DIV ALIGN="RIGHT"></DIV>',
     %declarations
);

sub do_cmd_underline {
    local($_) = @_;
    s/$next_pair_pr_rx//o;
    &lost_argument("underline") unless ($&);
    join('',"<U>$2</U>",$_); 
}

### Allow for alignment to work

sub do_env_center {
    local($_) = @_;
    "<DIV ALIGN=\"CENTER\">\n<P ALIGN=\"CENTER\">$_</P>\n</DIV>";
}
sub do_env_flushright {
    local($_) = @_;
    "<DIV ALIGN=\"RIGHT\">\n<P ALIGN=\"RIGHT\">$_</P>\n</DIV>";
}
sub do_env_flushleft {
    local($_) = @_;
    "<DIV ALIGN=\"LEFT\">\n<P ALIGN=\"LEFT\">$_</P>\n</DIV>";
}

sub do_cmd_centerline {
    local($_) = @_;
    s/$next_pair_pr_rx//o;
    &lost_argument("centerline") unless ($&);
    "<DIV ALIGN=\"CENTER\">$&<BR>\n</DIV>$_";
}

sub do_cmd_leftline {
    local($_) = @_;
    s/$next_pair_pr_rx//o;
    &lost_argument("leftline") unless ($&);
    "<DIV ALIGN=\"LEFT\">$&<BR>\n</DIV>$_";
}

sub do_cmd_rightline {
    local($_) = @_;
    s/$next_pair_pr_rx//o;
    &lost_argument("rightline") unless ($&);
    "<DIV ALIGN=\"RIGHT\">$&<BR>\n</DIV>$_";
}