do_env_tableii(), do_cmd_lineii(),

do_env_tableiii(), do_cmd_lineiii():  New functions to handle tableii and
	tableiii environments.

Small changes to not add a superfluous space between a function name and the
comma in the index.
This commit is contained in:
Fred Drake 1997-12-22 22:37:34 +00:00
parent 80e57fb21b
commit 9597daf220
1 changed files with 86 additions and 6 deletions

View File

@ -183,12 +183,18 @@ sub do_cmd_refstmodindex{ &my_module_index_helper('standard', @_, 'REF'); }
sub do_cmd_nodename{ &do_cmd_label(@_); }
$any_next_pair_rx3 = "$O(\\d+)$C([\\s\\S]*)$O\\3$C";
$any_next_pair_rx5 = "$O(\\d+)$C([\\s\\S]*)$O\\5$C";
$any_next_pair_rx7 = "$O(\\d+)$C([\\s\\S]*)$O\\7$C";
$any_next_pair_rx9 = "$O(\\d+)$C([\\s\\S]*)$O\\9$C";
$any_next_pair_pr_rx_5 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\5$CP";
$any_next_pair_pr_rx_7 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\7$CP";
$any_next_pair_pr_rx_9 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\9$CP";
$new_command{"indexsubitem"} = "";
sub get_indexsubitem{
local($result) = $new_command{"indexsubitem"};
#print "\nget_indexsubitem ==> $result\n";
$result;
$result ? " $result" : '';
}
# similar to make_index_entry(), but includes the string in the result
@ -305,6 +311,80 @@ sub do_env_datadesc{
sub do_env_excdesc{ &do_env_datadesc(@_); }
@col_aligns = ("<td>", "<td>", "<td>");
sub setup_column_alignments{
local($_) = @_;
local($j1,$a1,$a2,$a3,$j4) = split(/[|]/,$_);
$col_aligns[0] = (($a1 eq "c") ? "<td align=center>" : "<td>");
$col_aligns[1] = (($a2 eq "c") ? "<td align=center>" : "<td>");
$col_aligns[2] = (($a3 eq "c") ? "<td align=center>" : "<td>");
}
sub do_env_tableii{
local($_) = @_;
local($font,$h1,$h2) = ('', '', '');
local($tableiii_rx) =
"$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7";
$* = 1;
if (/$tableiii_rx/o) {
&setup_column_alignments($2);
$font = $4;
$h1 = $6;
$h2 = $8;
}
$globals{"lineifont"} = $font;
"<table border>\n <tr><th>$h1</th>\n <th>$h2</th>$'\n"
. "</table>";
}
sub do_cmd_lineii{
local($_) = @_;
s/$next_pair_pr_rx//o;
local($c1) = $2;
s/$next_pair_pr_rx//o;
local($c2) = $2;
local($font) = $globals{"lineifont"};
local($c1align, $c2align) = @col_aligns[0,1];
"<tr>$c1align<$font>$c1</$font></td>\n"
. " $c2align$c2</td>$'";
}
sub do_env_tableiii{
local($_) = @_;
local($font,$h1,$h2,$h3) = ('', '', '', '');
local($tableiii_rx) =
"$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7"
. "$any_next_pair_rx9";
$* = 1;
if (/$tableiii_rx/o) {
&setup_column_alignments($2);
$font = $4;
$h1 = $6;
$h2 = $8;
$h3 = $10;
}
$globals{"lineifont"} = $font;
"<table border>\n <tr><th>$h1</th>\n <th>$h2</th>"
. "\n <th>$h3</th>$'\n"
. "</table>";
}
sub do_cmd_lineiii{
local($_) = @_;
s/$next_pair_pr_rx//o;
local($c1) = $2;
s/$next_pair_pr_rx//o;
local($c2) = $2;
s/$next_pair_pr_rx//o;
local($c3) = $2;
local($font) = $globals{"lineifont"};
local($c1align, $c2align, $c3align) = @col_aligns;
"<tr>$c1align<$font>$c1</$font></td>\n"
. " $c2align$c2</td>\n"
. " $c3align$c3</td>$'";
}
sub do_env_seealso{
local($_) = @_;
"<p><b>See Also:</b></p>\n" . $_;