From 3be207475825ccadb0ff30d457b022888fc29afc Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Thu, 31 Aug 2000 06:22:54 +0000 Subject: Push some table header formatting to the style sheet; this also helps separate some of the ties between l2hinit.perl and python.perl. Revamp the "title page" construction to allow more flexibility. --- Doc/perl/python.perl | 112 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 97 insertions(+), 15 deletions(-) diff --git a/Doc/perl/python.perl b/Doc/perl/python.perl index bacc8cc..5c31e80 100644 --- a/Doc/perl/python.perl +++ b/Doc/perl/python.perl @@ -932,8 +932,6 @@ sub do_cmd_memberlineni{ @col_aligns = ('', '', '', ''); -$TABLE_HEADER_BGCOLOR = $NAV_BGCOLOR; - sub fix_font{ # do a little magic on a font name to get the right behavior in the first # column of the output table @@ -1010,7 +1008,7 @@ sub do_env_tableii{ s/\\lineii' . "\n " - . "\n " + . "\n " . "\n $th1$h1\ " . "\n $th2$h2\ " . "\n " @@ -1135,40 +1133,124 @@ sub do_cmd_lineiv{ . $_; } -sub do_cmd_maketitle { - local($_) = @_; - my $the_title = "\n
"; + +# These can be used to control the title page appearance; +# they need a little bit of documentation. +# +# If $TITLE_PAGE_GRAPHIC is set, it should be the name of a file in the +# $ICONSERVER directory, or include path information (other than "./"). The +# default image type will be assumed if an extension is not provided. +# +# If specified, the "title page" will contain two colums: one containing the +# title/author/etc., and the other containing the graphic. Use the other +# four variables listed here to control specific details of the layout; all +# are optional. +# +# $TITLE_PAGE_GRAPHIC = "my-company-logo"; +# $TITLE_PAGE_GRAPHIC_COLWIDTH = "30%"; +# $TITLE_PAGE_GRAPHIC_WIDTH = 150; +# $TITLE_PAGE_GRAPHIC_HEIGHT = 150; +# $TITLE_PAGE_GRAPHIC_ON_RIGHT = 0; + +sub make_my_titlepage() { + my $the_title = ""; if ($t_title) { $the_title .= "\n

$t_title

"; - } else { write_warnings("\nThis document has no title."); } + } + else { + write_warnings("\nThis document has no title."); + } if ($t_author) { if ($t_authorURL) { my $href = translate_commands($t_authorURL); $href = make_named_href('author', $href, "$t_author"); $the_title .= "\n

$href

"; - } else { + } + else { $the_title .= ("\n

$t_author

"); } - } else { write_warnings("\nThere is no author for this document."); } + } + else { + write_warnings("\nThere is no author for this document."); + } if ($t_institute) { - $the_title .= "\n

$t_institute

";} + $the_title .= "\n

$t_institute

"; + } if ($DEVELOPER_ADDRESS) { - $the_title .= "\n

$DEVELOPER_ADDRESS

";} + $the_title .= "\n

$DEVELOPER_ADDRESS

"; + } if ($t_affil) { - $the_title .= "\n

$t_affil

";} + $the_title .= "\n

$t_affil

"; + } if ($t_date) { $the_title .= "\n

$t_date"; if ($PYTHON_VERSION) { - $the_title .= "
Release $PYTHON_VERSION";} + $the_title .= "
Release $PYTHON_VERSION"; + } $the_title .= "

" } if ($t_address) { $the_title .= "\n

$t_address

"; - } else { $the_title .= "\n

"} + } + else { + $the_title .= "\n

"; + } if ($t_email) { $the_title .= "\n

$t_email

"; - }# else { $the_title .= "

" } + } + return $the_title; +} + +use File::Basename; + +sub make_my_titlegraphic() { + my($myname, $mydir, $myext) = fileparse($TITLE_PAGE_GRAPHIC, '\..*'); + chop $mydir; + if ($mydir eq '.') { + $mydir = $ICONSERVER; + } + $myext = ".$IMAGE_TYPE" + unless $myext; + my $graphic = "\n"; + return $graphic; +} + +sub do_cmd_maketitle { + local($_) = @_; + my $the_title = "\n
"; + if ($TITLE_PAGE_GRAPHIC) { + if ($TITLE_PAGE_GRAPHIC_ON_RIGHT) { + $the_title .= ("\n" + . "\n\n" + . make_my_titlegraphic() + . "\n
" + . make_my_titlepage() + . "
"); + } + else { + $the_title .= ("\n\n" + . make_my_titlegraphic() + . "\n
" + . make_my_titlepage() + . "
"); + } + } + else { + $the_title .= ("\n
" + . make_my_titlepage() + . "\n
"); + } + $the_title .= "\n
"; + return $the_title . $_; $the_title .= "\n
"; return $the_title . $_ ; } -- cgit v0.12