diff options
author | Karl Berry <karl@freefriends.org> | 2009-05-06 15:03:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-05-06 15:03:03 +0000 |
commit | bafb761bce627f6f4ca4e263dd68130518b50cf6 (patch) | |
tree | 28764db2f9a390e43517712593f699d69d48c890 /Master/texmf-dist/source/latex/svn-prov/svn-prov.dtx | |
parent | b4afea7b1b3b0414f91a2c2632b1788c2cc6634f (diff) |
svn-prov 1 (3may09)
git-svn-id: svn://tug.org/texlive/trunk@12948 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/svn-prov/svn-prov.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/svn-prov/svn-prov.dtx | 139 |
1 files changed, 96 insertions, 43 deletions
diff --git a/Master/texmf-dist/source/latex/svn-prov/svn-prov.dtx b/Master/texmf-dist/source/latex/svn-prov/svn-prov.dtx index 58f2cfbaaf7..8b0c79f2976 100644 --- a/Master/texmf-dist/source/latex/svn-prov/svn-prov.dtx +++ b/Master/texmf-dist/source/latex/svn-prov/svn-prov.dtx @@ -1,17 +1,24 @@ % \iffalse meta-comment +% $Id: svn-prov.dtx 1049 2009-05-03 00:24:49Z martin $ % % Copyright (C) 2009 by Martin Scharrer <martin@scharrer-online.de> -% ----------------------------------------------------------------- % -% This file may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.2 +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3c % of this license or (at your option) any later version. -% The latest version of this license is in: +% The latest version of this license is in % -% http://www.latex-project.org/lppl.txt +% http://www.latex-project.org/lppl.txt % -% and version 1.2 or later is part of all distributions of LaTeX -% version 1999/12/01 or later. +% and version 1.3c or later is part of all distributions of LaTeX +% version 2008/05/04 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Martin Scharrer. +% +% This work consists of the files svn-prov.dtx, svn-prov.ins +% and the derived file svn-prov.sty. % % \fi % @@ -21,16 +28,14 @@ \makeatletter %</driver> %<*driver|package> -\let\svnprov@orig@fileversion\fileversion -\def\fileversion{v0.\rev} +\def\svnprov@version{v1.\rev} %</driver|package> %<*driver> +\ProvidesFileSVN{$Id: svn-prov.dtx 1049 2009-05-03 00:24:49Z martin $} + [\svnprov@version\space DTX for \filebase.sty] +\DefineFileInfoSVN[svnprov] +\DefineFileInfoSVN \makeatother -\ProvidesFileSVN{$Id: svn-prov.dtx 922 2009-04-26 19:18:53Z martin $} - [\fileversion\space DTX for \filebase.sty] -\GetFileInfoSVN* -\let\svnprovversion\fileversion -\let\svnprovdate\filedate \documentclass{ltxdoc} \usepackage[hyperfootnotes=false]{hyperref} @@ -98,7 +103,7 @@ %</driver> % \fi % -% \CheckSum{220} +% \CheckSum{246} % % \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 @@ -118,6 +123,7 @@ % % % \changes{v0.922}{2009/04/26}{Initial version} +% \changes{v1.}{2009/05/03}{Added \cs{DefineFileInfoSVN} macro.} % % ^^A \GetFileInfo{\jobname.dtx} % @@ -129,7 +135,9 @@ % \title{The \textsf{svn-prov} package\\\large Use SVN Id keywords for package, % class and file header} % \author{Martin Scharrer \\ \url{martin@scharrer-online.de}} -% \date{Version~\svnprovversion\ - \svnprovdate} +% \makeatletter +% \date{Version~\svnprov@version\ - \svnprov@date} +% \makeatother % % \maketitle % @@ -159,7 +167,7 @@ % \texttt{\frenchspacing\${}Id: \meta{filename} \meta{revision} \meta{date} % \meta{time} \meta{author} \$}\\[\smallskipamount] % e.g. for the source file of this document:\\*[\smallskipamount] -% |$Id: svn-prov.dtx 922 2009-04-26 19:18:53Z martin $| +% |$Id: svn-prov.dtx 1049 2009-05-03 00:24:49Z martin $| % \par\smallskip % For this to work the Subversion \emph{property} \texttt{svn:keywords} must be % set to (at least) `|Id|' for the source file(s). e.g.\ using the command @@ -236,6 +244,38 @@ % contains the file description, e.g.\ the content of the optional argument % without date and version. The other macros were already described earlier. % +% \par\medskip +% \DescribeMacro{\DefineFileInfoSVN}\hspace*{-\parindent}\hspace{-\marginparsep}\oarg{name} +% \marginpar{\it New in v1. 2009/05/03}\\ +% Defines a set of macros which provide the information collected by a previous +% \cs{Provides\ldots} macro. The macros have the form +% |\|\meta{name}|@|\meta{data} where \meta{name} is by default the filename +% either with the file extension (general files) or without (packages and +% classes). This default can be overwritten by the optional argument. +% The \meta{data} stands for |version|, |rev| (revision), |date| and |info| (the +% information part without the version number). +% +% \noindent +% \textit{Example:} Applied to the |.dtx| file of this very package the +% following macros are defined:\par +% \begingroup +% \makeatletter\centering +% \begin{tabular}{ll} +% Macro & Definition \\ +% \hline +% \cs{svn-prov.dtx@version} & \@nameuse{svn-prov.dtx@version} \\ +% \cs{svn-prov.dtx@rev} & \@nameuse{svn-prov.dtx@rev} \\ +% \cs{svn-prov.dtx@date} & \@nameuse{svn-prov.dtx@date} \\ +% \cs{svn-prov.dtx@info} & \@nameuse{svn-prov.dtx@info} \\ +% \end{tabular} +% \\[\medskipamount] +% The style file however would get macros like \cs{svn-prov@version}. +% Because `|-|' is not a letter the macros can only be accessed using |\csname|. +% Therefore the optional argument |[svnprov]| is used to name the macros +% \cs{svnprov@version} etc.. +% \endgroup +% +% % \section{Examples} % \begingroup % \def\{{\texttt{\char`\{}}% @@ -262,66 +302,66 @@ % \subsubsection*{Minimal usage} % \begin{example} % \ProvidesPackageSVN -% {$Id: svn-prov.dtx 922 2009-04-26 19:18:53Z martin $} +% {$Id: svn-prov.dtx 1049 2009-05-03 00:24:49Z martin $} % \end{example} % \begin{example} % \ProvidesClassSVN -% {$Id: svn-prov.dtx 922 2009-04-26 19:18:53Z martin $} +% {$Id: svn-prov.dtx 1049 2009-05-03 00:24:49Z martin $} % \end{example} % \begin{example} % \ProvidesFileSVN -% {$Id: svn-prov.dtx 922 2009-04-26 19:18:53Z martin $} +% {$Id: svn-prov.dtx 1049 2009-05-03 00:24:49Z martin $} % \end{example} % % \subsubsection*{Normal Usage} % \begin{example} % \ProvidesPackageSVN -% {$Id: svn-prov.dtx 922 2009-04-26 19:18:53Z martin $} +% {$Id: svn-prov.dtx 1049 2009-05-03 00:24:49Z martin $} % [v1.0 Example Description] % \end{example} % \begin{example} % \ProvidesClassSVN -% {$Id: svn-prov.dtx 922 2009-04-26 19:18:53Z martin $} +% {$Id: svn-prov.dtx 1049 2009-05-03 00:24:49Z martin $} % [v1.0 Example Description] % \end{example} % \begin{example} % \ProvidesFileSVN -% {$Id: svn-prov.dtx 922 2009-04-26 19:18:53Z martin $} +% {$Id: svn-prov.dtx 1049 2009-05-03 00:24:49Z martin $} % [v1.0 Example Description] % \end{example} % % \subsubsection*{Overwriting Name} % \begin{example} % \ProvidesPackageSVN[othername] -% {$Id: svn-prov.dtx 922 2009-04-26 19:18:53Z martin $} +% {$Id: svn-prov.dtx 1049 2009-05-03 00:24:49Z martin $} % [v1.0 Example Description] % \end{example} % % \subsubsection*{Overwriting Name including unneeded Extension} % \begin{example} % \ProvidesPackageSVN[othername.sty] -% {$Id: svn-prov.dtx 922 2009-04-26 19:18:53Z martin $} +% {$Id: svn-prov.dtx 1049 2009-05-03 00:24:49Z martin $} % [v1.0 Example Description] % \end{example} % % \subsubsection*{Overwriting Name using Macros} % \begin{example} % \ProvidesFileSVN[\filebase.cfg] -% {$Id: svn-prov.dtx 922 2009-04-26 19:18:53Z martin $} +% {$Id: svn-prov.dtx 1049 2009-05-03 00:24:49Z martin $} % [v1.0 Example Description] % \end{example} % % \subsubsection*{Using Macros in File Information String} % \begin{example} % \ProvidesPackageSVN -% {$Id: svn-prov.dtx 922 2009-04-26 19:18:53Z martin $} +% {$Id: svn-prov.dtx 1049 2009-05-03 00:24:49Z martin $} % [v1.\Rev Example Description] % \end{example} % % \subsubsection*{Adding Text to Default Information} % \begin{example} % \ProvidesPackageSVN -% {$Id: svn-prov.dtx 922 2009-04-26 19:18:53Z martin $} +% {$Id: svn-prov.dtx 1049 2009-05-03 00:24:49Z martin $} % [v1.\Rev Extra Text \revinfo] % \end{example} % @@ -331,7 +371,7 @@ % % \begin{example} % \ProvidesPackageSVN -% {$Id: svn-prov.dtx 922 2009-04-26 19:18:53Z martin $} +% {$Id: svn-prov.dtx 1049 2009-05-03 00:24:49Z martin $} % [v1.\Rev Extra Text \revinfo] % \GetFileInfoSVN* % % ... @@ -557,7 +597,7 @@ % % This macro is inspired by the macro \cs{GetFileInfo}\marg{file name} from the % \texttt{doc} package. -% \begin{macrocode} +% \begin{macrocode} \def\GetFileInfoSVN#1{% \ifx*#1\relax \let\filebase\svnprov@filebase @@ -565,9 +605,10 @@ \let\filename\svnprov@filename \let\filedate\svnprov@filedate \let\filerev\svnprov@filerev - \let\fileinfo\svnprov@fileinfo \expandafter\svnprov@getversion \svnprov@fileinfo\relax{} \relax\svnprov@endmarker + \let\fileversion\svnprov@fileversion + \let\fileinfo\svnprov@fileinfoonly \else \PackageError{svn-prov}{Macro \textbackslash GetFileInfoSVN without '*' is not implemented yet.}{}{}{}% @@ -576,16 +617,35 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\DefineFileInfoSVN} +% Defines macros in the form |\|\meta{filename}|@|\meta{xxx}, where \meta{xxx} +% is date, version, rev(ision) and info. +% \begin{macrocode} +\newcommand*\DefineFileInfoSVN[1][\svnprov@filemask]{% + \expandafter\svnprov@getversion + \svnprov@fileinfo\relax{} \relax\svnprov@endmarker + \expandafter + \let\csname#1@date\endcsname\svnprov@filedate + \expandafter + \let\csname#1@version\endcsname\svnprov@fileversion + \expandafter + \let\csname#1@rev\endcsname\svnprov@filerev + \expandafter + \let\csname#1@info\endcsname\svnprov@fileinfoonly +} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\svnprov@getversion} % Splits the string at the first space into arguments \#1 (version) and \#2 % (info). Argument \#3 will be empty if there was no space in the string. % \begin{macrocode} \def\svnprov@getversion#1 #2\relax#3\svnprov@endmarker{% \if&% - \def\fileversion{??}% + \def\svnprov@fileversion{??}% \else - \def\fileversion{#1}% - \def\fileinfo{#2}% + \def\svnprov@fileversion{#1}% + \def\svnprov@fileinfoonly{#2}% \fi } % \end{macrocode} @@ -593,16 +653,9 @@ % % Finally, call the macro for this package itself. % \begin{macrocode} -\ProvidesPackageSVN{$Id: svn-prov.dtx 922 2009-04-26 19:18:53Z martin $}% - [\fileversion\space Package Date/Version from SVN Keywords] -% \end{macrocode} -% The macro \cs{fileversion} is restored to it original value which it had -% before this package was loaded. -% \begin{macrocode} -\let\fileversion\svnprov@orig@fileversion -\let\svnprov@orig@fileversion\@undefined +\ProvidesPackageSVN{$Id: svn-prov.dtx 1049 2009-05-03 00:24:49Z martin $}% + [\svnprov@version\space Package Date/Version from SVN Keywords] % \end{macrocode} % % \Finale -\endinput |