diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-09 00:44:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-09 00:44:40 +0000 |
commit | b4fc5f639874db951177ec539299d20908adb654 (patch) | |
tree | 52f08823ca58fffe3db6a9b075635038c567626c /Master/texmf-dist/doc/latex/svninfo | |
parent | dec3d98ebe442d7ea93efbaa8dd2e2be8149a467 (diff) |
doc 4
git-svn-id: svn://tug.org/texlive/trunk@80 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/svninfo')
-rw-r--r-- | Master/texmf-dist/doc/latex/svninfo/README | 67 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/svninfo/svninfo.init | 39 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/svninfo/svninfo.pdf | bin | 0 -> 161326 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/svninfo/svninfo.perl | 264 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/svninfo/svninfo2html.tex | 172 |
5 files changed, 542 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/svninfo/README b/Master/texmf-dist/doc/latex/svninfo/README new file mode 100644 index 00000000000..6ae81454bbd --- /dev/null +++ b/Master/texmf-dist/doc/latex/svninfo/README @@ -0,0 +1,67 @@ + + + `svninfo' + + version 0.3, September 29, 2005 + +This package is used to extract the revision and file information provided +by the subversion revision control system. +A PERL-package supporting svninfo and LaTeX2HTML is provided too. + +Copyright (C) 2003-2005 Achim D. Brucker +email: brucker@freiburg.linux.de + +License: + This program can be redistributed and/or modified under the terms + of the LaTeX Project Public License Distributed from CTAN + archives in directory macros/latex/base/lppl.txt; either + version 1 of the License, or any later version. + +You are allowed to distribute this file under the condition that it is +distributed together with all the following files: + svninfo.ins + svninfo.dtx + Makefile + README-0.2 + +If you receive only some of these files from someone, complain! + +To install: + unpack and + `make' +or execute the commands manually: + latex svninfo.ins // creates the file of this package + latex svninfo.dtx // create the package documentation + +and if latex2html is installed on your system: + latex2html -dir html -init_file svninfo.init \ + -html_version 4.0,math svninfo2html.tex + +The following files are created by 'latex svninfo.ins' + - svninfo.cfg + - svninfo.sty + - svninfo.perl + - svninfo.init + - svninfo2html.tex + +then copy the files + svninfo.sty + svninfo.cfg +to a place where LaTeX can find it + (e.g. under UNIX: $HOME/tex/inputs + and set the environment variable + TEXINPUTS=$HOME/tex/inputs//:$TEXINPUTS + ) +and + svninfo.perl +to a place where latex2html will find it. + + +============================================================================ + +HISTORY +0.3 : Added support for Id-keywords without owner information + (fixes a bug reported by Uwe Ziegenhagen). +0.2.1 : Added \svnId (suggested by Thomas Weber). +0.2 : Removed latex2html build-dependency +0.1 : Initial Version, based on rcsinfo from Dr. Juergen Vollmer diff --git a/Master/texmf-dist/doc/latex/svninfo/svninfo.init b/Master/texmf-dist/doc/latex/svninfo/svninfo.init new file mode 100644 index 00000000000..870d4773e68 --- /dev/null +++ b/Master/texmf-dist/doc/latex/svninfo/svninfo.init @@ -0,0 +1,39 @@ + +# This is file `svninfo.init', +# generated with the docstrip utility. +# +# The original source files were: +# +# svninfo.dtx (with options: `init') +# +# IMPORTANT NOTICE: +# +# For the copyright see the source file. +# +# Any modified versions of this file must be renamed +# with new filenames distinct from svninfo.init. +# +# For distribution of the original source see the terms +# for copying and modification in the file svninfo.dtx. +# +# This generated file may be distributed as long as the +# original source files, as listed above, are part of the +# same distribution. (The sources need not necessarily be +# in the same archive or directory.) +# +# This file should be used as initialization file for LaTeX2HTML +# when transforming svninfo2html.tex --> HTML +# +# $Id: svninfo.dtx 1168 2005-04-08 06:18:47Z brucker $ +############################################################################### +sub my_address_field +{ + $ADDRESS = '<hr>This file was last updated on ' . + $svninfo::Date . + ' by ' . + '<a href="mailto: brucker @ freiburg.linux.de@">' . + 'Achim D. Brucker ' . + '<brucker @ freiburg.linux.de></a>'; +} +$svninfo::SetAddressProc = \&my_address_field; +############################################################################### diff --git a/Master/texmf-dist/doc/latex/svninfo/svninfo.pdf b/Master/texmf-dist/doc/latex/svninfo/svninfo.pdf Binary files differnew file mode 100644 index 00000000000..68bda9b627b --- /dev/null +++ b/Master/texmf-dist/doc/latex/svninfo/svninfo.pdf diff --git a/Master/texmf-dist/doc/latex/svninfo/svninfo.perl b/Master/texmf-dist/doc/latex/svninfo/svninfo.perl new file mode 100644 index 00000000000..36cacafe7b9 --- /dev/null +++ b/Master/texmf-dist/doc/latex/svninfo/svninfo.perl @@ -0,0 +1,264 @@ + +############################################################################### +# SVNINFO.PERL +# Copyright 1995 Dr. Juergen Vollmer <Juergen.Vollmer@acm.org> +# Copyright 2003-2005 Achim D. Brucker <brucker@freiburg.linux.de> +# +# Extension to LaTeX2HTML to translate LaTeX commands of the +# svninfo +# package to equivalent HTML commands. +# +# This is file `svninfo.perl', +# generated with the docstrip utility. +# +# The original source files were: +# +# svninfo.dtx (with options: `perl') +# +# IMPORTANT NOTICE: +# +# For the copyright see the source file. +# +# Any modified versions of this file must be renamed +# with new filenames distinct from svninfo.perl. +# +# For distribution of the original source see the terms +# for copying and modification in the file svninfo.dtx. +# +# This generated file may be distributed as long as the +# original source files, as listed above, are part of the +# same distribution. (The sources need not necessarily be +# in the same archive or directory.) +# +# $Id: svninfo.dtx 1168 2005-04-08 06:18:47Z brucker $ +# +############################################################################### + +package svninfo; + +($Dummy1,$PackageVersionDate,$PackageVersionTime,$Dummy2) = + split (/ /,'$Date: 2005-04-08 08:18:47 +0200 (Fr, 08 Apr 2005) $'); + +print "\n\t svninfo style interface for LaTeX2HTML, $PackageVersionDate\n"; + +# set defaults options +$OptionFancy = 1; +$OptionToday = 1; +$OptionLong = 1; + +# set default values +$Date = `date '+%Y/%m/%d'`; +$Time = `date '+%H:%M:%S'`; +$File = "--sourcefile--"; +$Revision = "--revision--"; +$Owner = "--owner--"; +$Year = `date '+%Y'`; +$Month = `date '+%m'`; +$Day = `date '+%d'`; +$LongDate = $Date; + +sub SetAddress +{ + $main::address_data[1] = "Revision: $svninfo::Revision, $svninfo::LongDate"; + # Supply your own string if you don't like the default <Name> <Date> + $main::ADDRESS = "<I>$main::address_data[0] <BR>\n$main::address_data[1]</I>"; +} +if ($SetAddressProc == "") { + $SetAddressProc = \&svninfo::SetAddress; +} +sub make_cmds +{ + my $cmd; + foreach $cmd (File,Revision,Date,Time,Owner,Year,Month,Day,LongDate) { + eval "sub main::do_cmd_svnInfo$cmd { " + . 'my $val = $svninfo::' . "$cmd; " +# . 'printf STDERR "\ndo_cmd_svnInfo%s=%s\n", ' . $cmd .', $val;' + . "join('',\$val,\$_[0]);" + . "}"; + } +} + +@GermanMonthName = ('','Januar','Februar','März','April','Mai','Juni','Juli', + 'August','September','Oktober','November','Dezember'); +@EnglishMonthName = ('','January','February','March','April','May','June','July', + 'August','September','October','November','December'); +@FrenchMonthName = ('','Janvier','Février','Mars','Avril','Mai','Juin', + 'Juillet','Août','Septembre','Octobre','Novembre', + 'Décembre'); + +############################################################################### + +package main; + +# handling package options +sub do_svninfo_fancyhdr { $svninfo::OptionFancy = 1; } +sub do_svninfo_fancy { $svninfo::OptionFancy = 1; } +sub do_svninfo_nofancy { $svninfo::OptionFancy = 0; } +sub do_svninfo_today { $svninfo::OptionToday = 1; } +sub do_svninfo_notoday { $svninfo::OptionToday = 0; } +sub do_svninfo_short { $svninfo::OptionLong = 0; } +sub do_svninfo_long { $svninfo::OptionLong = 1; } + +# handling of LaTeX commands +sub do_cmd_svnInfo +{ + + local ($_) = @_; + + # printf STDERR "\ndo_cmd_svnInfo\n"; + + # see latex2html, procedure: substitute_meta_cmds, process_body_newcommand + # the format of the variable $new_command{cmd} is: + # $new_command{$cmd} = join(':!:',$argn,$body,$opt); + # note: opt = "}" means: Flag for no optional arg + # printf STDERR "xxxxxxxxxxx `%s'\n", $new_command{svnInfoFILE}; + # printf STDERR "xxxxxxxxxxx `%s'\n", $new_command{svnInfoREVISION}; + # printf STDERR "xxxxxxxxxxx `%s'\n", $new_command{svnInfoYEAR}; + # printf STDERR "xxxxxxxxxxx `%s'\n", $new_command{svnInfoMONTH}; + # printf STDERR "xxxxxxxxxxx `%s'\n", $new_command{svnInfoDAY}; + # printf STDERR "xxxxxxxxxxx `%s'\n", $new_command{svnInfoTIME}; + # printf STDERR "xxxxxxxxxxx `%s'\n", $new_command{svnInfoOWNER}; + + # the following assumes: LaTeX2HTML Version 99.1 release (March 30, 1999) + # may be later + my ($argn, $opt); + if (exists $new_command{svnInfoFILE}) { + ($argn, $svninfo::File, $opt) = split(/:!:/, $new_command{svnInfoFILE}); + } else { + $svninfo::File = $File + } + if (exists $new_command{svnInfoREVISION}) { + ($argn, $svninfo::Revision, $opt) = split(/:!:/, $new_command{svnInfoREVISION}); + } else { + $svninfo::Revision = $Revision + } + if (exists $new_command{svnInfoYEAR}) { + ($argn, $svninfo::Year, $opt) = split(/:!:/, $new_command{svnInfoYEAR}); + } else { + $svninfo::Year = $Year + } + if (exists $new_command{svnInfoMONTH}) { + ($argn, $svninfo::Month, $opt) = split(/:!:/, $new_command{svnInfoMONTH}); + } else { + $svninfo::Month = $Month + } + if (exists $new_command{svnInfoDAY}) { + ($argn, $svninfo::Day, $opt) = split(/:!:/, $new_command{svnInfoDAY}); + } else { + $svninfo::Day = $Day + } + if (exists $new_command{svnInfoTIME}) { + ($argn, $svninfo::Time, $opt) = split(/:!:/, $new_command{svnInfoTIME}); + } else { + $svninfo::Time = $Time + } + if (exists $new_command{svnInfoOWNER}) { + ($argn, $svninfo::Owner, $opt) = split(/:!:/, $new_command{svnInfoOWNER}); + } else { + $svninfo::Owner = $Owner + } + + # printf STDERR "yyyyyyyyyyy `%s'\n", $svninfo::File; + # printf STDERR "yyyyyyyyyyy `%s'\n", $svninfo::Revision; + # printf STDERR "yyyyyyyyyyy `%s'\n", $svninfo::Year; + # printf STDERR "yyyyyyyyyyy `%s'\n", $svninfo::Month; + # printf STDERR "yyyyyyyyyyy `%s'\n", $svninfo::Day; + # printf STDERR "yyyyyyyyyyy `%s'\n", $svninfo::Time; + # printf STDERR "yyyyyyyyyyy `%s'\n", $svninfo::Owner; + + # the following code is for oldfashioned latex2hmtl, not anymore supported + # format of $_: + # vvvvvv that's text following the SVN-Id-string + # <#nr#>.....<#nr>...... + # ^ ^ ^ that's the SVN-Id-string +# my ($Nr,$IdString,$Rest) = /(<#\d+#>)(.*)\1(.*)/s ; + + # The Id-String may contain various tags, remove them +# $IdString =~ s/<[^>]*>//g; + + # The Id-String may contain various tags, remove them +# $IdString =~ s/<[^>]*>//g; + + # split the Id-string +# my ($id,$file,$revision,$date,$time,$owner) = split(/\s/,$IdString); + + # remove trailing ,v +# $file =~ s/,v$//; + + # split date +# ($svninfo::Year,$svninfo::Month,$svninfo::Day) = split (/\//,$date); + +# $svninfo::Revision = $revision; +# $svninfo::File = $file; +# $svninfo::Date = $date; +# $svninfo::Time = $time; +# $svninfo::Owner = $owner; + + if ($default_language eq 'german' || $default_language eq 'austrian') { + $svninfo::LongDate = $svninfo::Day . '. ' . + $svninfo::GermanMonthName[$svninfo::Month] . ' ' . + $svninfo::Year; + $svnInfo::Date = $svninfo::Day . '. ' . $svninfo::Month . '. ' . $svninfo::Year; + } elsif ($default_language eq 'french') { + $svninfo::LongDate = $svninfo::Day . '. ' . + $svninfo::FrenchMonthName[$svninfo::Month] . ' ' . + $svninfo::Year; + $svnInfo::Date = $svninfo::Day . '. ' .$svninfo::Month . '. ' . $svninfo::Year; + } else { # english is the default + $svninfo::LongDate = $svninfo::EnglishMonthName[$svninfo::Month] . ' ' . + $svninfo::Day . ', ' . + $svninfo::Year; + $svnInfo::Date = $svninfo::Year . '/' .$svninfo::Month . '/' . $svninfo::Day; + } + + if ($svninfo::OptionFancy == 1) { + &$svninfo::SetAddressProc; + } + svninfo::make_cmds(); + + # printf STDERR "xxx $HTML_VERSION, $HTML_OPTIONS\n"; + # remove stuff generated for the $Id: svninfo.dtx 1168 2005-04-08 06:18:47Z brucker $-string + # we assume that noting follows the "\svnInfo $Id....$" + if ($HTML_VERSION >= 3.2) { + /^<tex2html_verbatim_mark>[^\n]*/; + return $'; + } elsif ($HTML_VERSION == 3.1 || $HTML_VERSION == 2.1) { + /^<tex2html_image_mark>[^\n]*/; + return $'; + } else { + if ($HTML_OPTIONS =~ /math/) { + /^<tex2html_verbatim_mark>[^\n]*/; + return $'; + } else { + /^<tex2html_image_mark>[^\n]*/; + return $'; + } + } +} + +# Replace do_cmd_today (\today) using the SVN date. +sub do_cmd_today { + local($today); + if ($svninfo::OptionToday == 1) { + $today = $svninfo::LongDate; + } else { + if ($default_language eq 'german' || $default_language eq 'austrian') { + $today = (`date "+%m:%d, 20%y"`); + $today =~ s/(\d{1,2}):0?(\d{1,2}),/$2. $svninfo::GermanMonthName[$1]/o; + $today =~ s/20([7|8|9]\d{1})/19$1/o; + } elsif ($default_language eq 'french') { + $today = (`date "+%m:%d, 20%y"`); + $today =~ s/(\d{1,2}):0?(\d{1,2}),/$2 $svninfo::FrenchMonthName[$1]/o; + $today =~ s/20([7|8|9]\d{1})/19$1/o; + } else { # english is the default + $today = (`date "+%m:%d, 20%y"`); + $today =~ s/(\d{1,2}):0?/$svninfo::EnglishMonthName[$1] /o; + $today =~ s/20([7|8|9]\d{1})/19$1/o; + } + } + join('',$today,$_[0]); +} + +1; + +############################################################################### diff --git a/Master/texmf-dist/doc/latex/svninfo/svninfo2html.tex b/Master/texmf-dist/doc/latex/svninfo/svninfo2html.tex new file mode 100644 index 00000000000..38169382a63 --- /dev/null +++ b/Master/texmf-dist/doc/latex/svninfo/svninfo2html.tex @@ -0,0 +1,172 @@ +%% +%% This is file `svninfo2html.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% svninfo.dtx (with options: `header,html') +%% +%% IMPORTANT NOTICE: +%% +%% For the copyright see the source file. +%% +%% Any modified versions of this file must be renamed +%% with new filenames distinct from svninfo2html.tex. +%% +%% For distribution of the original source see the terms +%% for copying and modification in the file svninfo.dtx. +%% +%% This generated file may be distributed as long as the +%% original source files, as listed above, are part of the +%% same distribution. (The sources need not necessarily be +%% in the same archive or directory.) + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% `svninfo' package to use with LaTeX2e. +%% +%% This package is used to extract the revision and file information provided +%% by the Subversion revision control system. +%% A PERL-package supporting svninfo and LaTeX2HTML is provieded too. +%% +%% Copyright (C) 1995 Dr. Juergen Vollmer +%% Copyright (C) 2003-2005 Achim D. Brucker +%% +%% License: +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN +%% archives in directory macros/latex/base/lppl.txt; either +%% version 1 of the License, or any later version. +%% +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% \CheckSum{345} +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} + +\documentclass{article} +\IfFileExists{html.sty}{\usepackage{html}}{} +\usepackage{svninfo} + +\IfFileExists{html.sty}{% +\begin{htmlonly}% +\input{svninfo2html.aux}% +\end{htmlonly}% +}{} + +\newcommand{\LatexToHtml}{\LaTeX 2\texttt{HTML}} +\newcommand{\Var}[1]{\texttt{\$svninfo::#1}} +\newcommand{\SVN}{\emph{SVN}} + +\pagestyle{fancy} + +\begin{document} +\svnInfo $Id: svninfo.dtx 1168 2005-04-08 06:18:47Z brucker $ + +\author{Achim D. Brucker\\ + \small{\texttt{brucker@freiburg.linux.de}}} +\date{\today} +\title{Example for converting a \LaTeX\ document to \texttt{HTML}\\ + using \LatexToHtml\ and the \texttt{svninfo}-package} +\maketitle + +\section{Notes} +%%%%%%%%%%%%%%% + +\begin{itemize} +\item Use at least version \emph{99.1 release (March 30, 1999)} of + \LatexToHtml. + +\item You should \verb|\usepackage{html}|. + +\item You must run \LaTeX\ on the input file before running \LatexToHtml. + +\item In order to make \LatexToHtml\ read the \verb|.aux| file, you must + either: + \begin{itemize} + \item call \LatexToHtml\ with the option + \verb|-show_section_numbers| or + \item include the \verb|.aux| file explicitly in your \LaTeX-source, by + adding the lines in the preamble:\\ +\verb|\begin{|\verb|htmlonly}|\\ % looks ulgy, but otherwise +\verb|\input{|\emph{source}\verb|.aux}|\\ +\verb|\end{|\verb|htmlonly}|\\ % latex2html fails. + which requires \verb|\usepackage{html}|. + \end{itemize} + If you don't do so, the \verb|\svnInfo...| commands give no value. + +\item If using the \LatexToHtml\ tool, only the last \verb|\svnInfo| takes + effect, e.g.~if using several input files each having the \verb|\svnInfo| + command, only the vales of the last included file are used. + (If this is a serious problem for you, drop me a mail). + +\item If the \verb|fancy| / \verb|fancyhdr| option is given to the + \verb|svninfo| package, + the date of the \verb|ADDRESS| at the bottom of the \texttt{HTML} + page is set to the \SVN\ date. + +\item If you would like to set your own \verb|ADDRESS| text, you should + define a procedure, which sets \texttt{perl} \verb|$main::ADDRESS| + variable in your local \texttt{.latex2html} initialization file. + The routine may use the \texttt{perl} + variables shown below. Assign a reference of this procdure to the + \texttt{perl}-variable + \verb|$svninfo::SetAddressProc|. + E.g.\ if you have a \texttt{perl} routine \verb|&my_address_field|, + then \\ + \verb|$svninfo::SetAddressProc = &my_address_field|. + + For example the follownig \texttt{perl}-code does the job: +\begin{verbatim} +sub my_address_field +{ + $ADDRESS = '<hr>This file was last updated on ' . + $svninfo::Date . + ' by ' . + '<a href="mailto: brucker@freiburg.linux.de">' . + 'Achim D. Brucker ' . + '<brucker@freiburg.linux.de></a>'; +} +$svninfo::SetAddressProc = \&my_address_field; +\end{verbatim} +\end{itemize} + +\newpage + +\section{Example} +%%%%%%%%%%%%%%%%% + +\label{sec-examples} +Here are the commands and their output: + +\begin{tabular}{lll} +\LaTeX-command & \texttt{perl} variable & Result for this file \\\hline +\verb|\today| & \texttt{\$today} & \today \\ +\verb|\svnInfoFile| & \Var{File} & \svnInfoFile \\ +\verb|\svnInfoRevision| & \Var{Revision} & \svnInfoRevision \\ +\verb|\svnInfoOwner| & \Var{Owner} & \svnInfoOwner \\ +\verb|\svnInfoDate| & \Var{Date} & \svnInfoDate \\ +\verb|\svnInfoLongDate| & \Var{LongDate} & \svnInfoLongDate \\ +\verb|\svnInfoDay| & \Var{Day} & \svnInfoDay \\ +\verb|\svnInfoMonth| & \Var{Month} & \svnInfoMonth \\ +\verb|\svnInfoYear| & \Var{Year} & \svnInfoYear \\ +\end{tabular} + +\end{document} +\endinput +%% +%% End of file `svninfo2html.tex'. |