From: Fred Drake Date: Mon, 12 Jan 1998 23:15:29 +0000 (+0000) Subject: Added support for \funcline{} and \dataline{}. X-Git-Tag: v1.5.1~988 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1af9e79708128dd681e5be44da518eba2ade3905;p=python Added support for \funcline{} and \dataline{}. For all generated cases of ... (from this module), change to .... This, from me? This is entirely to reduce the size of the generated markup, which is more of an issue than semantics here. Since isn't very meaningful anyway, this should be good. --- diff --git a/Doc/myformat.perl b/Doc/myformat.perl index 4eaea060b6..261cd05137 100644 --- a/Doc/myformat.perl +++ b/Doc/myformat.perl @@ -79,7 +79,7 @@ sub do_cmd_emph{ sub do_cmd_strong{ local($_) = @_; - s/$any_next_pair_pr_rx/\2<\/strong>/; + s/$any_next_pair_pr_rx/\2<\/b>/; $_; } @@ -182,16 +182,24 @@ sub do_cmd_refstmodindex{ &my_module_index_helper('standard', @_, 'REF'); } 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"; -$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 init_myformat{ + # XXX need some way for this to be called after &initialise; + # <<2>>...<<2>> + $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"; + # <#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{ local($result) = $new_command{"indexsubitem"}; @@ -227,7 +235,7 @@ sub do_env_cfuncdesc{ "$function_name" . &get_indexsubitem); } $* = 0; - "
$return_type $idx" . + "
$return_type $idx" . "($arg_list)\n
$'\n
" } @@ -243,14 +251,13 @@ sub do_env_ctypedesc{ "$type_name" . &get_indexsubitem); } $* = 0; - "
$idx\n
$'\n
" + "
$idx\n
$'\n
" } sub do_env_cvardesc{ local($_) = @_; local($var_type,$var_name,$idx) = ('', '', ''); - local($cfuncdesc_rx) = - "$next_pair_rx$any_next_pair_rx3"; + local($cfuncdesc_rx) = "$next_pair_rx$any_next_pair_rx3"; $* = 1; if (/$cfuncdesc_rx/o) { $var_type = "$2"; @@ -258,7 +265,7 @@ sub do_env_cvardesc{ $idx = &make_str_index_entry($3,"$var_name" . &get_indexsubitem); } $* = 0; - "
$var_type $idx\n" . + "
$var_type $idx\n" . "
$'\n
"; } @@ -274,7 +281,18 @@ sub do_env_funcdesc{ "$function_name" . &get_indexsubitem); } $* = 0; - "
$idx ($arg_list)\n
$'\n
"; + "
$idx ($arg_list)\n
$'\n
"; +} + +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, "$function_name"); + + "
$idx ($arg_list)\n
" . $_; } sub do_env_opcodedesc{ @@ -289,7 +307,7 @@ sub do_env_opcodedesc{ "$opcode_name (byte code instruction)"); } $* = 0; - $stuff = "
$idx"; + $stuff = "
$idx"; if ($arg_list) { $stuff = "$stuff    $arg_list"; } @@ -307,8 +325,17 @@ sub do_env_datadesc{ "$data_name" . &get_indexsubitem); } $* = 0; - "
$idx" . - "\n
$'\n
" + "
$idx\n
$'\n
" +} + +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, "$data_name"); + + "
$idx\n
" . $_; } sub do_env_excdesc{ &do_env_datadesc(@_); } @@ -318,9 +345,18 @@ sub do_env_excdesc{ &do_env_datadesc(@_); } sub setup_column_alignments{ local($_) = @_; local($j1,$a1,$a2,$a3,$j4) = split(/[|]/,$_); + local($th1,$th2,$th3) = ('', '', ''); $col_aligns[0] = (($a1 eq "c") ? "" : ""); $col_aligns[1] = (($a2 eq "c") ? "" : ""); $col_aligns[2] = (($a3 eq "c") ? "" : ""); + # return the aligned header start tags; only used for \begin{tableiii?} + $th1 = (($a1 eq "l") ? "" + : ($a1 eq "r" ? "" : "")); + $th2 = (($a2 eq "l") ? "" + : ($a2 eq "r" ? "" : "")); + $th3 = (($a3 eq "l") ? "" + : ($a3 eq "r" ? "" : "")); + ($th1, $th2, $th3); } 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"; $* = 1; if (/$tableiii_rx/o) { - &setup_column_alignments($2); $font = $4; $h1 = $6; $h2 = $8; } + local($th1,$th2,$th3) = &setup_column_alignments($2); $globals{"lineifont"} = $font; - "\n \n $'\n" + "
$h1$h2
\n $th1$h1\n $th2$h2$'\n" . "
"; } @@ -355,20 +391,21 @@ sub do_cmd_lineii{ 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; } + local($th1,$th2,$th3) = &setup_column_alignments($2); $globals{"lineifont"} = $font; - "\n \n " - . "\n $'\n" + "
$h1$h2$h3
\n $th1$h1\n $th2$h2" + . "\n $th3$h3$'\n" . "
"; }