-
Notifications
You must be signed in to change notification settings - Fork 1
/
bylaws.perl
217 lines (192 loc) · 4.92 KB
/
bylaws.perl
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# bylaws.perl - latex2html 2002 support for bylaws.cls
# by Stephen Gildea Time-stamp: <2002-09-05 14:29:12 gildea>
# $Id$
package main;
$TOP_NAVIGATION = 0;
# 97.1 seems to ignore the variable, so we force the issue:
sub top_navigation_panel {}
$INFO = 0;
$NO_NAVIGATION = 0;
$MAX_SPLIT_DEPTH = 0;
$STYLESHEET = '';
# modified by secnames class option, see below
$BODYTEXT = "bgcolor=\"#fffff7\"";
# Class option [secnames] makes \section take an argument.
# Tested with latex2html 2K.1beta.
sub do_bylaws_secnames {
$secnames = 1;
# MITBDT-specific settings follow
$mitbdt = 1;
$BODYTEXT = "text=\"#000000\"" .
" bgcolor=\"#f0f0f0\"" .
" link=\"#ff0000\"" .
" vlink=\"#800000\"";
}
# put the date at the bottom, not in the title
sub do_cmd_date {
local($_) = @_;
s/$next_pair_pr_rx//o;
($bottom_date) = $&;
$_;
}
sub do_env_history {
local($_) = @_;
s/\n/<br>\n/g;
"<p align=\"center\">\n$_\n</p>";
}
$article_num = 0;
sub do_cmd_article{
local($_) = @_;
s/$next_pair_pr_rx//o;
local($artname) = $2;
local($rest) = $_;
$article_num++;
$section_num = 0;
$subsection_num = 0;
local($romart) = &roman($article_num);
local($was_in_duty) = $in_duty;
$in_duty = 0;
join('',
$was_in_duty ? "</ul>\n" : "",
"<h2 align=\"center\"><a name=\"article$article_num\">",
"Article $romart. $artname<\/a><\/h2>$rest");
}
sub do_cmd_policy{
local($_) = @_;
s/$next_pair_pr_rx//o;
local($artname) = $2;
local($rest) = $_;
$article_num++;
$section_num = 0;
$subsection_num = 0;
local($was_in_duty) = $in_duty;
$in_duty = 0;
join('',
$was_in_duty ? "</ul>\n" : "",
"<h2 align=\"center\"><a name=\"sp$article_num\">",
"Standing Policy $article_num. $artname<\/a><\/h2>$rest");
}
sub do_cmd_subarticle{
local($_) = @_;
s/$next_pair_pr_rx//o;
local($artname) = $2;
local($rest) = $_;
$section_num++;
$subsection_num = 0;
local($was_in_duty) = $in_duty;
$in_duty = 0;
join('',
$was_in_duty ? "</ul>\n" : "",
"<h3>Section $section_num. $artname<\/h3>$rest");
}
$section_num = 0;
sub do_cmd_section{
local($after) = @_;
local($was_in_duty) = $in_duty;
local($sectionname);
$section_num++;
$subsection_num = 0;
$in_duty = 0;
if ($secnames) {
$after =~ s/$next_pair_rx//eo;
$sectionname = $2;
}
join('',
$was_in_duty ? "</ul>\n" : "",
$secnames ?
"\n<h3>Section $section_num. $sectionname<\/h3>" :
"<p>\nSection $section_num. ",
$after);
}
sub do_cmd_subsection{
local($_) = @_;
s/$next_pair_rx//eo;
local($subsectionname) = $2;
local($rest) = $_;
$subsection_num++;
local($alphsubsection) = &fAlph($subsection_num);
local($was_in_duty) = $in_duty;
$in_duty = 0;
join('',
$was_in_duty ? "</ul>\n" : "",
"<p>\nSection $section_num.$alphsubsection. ", $rest);
}
$in_duty = 0;
sub do_cmd_duty{
local($_) = @_;
local($was_in_duty) = $in_duty;
$in_duty = 1;
join('',
$was_in_duty ? "" : "<ul>\n",
"<li>", $_);
}
sub do_env_issues {
local($_) = @_;
local($was_in_duty) = $in_duty;
$in_duty = 0;
join('',
$was_in_duty ? "</ul>\n" : "",
"\n<hr width=\"50%\" size=\"10\">\n<p>\n",
"<h2 align=\"center\">Issues</h2>\n$_\n<p>");
}
sub do_cmd_issue{
local($_) = @_;
s/$next_pair_pr_rx//eo;
local($issuenum) = $2;
s/$next_pair_pr_rx//eo;
local($issuename) = $2;
# look ahead for the label we expect and fold it into the header
local($label);
if (s/$EOL\\label$any_next_pair_pr_rx$EOL//eo) {
$label = $2;
} else {
$label = "Issue$issuenum";
}
local($rest) = $_;
join('',
"\n<h3><a name=\"$label\">",
"Issue $issuenum: $issuename<\/a><\/h3>\n<p>$rest");
}
# comments are ignored
sub do_env_comment { ""; }
sub bot_navigation_panel {
local($was_in_duty) = $in_duty;
$in_duty = 0;
($was_in_duty ? "</ul>\n" : "") .
"<hr><p>\n".
do {"$bottom_date<br>\n" if $bottom_date;}.
do {'Up: <a href="./">Governing Documents Index</a><br>'."\n".
'Top: <a href="../">Tech Squares</a>'."\n" if !$mitbdt;}
}
sub make_address {
"</body>\n</html>\n";
}
# &roman written by Stephen Gildea, May 1994, for tocfront program
sub roman {
local($number) = @_;
local($roman) = "";
local(@romans) = ("M", 1000, "CM", 900, "D", 500, "CD", 400,
"C", 100, "XC", 90, "L", 50, "XL", 40,
"X", 10, "IX", 9, "V", 5, "IV", 4, "I", 1, "", 0);
local($i);
for ($i = 0; local($c, $val) = @romans[$i .. $i+1], $val; $i += 2) {
while ($number >= $val) {
$number -= $val;
$roman .= $c;
}
}
return $roman;
}
# not in V 96.1
# Should it be in latex2html ?
sub do_cmd_hrulefill {
join('',"<hr>", $_[0]);
}
&ignore_commands(<<_IGNORED_CMDS_);
pagefooter # {}#{}#{}
leavevmode
voffset # &ignore_numeric_argument
NeedsTeXFormat #{}
null
_IGNORED_CMDS_
1; # This must be the last line