Commit 1af9e797 authored by Fred Drake's avatar Fred Drake

Added support for \funcline{} and \dataline{}.

For all generated cases of <strong>...</strong> (from this module), change to
<b>...</b>.  This, from me?  This is entirely to reduce the size of the
generated markup, which is more of an issue than semantics here.  Since
<strong> isn't very meaningful anyway, this should be good.
parent 023f87fb
...@@ -79,7 +79,7 @@ sub do_cmd_emph{ ...@@ -79,7 +79,7 @@ sub do_cmd_emph{
sub do_cmd_strong{ sub do_cmd_strong{
local($_) = @_; local($_) = @_;
s/$any_next_pair_pr_rx/<strong>\2<\/strong>/; s/$any_next_pair_pr_rx/<b>\2<\/b>/;
$_; $_;
} }
...@@ -182,16 +182,24 @@ sub do_cmd_refstmodindex{ &my_module_index_helper('standard', @_, 'REF'); } ...@@ -182,16 +182,24 @@ sub do_cmd_refstmodindex{ &my_module_index_helper('standard', @_, 'REF'); }
sub do_cmd_nodename{ &do_cmd_label(@_); } sub do_cmd_nodename{ &do_cmd_label(@_); }
sub do_cmd_mytableofcontents{ local($_) = @_; $_; } sub do_cmd_mytableofcontents{ @_[0]; }
$any_next_pair_rx3 = "$O(\\d+)$C([\\s\\S]*)$O\\3$C"; sub init_myformat{
$any_next_pair_rx5 = "$O(\\d+)$C([\\s\\S]*)$O\\5$C"; # XXX need some way for this to be called after &initialise;
$any_next_pair_rx7 = "$O(\\d+)$C([\\s\\S]*)$O\\7$C"; # <<2>>...<<2>>
$any_next_pair_rx9 = "$O(\\d+)$C([\\s\\S]*)$O\\9$C"; $any_next_pair_rx3 = "$O(\\d+)$C([\\s\\S]*)$O\\3$C";
$any_next_pair_pr_rx_5 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\5$CP"; $any_next_pair_rx5 = "$O(\\d+)$C([\\s\\S]*)$O\\5$C";
$any_next_pair_pr_rx_7 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\7$CP"; $any_next_pair_rx7 = "$O(\\d+)$C([\\s\\S]*)$O\\7$C";
$any_next_pair_pr_rx_9 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\9$CP"; $any_next_pair_rx9 = "$O(\\d+)$C([\\s\\S]*)$O\\9$C";
$new_command{"indexsubitem"} = ""; # <#2#>...<#2#>
$any_next_pair_pr_rx_3 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP";
$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"} = "";
}
&init_myformat;
sub get_indexsubitem{ sub get_indexsubitem{
local($result) = $new_command{"indexsubitem"}; local($result) = $new_command{"indexsubitem"};
...@@ -227,7 +235,7 @@ sub do_env_cfuncdesc{ ...@@ -227,7 +235,7 @@ sub do_env_cfuncdesc{
"<tt>$function_name</tt>" . &get_indexsubitem); "<tt>$function_name</tt>" . &get_indexsubitem);
} }
$* = 0; $* = 0;
"<dl><dt>$return_type <strong>$idx</strong>" . "<dl><dt>$return_type <b>$idx</b>" .
"(<var>$arg_list</var>)\n<dd>$'\n</dl>" "(<var>$arg_list</var>)\n<dd>$'\n</dl>"
} }
...@@ -243,14 +251,13 @@ sub do_env_ctypedesc{ ...@@ -243,14 +251,13 @@ sub do_env_ctypedesc{
"<tt>$type_name</tt>" . &get_indexsubitem); "<tt>$type_name</tt>" . &get_indexsubitem);
} }
$* = 0; $* = 0;
"<dl><dt><strong>$idx</strong>\n<dd>$'\n</dl>" "<dl><dt><b>$idx</b>\n<dd>$'\n</dl>"
} }
sub do_env_cvardesc{ sub do_env_cvardesc{
local($_) = @_; local($_) = @_;
local($var_type,$var_name,$idx) = ('', '', ''); local($var_type,$var_name,$idx) = ('', '', '');
local($cfuncdesc_rx) = local($cfuncdesc_rx) = "$next_pair_rx$any_next_pair_rx3";
"$next_pair_rx$any_next_pair_rx3";
$* = 1; $* = 1;
if (/$cfuncdesc_rx/o) { if (/$cfuncdesc_rx/o) {
$var_type = "$2"; $var_type = "$2";
...@@ -258,7 +265,7 @@ sub do_env_cvardesc{ ...@@ -258,7 +265,7 @@ sub do_env_cvardesc{
$idx = &make_str_index_entry($3,"<tt>$var_name</tt>" . &get_indexsubitem); $idx = &make_str_index_entry($3,"<tt>$var_name</tt>" . &get_indexsubitem);
} }
$* = 0; $* = 0;
"<dl><dt>$var_type <strong>$idx</strong>\n" . "<dl><dt>$var_type <b>$idx</b>\n" .
"<dd>$'\n</dl>"; "<dd>$'\n</dl>";
} }
...@@ -274,7 +281,18 @@ sub do_env_funcdesc{ ...@@ -274,7 +281,18 @@ sub do_env_funcdesc{
"<tt>$function_name</tt>" . &get_indexsubitem); "<tt>$function_name</tt>" . &get_indexsubitem);
} }
$* = 0; $* = 0;
"<dl><dt><strong>$idx</strong> (<var>$arg_list</var>)\n<dd>$'\n</dl>"; "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>$'\n</dl>";
}
sub do_cmd_funcline{
local($_) = @_;
local($funcdesc_rx) = "$next_pair_pr_rx$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP";
s/$funcdesc_rx//o;
local($br_id, $function_name, $arg_list) = ($3, $2, $4);
local($idx) = &make_str_index_entry($br_id, "<tt>$function_name</tt>");
"<dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>" . $_;
} }
sub do_env_opcodedesc{ sub do_env_opcodedesc{
...@@ -289,7 +307,7 @@ sub do_env_opcodedesc{ ...@@ -289,7 +307,7 @@ sub do_env_opcodedesc{
"<tt>$opcode_name</tt> (byte code instruction)"); "<tt>$opcode_name</tt> (byte code instruction)");
} }
$* = 0; $* = 0;
$stuff = "<dl><dt><strong>$idx</strong>"; $stuff = "<dl><dt><b>$idx</b>";
if ($arg_list) { if ($arg_list) {
$stuff = "$stuff&nbsp;&nbsp;&nbsp;&nbsp;<var>$arg_list</var>"; $stuff = "$stuff&nbsp;&nbsp;&nbsp;&nbsp;<var>$arg_list</var>";
} }
...@@ -307,8 +325,17 @@ sub do_env_datadesc{ ...@@ -307,8 +325,17 @@ sub do_env_datadesc{
"<tt>$data_name</tt>" . &get_indexsubitem); "<tt>$data_name</tt>" . &get_indexsubitem);
} }
$* = 0; $* = 0;
"<dl><dt><strong>$idx</strong>" . "<dl><dt><b>$idx</b>\n<dd>$'\n</dl>"
"\n<dd>$'\n</dl>" }
sub do_cmd_dataline{
local($_) = @_;
s/$next_pair_pr_rx//o;
local($br_id, $data_name) = ($1, $2);
local($idx) = &make_str_index_entry($br_id, "<tt>$data_name</tt>");
"<dt><b>$idx</b>\n<dd>" . $_;
} }
sub do_env_excdesc{ &do_env_datadesc(@_); } sub do_env_excdesc{ &do_env_datadesc(@_); }
...@@ -318,9 +345,18 @@ sub do_env_excdesc{ &do_env_datadesc(@_); } ...@@ -318,9 +345,18 @@ sub do_env_excdesc{ &do_env_datadesc(@_); }
sub setup_column_alignments{ sub setup_column_alignments{
local($_) = @_; local($_) = @_;
local($j1,$a1,$a2,$a3,$j4) = split(/[|]/,$_); local($j1,$a1,$a2,$a3,$j4) = split(/[|]/,$_);
local($th1,$th2,$th3) = ('<th>', '<th>', '<th>');
$col_aligns[0] = (($a1 eq "c") ? "<td align=center>" : "<td>"); $col_aligns[0] = (($a1 eq "c") ? "<td align=center>" : "<td>");
$col_aligns[1] = (($a2 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>"); $col_aligns[2] = (($a3 eq "c") ? "<td align=center>" : "<td>");
# return the aligned header start tags; only used for \begin{tableiii?}
$th1 = (($a1 eq "l") ? "<th align=left>"
: ($a1 eq "r" ? "<th align=right>" : "<th>"));
$th2 = (($a2 eq "l") ? "<th align=left>"
: ($a2 eq "r" ? "<th align=right>" : "<th>"));
$th3 = (($a3 eq "l") ? "<th align=left>"
: ($a3 eq "r" ? "<th align=right>" : "<th>"));
($th1, $th2, $th3);
} }
sub do_env_tableii{ sub do_env_tableii{
...@@ -330,13 +366,13 @@ sub do_env_tableii{ ...@@ -330,13 +366,13 @@ sub do_env_tableii{
"$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7"; "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7";
$* = 1; $* = 1;
if (/$tableiii_rx/o) { if (/$tableiii_rx/o) {
&setup_column_alignments($2);
$font = $4; $font = $4;
$h1 = $6; $h1 = $6;
$h2 = $8; $h2 = $8;
} }
local($th1,$th2,$th3) = &setup_column_alignments($2);
$globals{"lineifont"} = $font; $globals{"lineifont"} = $font;
"<table border align=center>\n <tr><th>$h1</th>\n <th>$h2</th>$'\n" "<table border align=center>\n <tr>$th1$h1</th>\n $th2$h2</th>$'\n"
. "</table>"; . "</table>";
} }
...@@ -355,20 +391,21 @@ sub do_cmd_lineii{ ...@@ -355,20 +391,21 @@ sub do_cmd_lineii{
sub do_env_tableiii{ sub do_env_tableiii{
local($_) = @_; local($_) = @_;
local($font,$h1,$h2,$h3) = ('', '', '', ''); local($font,$h1,$h2,$h3) = ('', '', '', '');
local($tableiii_rx) = local($tableiii_rx) =
"$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7" "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7"
. "$any_next_pair_rx9"; . "$any_next_pair_rx9";
$* = 1; $* = 1;
if (/$tableiii_rx/o) { if (/$tableiii_rx/o) {
&setup_column_alignments($2);
$font = $4; $font = $4;
$h1 = $6; $h1 = $6;
$h2 = $8; $h2 = $8;
$h3 = $10; $h3 = $10;
} }
local($th1,$th2,$th3) = &setup_column_alignments($2);
$globals{"lineifont"} = $font; $globals{"lineifont"} = $font;
"<table border align=center>\n <tr><th>$h1</th>\n <th>$h2</th>" "<table border align=center>\n <tr>$th1$h1</th>\n $th2$h2</th>"
. "\n <th>$h3</th>$'\n" . "\n $th3$h3</th>$'\n"
. "</table>"; . "</table>";
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment