From 5406b8e0ea1d596600f773e766975256e4087c51 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 10 Apr 2010 21:56:52 +0000 Subject: new latex package ydoc (10apr10) git-svn-id: svn://tug.org/texlive/trunk@17793 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/ydoc/README | 9 + Master/texmf-dist/doc/latex/ydoc/ydoc.pdf | Bin 0 -> 634366 bytes Master/texmf-dist/source/latex/ydoc/ydoc.dtx | 1862 ++++++++++++++++++++++ Master/texmf-dist/source/latex/ydoc/ydoc.ins | 26 + Master/texmf-dist/tex/latex/ydoc/ydoc-code.sty | 199 +++ Master/texmf-dist/tex/latex/ydoc/ydoc-desc.sty | 407 +++++ Master/texmf-dist/tex/latex/ydoc/ydoc-doc.sty | 119 ++ Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty | 84 + Master/texmf-dist/tex/latex/ydoc/ydoc.cls | 38 + Master/texmf-dist/tex/latex/ydoc/ydoc.sty | 44 + Master/tlpkg/bin/tlpkg-ctan-check | 2 +- Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc | 1 + Master/tlpkg/tlpsrc/ydoc.tlpsrc | 0 13 files changed, 2790 insertions(+), 1 deletion(-) create mode 100644 Master/texmf-dist/doc/latex/ydoc/README create mode 100644 Master/texmf-dist/doc/latex/ydoc/ydoc.pdf create mode 100644 Master/texmf-dist/source/latex/ydoc/ydoc.dtx create mode 100644 Master/texmf-dist/source/latex/ydoc/ydoc.ins create mode 100644 Master/texmf-dist/tex/latex/ydoc/ydoc-code.sty create mode 100644 Master/texmf-dist/tex/latex/ydoc/ydoc-desc.sty create mode 100644 Master/texmf-dist/tex/latex/ydoc/ydoc-doc.sty create mode 100644 Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty create mode 100644 Master/texmf-dist/tex/latex/ydoc/ydoc.cls create mode 100644 Master/texmf-dist/tex/latex/ydoc/ydoc.sty create mode 100644 Master/tlpkg/tlpsrc/ydoc.tlpsrc (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/ydoc/README b/Master/texmf-dist/doc/latex/ydoc/README new file mode 100644 index 00000000000..a71bac2e54d --- /dev/null +++ b/Master/texmf-dist/doc/latex/ydoc/README @@ -0,0 +1,9 @@ +The 'ydoc' class and packages +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +'ydoc' provides macros and environments to document LaTeX packages and classes. +It is an alternative to the 'ltxdoc' class and 'doc' package. +It targets a different layout and tries to provide more modern styles (xcolor, hyperref, etc.). + +This is an alpha release. It should not be used yet for other packages. + diff --git a/Master/texmf-dist/doc/latex/ydoc/ydoc.pdf b/Master/texmf-dist/doc/latex/ydoc/ydoc.pdf new file mode 100644 index 00000000000..720589586e5 Binary files /dev/null and b/Master/texmf-dist/doc/latex/ydoc/ydoc.pdf differ diff --git a/Master/texmf-dist/source/latex/ydoc/ydoc.dtx b/Master/texmf-dist/source/latex/ydoc/ydoc.dtx new file mode 100644 index 00000000000..9335c986862 --- /dev/null +++ b/Master/texmf-dist/source/latex/ydoc/ydoc.dtx @@ -0,0 +1,1862 @@ +% \iffalse +%% Copyright (c) 2010 by Martin Scharrer +%% WWW: http://latex.scharrer-online.de/ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 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 ydoc.dtx and ydoc.ins +%% and the derived file ydoc.cls, ydoc.sty, ydoc-code.sty, +%% ydoc-expl.sty and ydoc-desc.sty. +%% +% \fi +% +% \iffalse +%<*driver|class|package|code|desc|expl|doc> +\RequirePackage{svn-prov}[2010/04/03] +% +%<*driver> +\ProvidesFileSVN[ydoc.dtx] +% +%\NeedsTeXFormat{LaTeX2e}[1999/12/01] +%\ProvidesClassSVN +%\ProvidesPackageSVN +% [ydoc-code] +% [ydoc-desc] +% [ydoc-expl] +% [ydoc-doc] +%<*driver|class|package|code|desc|expl|doc> + {$Id: ydoc.dtx 1847 2010-04-10 10:57:11Z martin $} + [v0.1alpha] +% +% [ydoc class: document LaTeX class and packages] +% [ydoc package: document LaTeX class and packages] +% [ydoc package to document macro code] +% [ydoc package to describe macros, environments, options etc.] +% [ydoc package to insert live examples of LaTeX code] +% [ydoc package to provide 'doc' macros] +% +%<*driver> +\DefineFileInfoSVN +\GetFileInfoSVN* +\documentclass{ydoc}[\filedate] + +\usepackage{xcolor} +\usepackage{hyperref} +\usepackage{lmodern} +\usepackage{listings} +\usepackage{booktabs} + +\newdimen\tempskip + +\def\tablecaption{% + \tempskip=\abovecaptionskip + \abovecaptionskip=\belowcaptionskip + \belowcaptionskip=\tempskip + \caption +} + +\begin{document} + \DocInput{ydoc.dtx} + \PrintChanges + \PrintIndex +\end{document} +% +% \fi +% +% \CheckSum{1151} +% +% \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 \~} +% +% +% \changes{v0.1alpha}{2010/04/10}{First released alpha version} +% +% \DoNotIndex{\newcommand,\newenvironment} +% +% \GetFileInfoSVN{ydoc.dtx} +% +% \title{The \textsf{ydoc} Class and Packages} +% \author{Martin Scharrer \\ \href{mailto:martin@scharrer-online.de}{martin@scharrer-online.de} \\ +% \url{http://latex.scharrer-online.de/ydoc/}\\ +% CTAN: \url{http://tug.ctan.org/pkg/ydoc}} +% \makeatletter +% \date{Version \expandafter\@gobble\fileversion\\[0.5ex]\filedate} +% \makeatother +% +% \maketitle +% +% \ifpdf +% \hypersetup{% +% pdfauthor = {Martin Scharrer }, +% pdftitle = {The ydoc package, \fileversion, \filedate}, +% pdfsubject = {Documentation of LaTeX package ydoc.}, +% pdfkeywords = {ydoc, documentation, LaTeX} +% }% +% \fi +% +% +% \begin{abstract} +% {\color{red}\bfseries This package bundle is currently under development. +% All functionality, settings and macro as well as file names can change in later versions and may be incomplete! +% It is not ready yet to be used for other packages. +% } +% +% The \pkg{ydoc} class and packages provide macros to document the functionality and implementation of \LaTeX{} classes and packages. +% It is similar to the \pkg{ltxdoc} class with the \pkg{doc} package, but uses more modern features/packages by default +% (e.g.\ \pkg{xcolor}, \pkg{hyperref}, \pkg{listings}). However, some of the features like code indexing is not yet included. +% \end{abstract} +% +% \section{Introduction} +% The \pkg{ydoc} packages allow the documentation of \LaTeX\ packages and classes. +% The name stands for ``\emph{Y}et another \emph{Doc}umentation Package'' and is a pun on +% the fact that there are several documentation packages written by package developers +% to document their own packages. All these packages didn't suited the author and therefore he, +% take a guess, wrote his own documentation package. +% It (will) support(s) all macros and environments (but not necessary with full/identical features) provided by the \pkg{doc} +% package to allow the fast adaption of existing |.dtx| files. +% +% This documentation uses the \pkg{ydoc} packages itself and therefore also acts as a live example. +% +% \subsection{\pkg{ydoc} Files} +% The \pkg{ydoc} bundle consists (at the moment, subject to change) of the \cls{ydoc} class and the packages \pkg{ydoc}, \pkg{ydoc-code}, +% \pkg{ydoc-desc}, \pkg{ydoc-expl} and \pkg{ydoc-doc}. The \cls{ydoc} class and package allow the user the freedom to use the functionality with other classes if wanted. +% The class will load the package. The \pkg{ydoc} package loads the packages \pkg{ydoc-code}, \pkg{ydoc-desc}, \pkg{ydoc-expl} and \pkg{ydoc-doc}, which +% provide the functionality to document \LaTeX\ code implementation, describe the user-level macro, include live code examples and provide replacements for the +% macros of the \pkg{doc} package, respectively. +% This packages can be loaded on their own in other kind of \LaTeX\ documents if required. +% +% \subsection{Similar Packages} +% Other documentation related classes and packages are \pkg{ltxdoc}, \pkg{doc}, \pkg{dox}, \pkg{xdoc}, \pkg{gmdoc}, \pkg{pauldoc}, \pkg{hypdoc}, +% \pkg{codedoc}, \pkg{nicetext} and \pkg{tkz-doc}. +% +% +% \section{Usage} +% (section incomplete) +% +% \subsection{Code Documentation Environments} +% +% \begin{DescribeEnv}{macro}{}[]!\color{optional}\colorlet{meta}{metaoptional}!{}!\ldots!{} +% \MacroArgs\\ +% \begin{DescribeEnv}{macrocode} +% \MacroArgs +% \end{DescribeEnv}\\ +% \ldots +% \end{DescribeEnv} +% The implementation of macros can be documented using this environment. The actual \meta{macro code} must be placed in a \env{macrocode} environment. +% Longer macro definition can be split using multiple \env{macrocode} environments with interleaved documentation texts. +% +% The \pkg{ydoc} definition of the \env{macro} environment has an additional feature compare to \pkg{doc}. The arguments of the macro (|#1|, |#2|, \ldots) can be +% documented in a vertical list. The environment has an optional argument to declare the \meta{number of arguments} the macro implementation has. +% The descriptions of this macro arguments are read from the next arguments of the environment. If the \meta{number of arguments} is not given or zero (or less) +% no further arguments are read by the \env{macro} environment. +% +% \begin{DescribeEnv}{macrocode} +% \MacroArgs +% \end{DescribeEnv} +% This environment wraps around any \TeX\ code and types it verbatim. The environment end is read verbatim as well and must be written on a separate +% line beginning with a percent followed by exactly four spaces: `\verb*+% \end{macrocode}+'. +% +% \begin{DescribeEnv}{environment}{}[]!\color{optional}\colorlet{meta}{metaoptional}!{}!\ldots!{} +% \MacroArgs\\ +% \begin{DescribeEnv}{macrocode} +% \MacroArgs +% \end{DescribeEnv}\\ +% \ldots +% \end{DescribeEnv} +% This environment provides the same functionality as the \env{macro} environment above, but for environments instead. +% +% +% \subsection{Description Macros and Environments} +% +% \DescribeMacro\DescribeMacro<\textbackslash macro> +% The \cs{DescribeMacro} is used to describe macros included their arguments. +% It takes the to be described \meta{\textbackslash macro} as first argument (can also be enclosed in |{ }|). +% The macro name can include `|@|'. Any number of \meta{macro arguments} (in a broad sense, see Table~\ref{tab:macroargs}) following it +% are formatted as arguments of this macro. +% Any following non-argument token (normal text, macro, etc.)\ will make \cs{DescribeMacro} stop collecting arguments. +% For example, if a \TeX\ group should be started using |{ }| direct after \cs{DescribeMacro} a |\relax| (or a similar macro) should be inserted +% between them, otherwise the group will be taken as mandatory argument of the described macro. +% +% Multiple \cs{DescribeMacro} in a row will automatically stacked inside one framed box. If this is not wanted simply separate them with |\relax| +% or any other macro or token. See also the \env{DescribeMacros} environment below. +% +% \subsubsection*{Examples:} +% \par\noindent |\DescribeMacro\mymacro*[]{}| will result in\\ +% \mbox{\Macro\mymacro*[]{}} (inside a framed box). +% \par\medskip\noindent The above syntax description of \cs{DescribeMacro} itself was typeset with\\ +% |\DescribeMacro\DescribeMacro<\textbackslash macro>|. +% \par\medskip\noindent Special macros with have a partner macro as end marker can be typeset like this:\\ +% |\DescribeMacro\csname\AlsoMacro\endcsname|, which will result in\\ +% \mbox{\Macro\csname\AlsoMacro\endcsname}. +% +% \DescribeMacro\Macro<\textbackslash macro> +% This macro is like an in-text version of \cs{DescribeMacro}. +% The macro description stays as part of the surrounding text and is not placed inside a framed box. +% The description can be broken between lines. This can be avoided by placing it inside a |\mbox{}|. +% \cs{Macro} is equivalent to \cs{MacroArgs}\cs{AlsoMacro}. +% +% \DescribeMacro\MacroArgs +% This macro formats the \meta{macro arguments} the same way as \cs{DescribeMacro} and \cs{Macro} but without a macro name. +% Like \cs{Macro} the description is placed in-text. +% +% \DescribeMacro\AlsoMacro<\textbackslash macro> +% This macro can only be used inside the \meta{macro arguments} of the above macros and typesets an additional macro as part +% of the syntax of the described macro. The additional macro is normally an end- or other marker of some kind. Further macro arguments may +% follow. Macros which are not part of the syntax but normal arguments should be written as +% |<\textbackslash name>| (yielding \MacroArgs<\textbackslash name>) instead. +% +% \subsubsection*{Example:} +% |\Macro\@for<\textbackslash var> ':=' \AlsoMacro\do {}|\\ +% \Macro\@for<\textbackslash var> ':=' \AlsoMacro\do {}\\ +% +% \begin{DescribeEnv}{DescribeMacros} +% \Macro\Macro<\textbackslash name>\\ +% \Macro\Macro<\textbackslash name>\\ +% \ldots +% \end{DescribeEnv} +% This environment can be used to place multiple macro description into the same framed box. +% The macros are described using \cs{Macro}, which has a slightly different definition than outside of this environment, to place the +% description into a |\hbox|. The environment stacks these |\hbox|es in a |\vbox|. The macros can also be placed freely using anything +% which produces a |\hbox|, e.g.\ |\hbox{\Macro\A ~~~ \Macro\B}| or using +% a |tabular| (see also \env{DescribeMacrosTab}). +% +% \DescribeEnv[]{DescribeMacrosTab}{} +% This is a special version of the \env{DescribeMacros} environment which adds a tabular environment around the content. +% This is useful if a large set of small macros should be desribed at once. Placing them all below each other would result in a very bad page layout. +% The environment has one argument which is passed to \env{tabular} as the column definition. A `|@{}|' is added before and after to remove any margins. +% +% +% \begin{DescribeEnv}{DescribeEnv}{} +% \MacroArgs\relax\space |\\|\\ +% \MacroArgs +% \end{DescribeEnv} +% \vspace{-\beforedescskip} +% \DescribeMacro\DescribeEnv[]{} +% The \env{DescribeEnv} can be used to describe environments in the same way the \cs{DescribeMacro} macro describes macros. +% Supported \meta{arguments} are shown in Table~\ref{tab:macroargs}. +% Potential \meta{body content} can be placed between the begin and end of the environment description to explain the user what kind of material +% should be placed inside it. +% The environment also exists in macro form as \cs{DescribeEnv}, which allows to provide small \meta{body content} as an optional argument. +% Please note that for this optional argument a \cs{MacroArgs} is automatically inserted, but not for the \cs{DescribeEnv} environment content. +% +% The body content is placed into a indented |\hbox{}| stacked inside a |\vbox{}| also holding the environment begin and end line. +% The |\\| macro is redefined to create a new indented |\hbox| acting as new code line. +% Therefore this environment is similar to a one-column \env{tabular}: all macros placed into a line are only valid up to the next line end. +% +% \begin{table} +% \tablecaption{Supported `arguments' for \cs{DescribeMacro}/\cs{DescribeEnv}/\cs{MacroArgs}.}\label{tab:macroargs} +% \begin{tabular}{llll} +% \toprule +% Description & Syntax & Result & Macro$^{a}$ \\ +% \midrule +% Meta text & || & \MacroArgs & |\meta| \\ +% Mandatory Argument & |{}| & \MacroArgs{} & |\marg| \\ +% ---, without meta text & |{text}| & \MacroArgs{text} & \\ +% Optional Argument & |[]| & \MacroArgs[] & |\oarg| \\ +% ---, without meta text & |[text]| & \MacroArgs[text] & \\ +% Picture Argument & |()| & \MacroArgs() & |\parg| \\ +% ---, without meta text & |(text)| & \MacroArgs(text) & \\ +% Beamer Overlay Argument & |<>| & \MacroArgs<> & |\aarg| \\ +% ---, without meta text & |'<'text'>'| & \MacroArgs'<'text'>' \\ +% Star & |*| & \MacroArgs* \\ +% \midrule +% Verbatim content & |'$&^%_#$\'| & \MacroArgs'$&^%_#$\' \\ +% ---, produce |'| char & |''| & \MacroArgs'' \\ +% Insert any \TeX\ code & |!\fbox{T}!| & \MacroArgs!\fbox{T}! \\ +% Unbreakable Space & |~| & \\ +% Space (explicit macro) & |\space| & \\ +% \midrule +% Second macro (e.g.\ endmarker) & |\AlsoMacro\macro| & \MacroArgs\AlsoMacro\macro \\ +% \bottomrule +% \multicolumn{4}{l}{{\Large\strut}$^{a}$) As alternative to be used inside normal text.} +% \end{tabular} +% \end{table} +% +% \DescribeMacro\DescribeLength<\textbackslash name>{} +% This macro can be used to describe \LaTeX\ lengths also known as dimensions. Multiple \cs{DescribeLength} macros in a row will automatically be grouped. +% +% \subsection{Format Macros} +% \begin{DescribeMacrosTab}{ll} +% \Macro\cs{} & \Macro\env{} \\ +% \Macro\pkg{} & \Macro\cls{} \\ +% \end{DescribeMacrosTab} +% This macros can be used to format names of macros, environments, packages and classes, respectively. +% At the moment they simply use |\texttt|. +% +% \DescribeMacros\hbox{\Macro\bslash~~~~\Macro\percent~~~~\Macro\braceleft~~~~\Macro\braceright}\endDescribeMacros +% This macros define expandable backslash (\texttt{\bslash}$_{12}$), percent char (\texttt{\percent}$_{12}$), +% and left (\texttt{\braceleft}$_{12}$) and right (\texttt{\braceright}$_{12}$) braces with catcode 12 (other), respectively. +% They should only be used with text-typer font when used in text, because other fonts might not have the +% correct characters. The macros must be protected when used in a moving argument. +% +% \DescribeMacrosTab{@{}ll@{}} +% \Macro\meta{} & +% \Macro\marg{} \\ +% \Macro\oarg{} & +% \Macro\parg{} \\ +% \Macro\aarg{} & +% \Macro\sarg \\ +% \endDescribeMacrosTab +% This macros allow to typeset meta text and mandatory, optional, picture and beamer overlay arguments as well as a star symbol. +% They are used internally by \cs{MacroArgs} and friends. See Table~\ref{tab:macroargs} for examples. +% +% \DescribeMacrosTab{ll} +% \Macro\metastyle & +% \Macro\margstyle \\ +% \Macro\oargstyle & +% \Macro\pargstyle \\ +% \Macro\aargstyle & +% \Macro\sargstyle \\ +% \endDescribeMacrosTab +% This macros are used to define the style in which the corresponding macros above are being formatted. +% They are used like \MacroArgs '{'<\textbackslash stylemacro>{}'}' to allow the styles to +% use macros like |\ttfamily| or |\texttt|\marg{material}. By default the optional argument and the also optional star are +% printed in the color `|optional|' which is a 65\% gray. +% +% \subsection{Settings} +% The following macro and dimensions can be redefined by the user to adjust the layout of the package documentation. +% +% \DescribeLength\descindent {-20pt} +% \DescribeLength\beforedescskip{~12pt plus 4pt minus 4pt} +% \DescribeLength\afterdescskip {~~6pt plus 2pt minus 2pt} +% These length define the indention and vertical distances before and after a \cs{Describe\ldots} macro or environment, respectively. +% +% \DescribeLength\descsep {1em in \texttt{tt} font = 10.5pt} +% This macro defines the space on the left and right side between the description text and the framed box. +% +% \subsection{Macros and Environments to include LaTeX Code Examples} +% \DescribeEnv{example} +% \DescribeEnv{examplecode} +% (to be written) +% +% \StopEventually{} +% +% \clearpage +% \section{Implementation} +% +% \iffalse +%<*class> +% \fi +% \subsection{Class File} +% \begin{macrocode} +\LoadClassWithOptions{article} +%%\RequirePackage{doc} +\RequirePackage{ydoc} +% \end{macrocode} +% \iffalse +% +% \fi +% +% \iffalse +%<*package> +% \fi +% \subsection{Package File} +% \begin{macrocode} +\RequirePackage{ydoc-code} +\RequirePackage{ydoc-expl} +\RequirePackage{ydoc-desc} +\RequirePackage{ydoc-doc} + +\RequirePackage{newverbs} +\MakeSpecialShortVerb{\qverb}{\"} +\AtBeginDocument{\catcode`\^^A=14\relax} +% \end{macrocode} +% \iffalse +% +% \fi +% +% \iffalse +%<*code> +% \fi +% +% \subsection{Macros and Environments to document Implementations} +% +% \subsubsection{Color and style definitions} +% \begin{macrocode} +\RequirePackage{xcolor} +\definecolor{macroimpl}{rgb}{0.0,0.0,0.4} +% \end{macrocode} +% +% \subsubsection{General Macros} +% +% \begin{macro}{\ydocwrite} +% \begin{macrocode} +\@ifundefined{ydocwrite}{% + \newwrite\ydocwrite +}{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ydocfname} +% \begin{macrocode} +\@ifundefined{ydocfname}{% + \def\ydocfname{\jobname.cod}% +}{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ydoc@catcodes} +% \begin{macrocode} +\def\ydoc@catcodes{% + \let\do\@makeother + \dospecials + \catcode`\\=\active + \catcode`\^^M=\active + \catcode`\ =\active +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Handling Macrocode} +% \begin{environment}{macrocode} +% \begin{macrocode} +\def\macrocode{% + \par\noindent + \begingroup + \ydoc@catcodes + \macro@code +} +\def\endmacrocode{} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\macro@code}[1]{verbatim macro code} +% \begin{macrocode} +\begingroup +\endlinechar\m@ne +\@firstofone{% +\catcode`\|=0\relax +\catcode`\(=1\relax +\catcode`\)=2\relax +\catcode`\*=14\relax +\catcode`\{=12\relax +\catcode`\}=12\relax +\catcode`\ =12\relax +\catcode`\%=12\relax +\catcode`\\=\active +\catcode`\^^M=\active +\catcode`\ =\active +}* +|gdef|macro@code#1^^M% \end{macrocode}(* +|endgroup|expandafter|macro@@code|expandafter(|ydoc@removeline#1|noexpand|lastlinemacro^^M)* +)* +|gdef|ydoc@removeline#1^^M(|noexpand|firstlinemacro)* +|gdef|ydoc@defspecialmacros(* +|def^^M(|noexpand|newlinemacro)* +|def (|noexpand|spacemacro)* +|def\(|noexpand|bslashmacro)* +)* +|gdef|ydoc@defrevspecialmacros(* +|def|newlinemacro(|noexpand^^M)* +|def|spacemacro(|noexpand )* +|def|bslashmacro(|noexpand\)* +)* +|endgroup +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\macro@@code}[1]{verbatim macro code} +% \begin{macrocode} +\def\macro@@code#1{% + {\ydoc@defspecialmacros + \xdef\themacrocode{#1}}% + \PrintMacroCode + \end{macrocode}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\linenumberbox} +% \begin{macrocode} +\def\newlinemacro{\\\null} +\def\spacemacro{\ } +\def\bslashmacro{\char92} +\def\lastlinemacro#1{} +\def\firstlinemacro{\linenumberbox} +\def\newlinemacro{\\\linenumberbox} +\newcounter{linenumber} +\def\linenumberbox{% + \hbox to 1.25em{}% + \llap{% + \stepcounter{linenumber}% + {\footnotesize\color{gray}\thelinenumber~}% + }% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PrintMacroCode} +% \begin{macrocode} +\def\PrintMacroCode{% + \begingroup + \ttfamily + \noindent\themacrocode + \endgroup +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PrintMacroCode} +% \begin{macrocode} +\RequirePackage{listings} +% \end{macrocode} +% \begin{macrocode} +\def\PrintMacroCode{% + \begingroup + \let\firstlinemacro\empty + \let\lastlinemacro\empty + \def\newlinemacro{^^J}% + \let\bslashmacro\bslash + \let\spacemacro\space + \immediate\openout\ydocwrite=\ydocfname\relax + \immediate\write\ydocwrite{\themacrocode}% + \immediate\closeout\ydocwrite + \@nameuse{ydoc@countbslashes}% + \ydoclistingssettings + \let\input\@input + \lstinputlisting{\ydocfname}% + \endgroup +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\ydoclistingssettings} +% \begin{macrocode} +\def\ydoclistingssettings{% + \lstset{% + language=[latex]tex,basicstyle=\ttfamily, + numbers=left,numberstyle=\tiny\color{gray},firstnumber=last, + breaklines,prebreak={\mbox{\tiny$\swarrow$}}% + }% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\macro@impl@args}[1]{number of macro arguments} +% \begin{macrocode} +\def\macro@impl@args[#1]{% + \begingroup + \parindent=10pt\relax + \let\macro@impl@argcnt\@tempcnta + \let\macro@impl@curarg\@tempcntb + \macro@impl@argcnt=#1\relax + \macro@impl@curarg=0\relax + \ifnum\macro@impl@curarg<\macro@impl@argcnt\relax + \expandafter\macro@impl@arg + \else + \expandafter\macro@impl@endargs + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\macro@impl@endargs} +% \begin{macrocode} +\def\macro@impl@endargs{% + \endgroup + \unskip\par\noindent\ignorespaces +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\macro@impl@argline}[2]{argument number}{argument description} +% \begin{macrocode} +\def\macro@impl@argline#1#2{% + \par{\texttt{\##1}:~#2}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\macro@impl@arg}[1]{argument description} +% \begin{macrocode} +\def\macro@impl@arg#1{% + \advance\macro@impl@curarg by\@ne\relax + \macro@impl@argline{\the\macro@impl@curarg}{#1}% + \ifnum\macro@impl@curarg<\macro@impl@argcnt\relax + \expandafter\macro@impl@arg + \else + \expandafter\macro@impl@endargs + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{macro}[1]{implemented macro} +% \begin{macrocode} +\def\macro#1{% + \PrintMacroImplName{#1}% + \@ifnextchar[%] + {\macro@impl@args}% + {}% +} +\def\endmacro{} +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{environment}[1]{environment name} +% \begin{macrocode} +\def\environment#1{% + \PrintEnvImplName{#1}% + \@ifnextchar[%] + {\macro@impl@args}% + {}% +} +\def\endenvironment{} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\PrintMacroImplName}[1]{macro (token)} +% \begin{macrocode} +\def\PrintMacroImplName#1{% + \par\bigskip\noindent + \hbox{\hspace*{\descindent}\fbox{{\implstyle{\string#1}}}}% + \par\medskip\noindent +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PrintEnvImplName}[1]{environment name} +% test +% \begin{macrocode} +\def\PrintEnvImplName#1{% + \par\bigskip\noindent + \hbox{\hspace*{\descindent}\fbox{{\implstyle{#1}}}}% + \par\medskip +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\implstyle} +% \begin{macrocode} +\def\implstyle{\ttfamily\bfseries\color{macroimpl}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\bslash} +% Defines an expandable backslash with catcode 12: `\texttt{\bslash}$_{12}$'. +% The |\@firstofone| trick is used to read the |\gdef\bslash| code before changing the catcode. +% \begin{macrocode} +{% +\@firstofone{% + \catcode`\\=12 + \gdef\bslash +}{\} +}%} +% \end{macrocode} +% \end{macro} +% +% \iffalse +% +% \fi +% +% +% \subsection{Provide \pkg{doc} macros} +% +% \iffalse +%<*doc> +% \fi +% +% \begin{macro}{\ydoc@countbslashes} +% Reads the macro code into a temp box. The backslashes are defined to increase a counter. +% \begin{macrocode} +\newcount\ydoc@bslashcnt +\def\ydoc@countbslashes{% + \begingroup + \let\firstlinemacro\empty + \let\lastlinemacro\empty + \let\newlinemacro\empty + \let\spacemacro\empty + \def\bslashmacro{\global\advance\ydoc@bslashcnt by\@ne}% + \setbox\@tempboxa\hbox{\themacrocode}% + \endgroup +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\CheckSum} +% \begin{macrocode} +\def\CheckSum#1{% + \gdef\ydoc@checksum{#1}% +} +\let\ydoc@checksum\z@ +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\AlsoImplementation} +% \begin{macro}{\OnlyDescription} +% \begin{macro}{\StopEventually} +% \begin{macro}{\Finale} +% The first two macros modify the \cs{StopEventually} macro which either +% stores its argument in \cs{Final} or executes it itself. +% \begin{macrocode} +\def\AlsoImplementation{% + \gdef\StopEventually##1{% + \@bsphack + \gdef\Finale{##1\ydoc@checkchecksum}% + \@esphack + }% +} +\AlsoImplementation +\def\OnlyDescription{% + \@bsphack + \long\gdef\StopEventually##1{##1\endinput}% + \@esphack +} +\let\Finale\relax +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\MakePercentComment} +% \begin{macro}{\MakePercentIgnore} +% \begin{macrocode} +\def\MakePercentIgnore{\catcode`\%9\relax} +\def\MakePercentComment{\catcode`\%14\relax} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\DocInput} +% \begin{macrocode} +\def\DocInput#1{\MakePercentIgnore\input{#1}\MakePercentComment} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\CharacterTable} +% \begin{macrocode} +\providecommand*\CharacterTable[1]{% + \PackageWarning{ydoc}{Ignoring Character Table - not implemented yet!}{}{}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\DoNotIndex} +% \begin{macrocode} +\providecommand*\DoNotIndex[1]{% + \PackageWarning{ydoc}{Ignoring DoNotIndex - not implemented yet!}{}{}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\changes} +% \begin{macrocode} +\providecommand*\changes[3]{% + \PackageWarning{ydoc}{Ignoring changes - not implemented yet!}{}{}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\RecordChanges} +% \begin{macrocode} +\providecommand*\RecordChanges{% + \PackageWarning{ydoc}{List of changes not implemented yet!}{}{}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PrintChanges} +% \begin{macrocode} +\providecommand*\PrintChanges{% + \PackageWarning{ydoc}{List of changes not implemented yet!}{}{}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PrintIndex} +% \begin{macrocode} +\providecommand*\PrintIndex{% + \PackageWarning{ydoc}{Code index not implemented yet!}{}{}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\CodelineIndex} +% \begin{macrocode} +\providecommand*\CodelineIndex{% + \PackageWarning{ydoc}{Code line index not implemented yet!}{}{}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\EnableCrossrefs} +% \begin{macrocode} +\providecommand*\EnableCrossrefs{% + \PackageWarning{ydoc}{Cross references not implemented yet!}{}{}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\GetFileInfo} +% \begin{macrocode} +\providecommand*\GetFileInfo[1]{% + \PackageWarning{ydoc}{Get File Info not implemented yet!}{}{}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ydoc@checkchecksum} +% \begin{macrocode} +\def\ydoc@checkchecksum{% + \ifnum\ydoc@checksum=\m@ne + \message{^^J}% + \message{**********************^^J}% + \message{* No Checksum found! *^^J}% + \message{**********************^^J}% + \else + \ifnum\ydoc@checksum=\ydoc@bslashcnt + \message{^^J}% + \message{*******************^^J}% + \message{* Checksum passed *^^J}% + \message{*******************^^J}% + \else + \message{^^J}% + \message{****************************^^J}% + \message{* Checksum wrong (\ydoc@checksum<>\the\ydoc@bslashcnt) ^^J}% + \message{****************************^^J}% + \GenericError{Checksum wrong}{}{}{}% + \fi + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\RequirePackage{shortvrb} +\MakeShortVerb{\|} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% \iffalse +%<*desc> +% \fi +% \subsection{Description Macros and Environments} +% +% \subsubsection{Color and style definitions} +% \begin{macrocode} +\RequirePackage{xcolor} +\definecolor{macrodesc}{rgb}{0.0,0.0,0.8} +\definecolor{macroimpl}{rgb}{0.0,0.0,0.4} +\definecolor{meta}{rgb}{0.0,0.4,0.4} +\definecolor{scriptcolor}{rgb}{0.2,0.6,0.2} +\definecolor{optioncolor}{rgb}{0.3.0.2,0} +\colorlet{optional}{black!65!white} +\colorlet{metaoptional}{optional!50!meta} +% \end{macrocode} +% +% +% \subsubsection{Text Formatting Macros} +% +% \begin{macro}{\meta} +% Prints \meta{meta text}. +% \begin{macrocode} +\def\meta#1{% + \ensuremath\langle + {\metastyle{#1\/}}% + \ensuremath\rangle +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@meta} +% Checks if |#1| is surrounded by angles |< >|. +% If so it calls \cs{is@meta} which removes the angles and calls \cs{meta}. +% \begin{macrocode} +\def\@meta#1{% + \@ifnextchar<% + {\is@meta}% + {}% + #1% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\is@meta} +% Only removes the |< >| ands calls \cs{meta}. +% \begin{macrocode} +\def\is@meta<#1>{% + \meta{#1}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\marg} +% Calls \cs{marg} with angles added to force meta format. +% \begin{macrocode} +\def\marg#1{\@marg{<#1>}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\oarg} +% Calls \cs{oarg} with angles added to force meta format. +% \begin{macrocode} +\def\oarg#1{\@oarg{<#1>}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\parg} +% Calls \cs{parg} with angles added to force meta format. +% \begin{macrocode} +\def\parg#1{\@parg{<#1>}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\aarg} +% Calls \cs{aarg} with angles added to force meta format. +% \begin{macrocode} +\def\aarg#1{\@aarg{<#1>}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@marg} +% Sets style and adds braces. Text is formatted with \cs{@meta} which might add meta format. +% \begin{macrocode} +\def\@marg#1{% + {\margstyle{% + {\ttfamily\braceleft}% + \@meta{#1}% + {\ttfamily\braceright}% + }}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@oarg} +% Sets style and adds brackets. Text is formatted with \cs{@meta} which might add meta format. +% \begin{macrocode} +\def\@oarg#1{% + {\oargstyle{% + {\ttfamily[}% + \@meta{#1}% + {\ttfamily]}% + }}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@parg} +% Sets style and adds parentheses. Text is formatted with \cs{@meta} which might add meta format. +% \begin{macrocode} +\def\@parg#1{% + {\pargstyle{% + {\ttfamily(}% + \@meta{#1}% + {\ttfamily)}% + }}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@aarg} +% Sets style and adds angles. Text is formatted with \cs{@meta} which might add meta format. +% \begin{macrocode} +\def\@aarg#1{% + {\aargstyle{% + {\ttfamily<}% + \@meta{#1}% + {\ttfamily>}% + }}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\sarg} +% Prints star with given style. +% \begin{macrocode} +\def\sarg{{\sargstyle{*}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pkg} +% \begin{macro}{\cls} +% \begin{macro}{\env} +% \begin{macro}{\cs} +% \begin{macro}{\opt} +% \begin{macrocode} +\def\pkg{\texttt} +\def\cls{\texttt} +\def\env{\texttt} +\def\cs#1{\texttt{\textbackslash #1}} +\def\opt{\textsf} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Text Formatting Styles} +% +% \begin{macro}{\macrodescstyle} +% Style of described macro names. +% \begin{macrocode} +\def\macrodescstyle{\ttfamily\bfseries\color{macrodesc}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\macroargsstyle} +% Default style for macro arguments (e.g.\ \cs{MacroArgs}). +% \begin{macrocode} +\def\macroargsstyle{\ttfamily} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\envcodestyle} +% Default style for code body content in described environments. +% \begin{macrocode} +\def\envcodestyle{\ttfamily} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\verbstyle} +% Style for verbatim text inside macro argument list. +% \begin{macrocode} +\def\verbstyle{\ttfamily} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\metastyle} +% Meta text style. Because \cs{macroargsstyle} might be also active a |\normalfont| reset +% the font. +% \begin{macrocode} +\def\metastyle{\normalfont\itshape\color{meta}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\margstyle} +% Style for \cs{marg}. +% \begin{macrocode} +\def\margstyle{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\oargstyle} +% Style for \cs{oarg}. A special color is set to show the `optional' status. +% \begin{macrocode} +\def\oargstyle{\color{optional}\colorlet{meta}{metaoptional}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pargstyle} +% Style for \cs{parg}. +% \begin{macrocode} +\def\pargstyle{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\aargstyle} +% Style for \cs{aarg}. +% \begin{macrocode} +\def\aargstyle{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\sargstyle} +% Style for \cs{sarg}. A special color is set to show the `optional' status. +% \begin{macrocode} +\def\sargstyle{\ttfamily\color{optional}} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Dimension Registers} +% +% \begin{macro}{\descindent} +% \begin{macrocode} +\newdimen\descindent +\descindent=-\parindent +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\beforedescskip} +% \begin{macrocode} +\newdimen\beforedescskip +\beforedescskip=\bigskipamount +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\afterdescskip} +% \begin{macrocode} +\newdimen\afterdescskip +\afterdescskip=\medskipamount +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\descsep} +% Set to |1em| in |tt| font. +% \begin{macrocode} +\newdimen\descsep +\begingroup +\ttfamily +\global\descsep=1em\relax +\endgroup +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{Macro Argument Reading Mechanism} +% +% \begin{macro}{\read@Macro@arg} +% Reads next token and calls second macro. +% \begin{macrocode} +\def\read@Macro@arg{% + \futurelet\@let@token\handle@Macro@arg +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\handle@Macro@arg} +% Checks if next token is the begin of a valid macro argument and calls +% the appropriate read macro or the end macro otherwise. +% \begin{macrocode} +\def\handle@Macro@arg{% + \ifcase0% + \ifx\@let@token\bgroup1\else + \ifx\@let@token[\empty2\else + \ifx\@let@token(\empty3\else + \ifx\@let@token<\empty4\else + \ifx\@let@token*\empty5\else + \ifx\@let@token'\empty6\else + \ifx\@let@token!\empty7\else + \ifx\@let@token\@sptoken8\else + \ifx\@let@token\space9\else + \ifx\@let@token~9\else + \ifx\@let@token\AlsoMacro10\else + \ifx\@let@token\DescribeMacro11\fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \relax + \unskip + \expandafter\end@Macro@args%0 + \or\expandafter\read@Macro@marg%1 + \or\expandafter\read@Macro@oarg%2 + \or\expandafter\read@Macro@parg%3 + \or\expandafter\read@Macro@angle%4 + \or\expandafter\read@Macro@sarg%5 + \or\expandafter\read@Macro@verb%6 + \or\expandafter\read@Macro@cmds%7 + \or\expandafter\read@Macro@rmspace%8 + \or\expandafter\read@Macro@addtoken%9 + \else%10- + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\end@Macro@args} +% Closes box as calls hook. Might be locally redefined by some +% macros calling \cs{read@Macro@args}. +% \begin{macrocode} +\def\end@Macro@args{% + \y@egroup + \after@Macro@args +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\after@Macro@args} +% Hook to add additional commands in certain situations. +% \begin{macrocode} +\def\after@Macro@args{% +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection*{Macro argument reading macros} +% This macros read the macro arguments and call the appropriate format macros. +% +% \begin{macro}{\read@Macro@marg} +% \begin{macrocode} +\def\read@Macro@marg#1{% + \@marg{#1}\read@Macro@arg +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\read@Macro@oarg} +% \begin{macrocode} +\def\read@Macro@oarg[#1]{% + \@oarg{#1}\read@Macro@arg +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\read@Macro@parg} +% \begin{macrocode} +\def\read@Macro@parg(#1){% + \@parg{#1}\read@Macro@arg +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\read@Macro@aarg} +% \begin{macrocode} +\def\read@Macro@aarg<#1>>{% + \aarg{#1}\read@Macro@arg +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\read@Macro@angle} +% \begin{macrocode} +\def\read@Macro@angle<{% + \futurelet\@let@token\read@Macro@angle@ +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\read@Macro@angle@} +% \begin{macrocode} +\def\read@Macro@angle@{% + \ifx\@let@token<% + \expandafter\read@Macro@aarg + \else + \expandafter\read@Macro@meta + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\read@Macro@meta} +% \begin{macrocode} +\def\read@Macro@meta#1>{% + \meta{#1}\read@Macro@arg +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\read@Macro@sarg} +% \begin{macrocode} +\def\read@Macro@sarg#1{% + \sarg\read@Macro@arg +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\read@Macro@verb} +% Sets up verbatim mode calls second macro. +% \begin{macrocode} +\def\read@Macro@verb{% + \begingroup + \let\do\@makeother + \dospecials + \read@Macro@verb@ +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\read@Macro@verb@} +% Closes verbatim mode and formats text. +% If |#1| is empty (|''|) than a single |'| is printed. +% \begin{macrocode} +\def\read@Macro@verb@'#1'{% + \endgroup + \ifx\relax#1\relax + {\verbstyle{\string'}}% + \else + {\verbstyle{#1}}% + \fi + \read@Macro@arg +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\read@Macro@cmds} +% Simply executes given code. +% \begin{macrocode} +\def\read@Macro@cmds!#1!{% + #1\relax + \read@Macro@arg +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\read@Macro@rmspace} +% Removes space. The |\@firstofone| is used to preserve the space in the macro definition. +% \begin{macrocode} +\@firstofone{\def\read@Macro@rmspace} {% + \read@Macro@arg +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\read@Macro@addtoken} +% Takes token over from input to output `stream'. This is used for |\space| and |~|. +% \begin{macrocode} +\def\read@Macro@addtoken#1{% + #1\read@Macro@arg +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Description Macros} +% \subsubsection*{For Macros} +% +% \begin{macro}{\DescribeMacro} +% \begin{macrocode} +\@ifundefined{DescribeMacro}{}{% + \PackageInfo{ydoc-desc}{Redefining \string\DescribeMacro}{}% +} +% \end{macrocode} +% A \cs{DescribeMacro} places itself in a \env{DescribeMacros} environment. +% Multiple \cs{DescribeMacro} macros will stack themselves inside this environment. +% For this to work \cs{DescribeMacros} is locally defined to |\y@egroup| to close the +% |\hbox| from the previous \cs{DescribeMacro}. +% \begin{macrocode} +\def\DescribeMacro{% + \DescribeMacros + \let\DescribeMacros\y@egroup + \def\after@Macro@args{\endDescribeMacros}% + \begingroup\makeatletter + \Describe@Macro +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Describe@Macro} +% \begin{macrocode} +\def\Describe@Macro#1{% + \endgroup + \hbox\y@bgroup + \PrintMacroName{#1}% + \macroargsstyle + \read@Macro@arg +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Macro} +% Simply uses the two macros below. +% \begin{macrocode} +\newcommand*\Macro{\MacroArgs\AlsoMacro} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@Macro} +% Alternative definition of \cs{Macro} inside \env{DescribeMacros} environments. +% \begin{macrocode} +\def\@Macro{% + \begingroup\makeatletter + \Describe@Macro +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\AlsoMacro} +% Reads argument while |@| is a letter, +% prints the macro name and reads further arguments. +% \begin{macrocode} +\newcommand*\AlsoMacro{% + \begingroup\makeatletter + \AlsoMacro@ +} +\def\AlsoMacro@#1{% + \endgroup + \PrintMacroName{#1}% + \read@Macro@arg +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\MacroArgs} +% Uses the normal macro argument reading mechanism from \cs{DescribeMacro}. +% Instead of a box a simple group is added. +% \begin{macrocode} +\newcommand*\MacroArgs{% + \begingroup + \let\end@Macro@args\endgroup + \read@Macro@arg +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\DescribeMacros} +% \begin{macrocode} +\def\DescribeMacros{% + \begingroup + \let\Macro\@Macro + \parindent=0pt\relax + \setbox\descbox\vbox\y@bgroup +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\endDescribeMacros} +% \begin{macrocode} +\def\endDescribeMacros{% + \y@egroup + \PrintMacros + \endgroup +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\DescribeMacrosTabcolsep} +% \begin{macrocode} +\def\DescribeMacrosTabcolsep{\tabcolsep} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\DescribeMacrosTab} +% \begin{macrocode} +\def\DescribeMacrosTab{% + \DescribeMacros + \hbox\y@bgroup + \tabcolsep=\DescribeMacrosTabcolsep\relax + \DescribeMacrosTab@ +} +\def\DescribeMacrosTab@#1{\tabular{@{}#1@{}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\endDescribeMacrosTab} +% \begin{macrocode} +\def\endDescribeMacrosTab{% + \endtabular\y@egroup + \endDescribeMacros +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection*{For Lengths} +% +% \begin{macro}{\DescribeLength} +% \begin{macrocode} +\newcommand*\DescribeLength{% + \begingroup + \let\DescribeLength\Describe@Length + \setbox\descbox\hbox\y@bgroup + \tabular{@{}l@{\hspace{2em}}l@{}}% + \Describe@Length +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Describe@Length} +% \begin{macrocode} +\newcommand*\Describe@Length[2]{% + \PrintLengthName{#1}& + (Default: {\macroargsstyle#2\unskip})% + \@ifnextchar\DescribeLength + {\\}% + {% + \endtabular + \y@egroup + \PrintLength + \endgroup + }% +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection*{For Environments} +% +% \begin{macro}{\DescribeEnv} +% \begin{macrocode} +\@ifundefined{DescribeEnv}{}{% + \PackageInfo{ydoc-desc}{Redefining \string\DescribeEnv}{}% +} +\let\DescribeEnv\relax +% \end{macrocode} +% \begin{macrocode} +\newcommand*\DescribeEnv[2][]{% + \begingroup + \def\DescribeEnv@name{#2}% + \let\\\DescribeEnv@newline +% \end{macrocode} +% +% Sets after-macro-arguments hook. +% First checks if the environment or macro version was used. +% The environment starts a new line only if the next token isn't |\end|, +% which is taken as end of the environment. +% \begin{macrocode} + \ifx\@currenvir\DescribeEnv@string + \def\after@Macro@args{% + \let\after@Macro@args\empty + \setbox\@tempboxa\hbox\y@bgroup + \@ifnextchar\end{}% + {\DescribeEnv@newline}% + #1% + }% +% \end{macrocode} +% The macro version adds the optional argument as content line if given. +% \begin{macrocode} + \else + \ifx\relax#1\relax + \def\after@Macro@args{% + \y@bgroup + \endDescribeEnv + }% + \else + \def\after@Macro@args{% + \setbox\@tempboxa\hbox\y@bgroup + \DescribeEnv@newline\MacroArgs#1% + \endDescribeEnv + }% + \fi + \fi +% \end{macrocode} +% Start |\vbox| and adds first line. +% \begin{macrocode} + \setbox\descbox\vbox\y@bgroup + \envcodestyle + \let\PrintEnv\PrintSubEnv + \hbox\y@bgroup + \PrintEnvName{\begin}{\DescribeEnv@name}% + \macroargsstyle + \read@Macro@arg +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\DescribeEnv@newline} +% Closes existing and starts a new horizontal box representing a indented line. +% The optional argument allows to add extra space between lines like the normal |\\|. +% Negative values are not supported. +% \begin{macrocode} +\newcommand*\DescribeEnv@newline[1][0pt]{% + \strut\y@egroup + {\vskip#1}% + \hbox\y@bgroup\strut + \hspace*{\descsep}% + \ignorespaces +}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\DescribeEnv@string} +% Holds the environment name for comparison. +% \begin{macrocode} +\def\DescribeEnv@string{DescribeEnv} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\descbox} +% Save box to store description content. +% \begin{macrocode} +\newbox\descbox +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\endDescribeEnv} +% \begin{macrocode} +\def\endDescribeEnv{% + \y@egroup + \begingroup + \setbox\@tempboxa\lastbox + \ifcase0% + \ifdim\wd\@tempboxa>\descsep1\fi + \ifdim\ht\@tempboxa>\ht\strutbox1\fi + \ifdim\dp\@tempboxa>\dp\strutbox1\fi + \else + \box\@tempboxa + \fi + \endgroup + \hbox\y@bgroup + \PrintEnvName{\end}{\DescribeEnv@name} + \y@egroup + \y@egroup + \PrintEnv + \endgroup +} +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{Print Macros} +% +% \begin{macro}{\PrintMacroName} +% Formats macro name. The backslash is forced to |tt| font. +% \begin{macrocode} +\def\PrintMacroName#1{% + {\macrodescstyle{\strut + \texttt{\char92}% + \escapechar\m@ne + \string#1}}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PrintLengthName} +% Formats length register name. +% \begin{macrocode} +\let\PrintLengthName\PrintMacroName +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\PrintEnvName} +% |#1| = `|\begin|' or `|\end|', |#2| = env name. +% \begin{macrocode} +\def\PrintEnvName#1#2{% + \strut + \string#1\braceleft + {\macrodescstyle#2}% + \braceright +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PrintMacros} +% Prints macros described using \cs{DescribeMacros}. +% The actual content was stored inside \cs{descbox}. +% If it is wider than the line width it is centered. +% \begin{macrocode} +\def\PrintMacros{% + \par\vspace\beforedescskip + \noindent\hspace*{\descindent}% + \ifdim\wd\descbox>\linewidth + \makebox[\linewidth][c]{\fbox{\hspace*{\descsep}\usebox{\descbox}\hspace*{\descsep}}} + \else + \fbox{\hspace*{\descsep}\usebox{\descbox}\hspace*{\descsep}}% + \fi + \par\vspace\afterdescskip +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PrintLength} +% Prints lengths registers described using one or multiple \cs{DescribeLength}. +% \begin{macrocode} +\let\PrintLength\PrintMacros +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PrintEnv} +% Prints \env{DescribeEnv} environments. +% The actual content was stored inside \cs{descbox}. +% \begin{macrocode} +\def\PrintEnv{% + \par\vspace\beforedescskip + \noindent\hspace*{\descindent}% + \fbox{\hspace*{\descsep}\usebox{\descbox}\hspace*{\descsep}}% + \par\vspace\afterdescskip +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PrintSubEnv} +% Prints sub environments, i.e.\ \env{DescribeEnv} environments +% inside the body of another \env{DescribeEnv}. +% The actual content was stored inside \cs{descbox}. +% \begin{macrocode} +\def\PrintSubEnv{% + \hbox{\hbox{\usebox{\descbox}}}% +} +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{Special Character Macros} +% +% \begin{macro}{\bslash} +% Defines an expandable backslash with catcode 12: `\texttt{\bslash}$_{12}$'. +% The |\@firstofone| trick is used to read the |\gdef\bslash| code before changing the catcode. +% \begin{macrocode} +{% +\@firstofone{% + \catcode`\\=12 + \gdef\bslash +}{\} +}%} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\percent} +% Defines an expandable percent character with catcode 12: `\percent$_{12}$'. +% \begin{macrocode} +\begingroup +\catcode`\%=12 +\gdef\percent{%} +\endgroup +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\braceleft} +% \begin{macro}{\braceright} +% Defines expandable left and right braces with catcode 12: `\texttt{\braceleft}$_{12}$' `\texttt{\braceright}$_{12}$'. +% \begin{macrocode} +\begingroup +\catcode`\<=1 +\catcode`\>=2 +\catcode`\{=12 +\catcode`\}=12 +\gdef\braceleft <{> +\gdef\braceright<}> +\endgroup +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{Other Macros} +% +% \begin{macro}{\y@bgroup} +% \begin{macro}{\y@egroup} +% These macros are used to begin and end |\vbox|/|\hbox|-es. +% \begin{macrocode} +\def\y@bgroup{\bgroup\color@setgroup} +\def\y@egroup{\color@endgroup\egroup} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \iffalse +% +% \fi +% +% \iffalse +%<*expl> +% \fi +% \subsection{Include Code Examples} +% +% \iffalse +%<*dontinclude> +% \begin{macrocode} +\newcounter{example} +\def\examplename{Example} +\newenvironment{example}[1]{% + \par\bigskip\noindent + \centerline{\examplename~\refstepcounter{example}\theexample: #1}% + \smallskip + \hrule + \smallskip +}{% + \smallskip + \hrule + \par\bigskip +} +% \end{macrocode} +% +% \begin{macro}{\PrintExample} +% \begin{macrocode} +\def\PrintExample{% + \usebox\examplecodebox + \hfill + \usebox\exampleresultbox +} +% \end{macrocode} +% \end{macro} +% +% \fi +% +% \begin{macrocode} +\RequirePackage{listings} +\lst@RequireAspects{writefile} +\def\ydoc@exafile{\jobname.exa} +% \end{macrocode} +% +% \begin{macro}{\exampleprintsettings} +% \begin{macrocode} +\def\exampleprintsettings{frame=lines}% +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\newbox\examplecodebox +\newbox\exampleresultbox +% \end{macrocode} +% +% \begin{macro}{\BoxExample} +% \begin{macrocode} +\def\BoxExample{% + \setbox\examplecodebox\hbox{\color@setgroup + \expandafter\expandafter\expandafter\lstinputlisting + \expandafter\expandafter\expandafter[% + \expandafter\exampleprintsettings\expandafter,\thisexampleprintsettings]% + {\ydoc@exafile}% + \color@endgroup}% + \setbox\exampleresultbox\hbox{\color@setgroup + \@@input\ydoc@exafile\relax + \color@endgroup}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PrintExample} +% \begin{macrocode} +\RequirePackage{showexpl} +\def\PrintExample{% + \begingroup + \lstset{basicstyle=\ttfamily}% + \MakePercentComment + \LTXinputExample[varwidth]{\ydoc@exafile}% + \endgroup +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macrocode} +\def\examplecodesettings{gobble=4} +% \end{macrocode} +% +% \begin{environment}{examplecode} +% \begin{macrocode} +\lstnewenvironment{examplecode}[1][]{% + \def\thisexampleprintsettings{#1}% + \expandafter\lstset\expandafter{\examplecodesettings,#1}% + \setbox\@tempboxa\hbox\bgroup + \lst@BeginWriteFile{\ydoc@exafile}% +} +{% + \lst@EndWriteFile + \egroup + \PrintExample +} +% \end{macrocode} +% \end{environment} +% +% \begin{macrocode} +\RequirePackage{float} +% \end{macrocode} +% +% \begin{environment}{example} +% \begin{macrocode} +\floatstyle{plain} +\newfloat{example}{tbhp}{loe} +\floatname{example}{\examplename} +\def\examplename{Example} +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{exampletable} +% \begin{macrocode} +\newenvironment{exampletable}{% + \floatstyle{plaintop}% + \restylefloat{example}% + \example +}{\endexample} +% \end{macrocode} +% \end{environment} +% +% \iffalse +% +% \fi +% \Finale +\endinput diff --git a/Master/texmf-dist/source/latex/ydoc/ydoc.ins b/Master/texmf-dist/source/latex/ydoc/ydoc.ins new file mode 100644 index 00000000000..eead38f53ef --- /dev/null +++ b/Master/texmf-dist/source/latex/ydoc/ydoc.ins @@ -0,0 +1,26 @@ +% ydoc.ins +% Copyright (c) 2010 by Martin Scharrer +% WWW: http://latex.scharrer-online.de/ + +% See file 'ydoc.dtx' for copyright and licence information. +% $Id: ydoc.ins 1846 2010-04-10 10:41:21Z martin $ + +\input docstrip + +\keepsilent +\askforoverwritefalse + +\preamble +\endpreamble + +\generate{% + \file{ydoc.cls}{\from{ydoc.dtx}{class}}% + \file{ydoc.sty}{\from{ydoc.dtx}{package}}% + \file{ydoc-code.sty}{\from{ydoc.dtx}{code}}% + \file{ydoc-desc.sty}{\from{ydoc.dtx}{desc}}% + \file{ydoc-expl.sty}{\from{ydoc.dtx}{expl}}% + \file{ydoc-doc.sty}{\from{ydoc.dtx}{doc}}% +} + +\endbatchfile +% vim: ft=tex diff --git a/Master/texmf-dist/tex/latex/ydoc/ydoc-code.sty b/Master/texmf-dist/tex/latex/ydoc/ydoc-code.sty new file mode 100644 index 00000000000..2581ec83ec3 --- /dev/null +++ b/Master/texmf-dist/tex/latex/ydoc/ydoc-code.sty @@ -0,0 +1,199 @@ +%% +%% This is file `ydoc-code.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ydoc.dtx (with options: `code') +%% +%% Copyright (c) 2010 by Martin Scharrer +%% WWW: http://latex.scharrer-online.de/ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 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 ydoc.dtx and ydoc.ins +%% and the derived file ydoc.cls, ydoc.sty, ydoc-code.sty, +%% ydoc-expl.sty and ydoc-desc.sty. +%% +\RequirePackage{svn-prov}[2010/04/03] +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackageSVN + [ydoc-code] + {$Id: ydoc.dtx 1847 2010-04-10 10:57:11Z martin $} + [v0.1alpha] + [ydoc package to document macro code] +\RequirePackage{xcolor} +\definecolor{macroimpl}{rgb}{0.0,0.0,0.4} +\@ifundefined{ydocwrite}{% + \newwrite\ydocwrite +}{} +\@ifundefined{ydocfname}{% + \def\ydocfname{\jobname.cod}% +}{} +\def\ydoc@catcodes{% + \let\do\@makeother + \dospecials + \catcode`\\=\active + \catcode`\^^M=\active + \catcode`\ =\active +} +\def\macrocode{% + \par\noindent + \begingroup + \ydoc@catcodes + \macro@code +} +\def\endmacrocode{} +\begingroup +\endlinechar\m@ne +\@firstofone{% +\catcode`\|=0\relax +\catcode`\(=1\relax +\catcode`\)=2\relax +\catcode`\*=14\relax +\catcode`\{=12\relax +\catcode`\}=12\relax +\catcode`\ =12\relax +\catcode`\%=12\relax +\catcode`\\=\active +\catcode`\^^M=\active +\catcode`\ =\active +}* +|gdef|macro@code#1^^M% \end{macrocode}(* +|endgroup|expandafter|macro@@code|expandafter(|ydoc@removeline#1|noexpand|lastlinemacro^^M)* +)* +|gdef|ydoc@removeline#1^^M(|noexpand|firstlinemacro)* +|gdef|ydoc@defspecialmacros(* +|def^^M(|noexpand|newlinemacro)* +|def (|noexpand|spacemacro)* +|def\(|noexpand|bslashmacro)* +)* +|gdef|ydoc@defrevspecialmacros(* +|def|newlinemacro(|noexpand^^M)* +|def|spacemacro(|noexpand )* +|def|bslashmacro(|noexpand\)* +)* +|endgroup +\def\macro@@code#1{% + {\ydoc@defspecialmacros + \xdef\themacrocode{#1}}% + \PrintMacroCode + \end{macrocode}% +} +\def\newlinemacro{\\\null} +\def\spacemacro{\ } +\def\bslashmacro{\char92} +\def\lastlinemacro#1{} +\def\firstlinemacro{\linenumberbox} +\def\newlinemacro{\\\linenumberbox} +\newcounter{linenumber} +\def\linenumberbox{% + \hbox to 1.25em{}% + \llap{% + \stepcounter{linenumber}% + {\footnotesize\color{gray}\thelinenumber~}% + }% +} +\def\PrintMacroCode{% + \begingroup + \ttfamily + \noindent\themacrocode + \endgroup +} +\RequirePackage{listings} +\def\PrintMacroCode{% + \begingroup + \let\firstlinemacro\empty + \let\lastlinemacro\empty + \def\newlinemacro{^^J}% + \let\bslashmacro\bslash + \let\spacemacro\space + \immediate\openout\ydocwrite=\ydocfname\relax + \immediate\write\ydocwrite{\themacrocode}% + \immediate\closeout\ydocwrite + \@nameuse{ydoc@countbslashes}% + \ydoclistingssettings + \let\input\@input + \lstinputlisting{\ydocfname}% + \endgroup +} +\def\ydoclistingssettings{% + \lstset{% + language=[latex]tex,basicstyle=\ttfamily, + numbers=left,numberstyle=\tiny\color{gray},firstnumber=last, + breaklines,prebreak={\mbox{\tiny$\swarrow$}}% + }% +} +\def\macro@impl@args[#1]{% + \begingroup + \parindent=10pt\relax + \let\macro@impl@argcnt\@tempcnta + \let\macro@impl@curarg\@tempcntb + \macro@impl@argcnt=#1\relax + \macro@impl@curarg=0\relax + \ifnum\macro@impl@curarg<\macro@impl@argcnt\relax + \expandafter\macro@impl@arg + \else + \expandafter\macro@impl@endargs + \fi +} +\def\macro@impl@endargs{% + \endgroup + \unskip\par\noindent\ignorespaces +} +\def\macro@impl@argline#1#2{% + \par{\texttt{\##1}:~#2}% +} +\def\macro@impl@arg#1{% + \advance\macro@impl@curarg by\@ne\relax + \macro@impl@argline{\the\macro@impl@curarg}{#1}% + \ifnum\macro@impl@curarg<\macro@impl@argcnt\relax + \expandafter\macro@impl@arg + \else + \expandafter\macro@impl@endargs + \fi +} +\def\macro#1{% + \PrintMacroImplName{#1}% + \@ifnextchar[%] + {\macro@impl@args}% + {}% +} +\def\endmacro{} +\def\environment#1{% + \PrintEnvImplName{#1}% + \@ifnextchar[%] + {\macro@impl@args}% + {}% +} +\def\endenvironment{} +\def\PrintMacroImplName#1{% + \par\bigskip\noindent + \hbox{\hspace*{\descindent}\fbox{{\implstyle{\string#1}}}}% + \par\medskip\noindent +} +\def\PrintEnvImplName#1{% + \par\bigskip\noindent + \hbox{\hspace*{\descindent}\fbox{{\implstyle{#1}}}}% + \par\medskip +} +\def\implstyle{\ttfamily\bfseries\color{macroimpl}} +{% +\@firstofone{% + \catcode`\\=12 + \gdef\bslash +}{\} +}%} +\endinput +%% +%% End of file `ydoc-code.sty'. diff --git a/Master/texmf-dist/tex/latex/ydoc/ydoc-desc.sty b/Master/texmf-dist/tex/latex/ydoc/ydoc-desc.sty new file mode 100644 index 00000000000..f921666ae5a --- /dev/null +++ b/Master/texmf-dist/tex/latex/ydoc/ydoc-desc.sty @@ -0,0 +1,407 @@ +%% +%% This is file `ydoc-desc.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ydoc.dtx (with options: `desc') +%% +%% Copyright (c) 2010 by Martin Scharrer +%% WWW: http://latex.scharrer-online.de/ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 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 ydoc.dtx and ydoc.ins +%% and the derived file ydoc.cls, ydoc.sty, ydoc-code.sty, +%% ydoc-expl.sty and ydoc-desc.sty. +%% +\RequirePackage{svn-prov}[2010/04/03] +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackageSVN + [ydoc-desc] + {$Id: ydoc.dtx 1847 2010-04-10 10:57:11Z martin $} + [v0.1alpha] + [ydoc package to describe macros, environments, options etc.] +\RequirePackage{xcolor} +\definecolor{macrodesc}{rgb}{0.0,0.0,0.8} +\definecolor{macroimpl}{rgb}{0.0,0.0,0.4} +\definecolor{meta}{rgb}{0.0,0.4,0.4} +\definecolor{scriptcolor}{rgb}{0.2,0.6,0.2} +\definecolor{optioncolor}{rgb}{0.3.0.2,0} +\colorlet{optional}{black!65!white} +\colorlet{metaoptional}{optional!50!meta} +\def\meta#1{% + \ensuremath\langle + {\metastyle{#1\/}}% + \ensuremath\rangle +} +\def\@meta#1{% + \@ifnextchar<% + {\is@meta}% + {}% + #1% +} +\def\is@meta<#1>{% + \meta{#1}% +} +\def\marg#1{\@marg{<#1>}} +\def\oarg#1{\@oarg{<#1>}} +\def\parg#1{\@parg{<#1>}} +\def\aarg#1{\@aarg{<#1>}} +\def\@marg#1{% + {\margstyle{% + {\ttfamily\braceleft}% + \@meta{#1}% + {\ttfamily\braceright}% + }}% +} +\def\@oarg#1{% + {\oargstyle{% + {\ttfamily[}% + \@meta{#1}% + {\ttfamily]}% + }}% +} +\def\@parg#1{% + {\pargstyle{% + {\ttfamily(}% + \@meta{#1}% + {\ttfamily)}% + }}% +} +\def\@aarg#1{% + {\aargstyle{% + {\ttfamily<}% + \@meta{#1}% + {\ttfamily>}% + }}% +} +\def\sarg{{\sargstyle{*}}} +\def\pkg{\texttt} +\def\cls{\texttt} +\def\env{\texttt} +\def\cs#1{\texttt{\textbackslash #1}} +\def\opt{\textsf} +\def\macrodescstyle{\ttfamily\bfseries\color{macrodesc}} +\def\macroargsstyle{\ttfamily} +\def\envcodestyle{\ttfamily} +\def\verbstyle{\ttfamily} +\def\metastyle{\normalfont\itshape\color{meta}} +\def\margstyle{} +\def\oargstyle{\color{optional}\colorlet{meta}{metaoptional}} +\def\pargstyle{} +\def\aargstyle{} +\def\sargstyle{\ttfamily\color{optional}} +\newdimen\descindent +\descindent=-\parindent +\newdimen\beforedescskip +\beforedescskip=\bigskipamount +\newdimen\afterdescskip +\afterdescskip=\medskipamount +\newdimen\descsep +\begingroup +\ttfamily +\global\descsep=1em\relax +\endgroup +\def\read@Macro@arg{% + \futurelet\@let@token\handle@Macro@arg +} +\def\handle@Macro@arg{% + \ifcase0% + \ifx\@let@token\bgroup1\else + \ifx\@let@token[\empty2\else + \ifx\@let@token(\empty3\else + \ifx\@let@token<\empty4\else + \ifx\@let@token*\empty5\else + \ifx\@let@token'\empty6\else + \ifx\@let@token!\empty7\else + \ifx\@let@token\@sptoken8\else + \ifx\@let@token\space9\else + \ifx\@let@token~9\else + \ifx\@let@token\AlsoMacro10\else + \ifx\@let@token\DescribeMacro11\fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \relax + \unskip + \expandafter\end@Macro@args%0 + \or\expandafter\read@Macro@marg%1 + \or\expandafter\read@Macro@oarg%2 + \or\expandafter\read@Macro@parg%3 + \or\expandafter\read@Macro@angle%4 + \or\expandafter\read@Macro@sarg%5 + \or\expandafter\read@Macro@verb%6 + \or\expandafter\read@Macro@cmds%7 + \or\expandafter\read@Macro@rmspace%8 + \or\expandafter\read@Macro@addtoken%9 + \else%10- + \fi +} +\def\end@Macro@args{% + \y@egroup + \after@Macro@args +} +\def\after@Macro@args{% +} +\def\read@Macro@marg#1{% + \@marg{#1}\read@Macro@arg +} +\def\read@Macro@oarg[#1]{% + \@oarg{#1}\read@Macro@arg +} +\def\read@Macro@parg(#1){% + \@parg{#1}\read@Macro@arg +} +\def\read@Macro@aarg<#1>>{% + \aarg{#1}\read@Macro@arg +} +\def\read@Macro@angle<{% + \futurelet\@let@token\read@Macro@angle@ +} +\def\read@Macro@angle@{% + \ifx\@let@token<% + \expandafter\read@Macro@aarg + \else + \expandafter\read@Macro@meta + \fi +} +\def\read@Macro@meta#1>{% + \meta{#1}\read@Macro@arg +} +\def\read@Macro@sarg#1{% + \sarg\read@Macro@arg +} +\def\read@Macro@verb{% + \begingroup + \let\do\@makeother + \dospecials + \read@Macro@verb@ +} +\def\read@Macro@verb@'#1'{% + \endgroup + \ifx\relax#1\relax + {\verbstyle{\string'}}% + \else + {\verbstyle{#1}}% + \fi + \read@Macro@arg +} +\def\read@Macro@cmds!#1!{% + #1\relax + \read@Macro@arg +} +\@firstofone{\def\read@Macro@rmspace} {% + \read@Macro@arg +} +\def\read@Macro@addtoken#1{% + #1\read@Macro@arg +} +\@ifundefined{DescribeMacro}{}{% + \PackageInfo{ydoc-desc}{Redefining \string\DescribeMacro}{}% +} +\def\DescribeMacro{% + \DescribeMacros + \let\DescribeMacros\y@egroup + \def\after@Macro@args{\endDescribeMacros}% + \begingroup\makeatletter + \Describe@Macro +} +\def\Describe@Macro#1{% + \endgroup + \hbox\y@bgroup + \PrintMacroName{#1}% + \macroargsstyle + \read@Macro@arg +} +\newcommand*\Macro{\MacroArgs\AlsoMacro} +\def\@Macro{% + \begingroup\makeatletter + \Describe@Macro +} +\newcommand*\AlsoMacro{% + \begingroup\makeatletter + \AlsoMacro@ +} +\def\AlsoMacro@#1{% + \endgroup + \PrintMacroName{#1}% + \read@Macro@arg +} +\newcommand*\MacroArgs{% + \begingroup + \let\end@Macro@args\endgroup + \read@Macro@arg +} +\def\DescribeMacros{% + \begingroup + \let\Macro\@Macro + \parindent=0pt\relax + \setbox\descbox\vbox\y@bgroup +} +\def\endDescribeMacros{% + \y@egroup + \PrintMacros + \endgroup +} +\def\DescribeMacrosTabcolsep{\tabcolsep} +\def\DescribeMacrosTab{% + \DescribeMacros + \hbox\y@bgroup + \tabcolsep=\DescribeMacrosTabcolsep\relax + \DescribeMacrosTab@ +} +\def\DescribeMacrosTab@#1{\tabular{@{}#1@{}}} +\def\endDescribeMacrosTab{% + \endtabular\y@egroup + \endDescribeMacros +} +\newcommand*\DescribeLength{% + \begingroup + \let\DescribeLength\Describe@Length + \setbox\descbox\hbox\y@bgroup + \tabular{@{}l@{\hspace{2em}}l@{}}% + \Describe@Length +} +\newcommand*\Describe@Length[2]{% + \PrintLengthName{#1}& + (Default: {\macroargsstyle#2\unskip})% + \@ifnextchar\DescribeLength + {\\}% + {% + \endtabular + \y@egroup + \PrintLength + \endgroup + }% +} +\@ifundefined{DescribeEnv}{}{% + \PackageInfo{ydoc-desc}{Redefining \string\DescribeEnv}{}% +} +\let\DescribeEnv\relax +\newcommand*\DescribeEnv[2][]{% + \begingroup + \def\DescribeEnv@name{#2}% + \let\\\DescribeEnv@newline + \ifx\@currenvir\DescribeEnv@string + \def\after@Macro@args{% + \let\after@Macro@args\empty + \setbox\@tempboxa\hbox\y@bgroup + \@ifnextchar\end{}% + {\DescribeEnv@newline}% + #1% + }% + \else + \ifx\relax#1\relax + \def\after@Macro@args{% + \y@bgroup + \endDescribeEnv + }% + \else + \def\after@Macro@args{% + \setbox\@tempboxa\hbox\y@bgroup + \DescribeEnv@newline\MacroArgs#1% + \endDescribeEnv + }% + \fi + \fi + \setbox\descbox\vbox\y@bgroup + \envcodestyle + \let\PrintEnv\PrintSubEnv + \hbox\y@bgroup + \PrintEnvName{\begin}{\DescribeEnv@name}% + \macroargsstyle + \read@Macro@arg +} +\newcommand*\DescribeEnv@newline[1][0pt]{% + \strut\y@egroup + {\vskip#1}% + \hbox\y@bgroup\strut + \hspace*{\descsep}% + \ignorespaces +}% +\def\DescribeEnv@string{DescribeEnv} +\newbox\descbox +\def\endDescribeEnv{% + \y@egroup + \begingroup + \setbox\@tempboxa\lastbox + \ifcase0% + \ifdim\wd\@tempboxa>\descsep1\fi + \ifdim\ht\@tempboxa>\ht\strutbox1\fi + \ifdim\dp\@tempboxa>\dp\strutbox1\fi + \else + \box\@tempboxa + \fi + \endgroup + \hbox\y@bgroup + \PrintEnvName{\end}{\DescribeEnv@name} + \y@egroup + \y@egroup + \PrintEnv + \endgroup +} +\def\PrintMacroName#1{% + {\macrodescstyle{\strut + \texttt{\char92}% + \escapechar\m@ne + \string#1}}% +} +\let\PrintLengthName\PrintMacroName +\def\PrintEnvName#1#2{% + \strut + \string#1\braceleft + {\macrodescstyle#2}% + \braceright +} +\def\PrintMacros{% + \par\vspace\beforedescskip + \noindent\hspace*{\descindent}% + \ifdim\wd\descbox>\linewidth + \makebox[\linewidth][c]{\fbox{\hspace*{\descsep}\usebox{\descbox}\hspace*{\descsep}}} + \else + \fbox{\hspace*{\descsep}\usebox{\descbox}\hspace*{\descsep}}% + \fi + \par\vspace\afterdescskip +} +\let\PrintLength\PrintMacros +\def\PrintEnv{% + \par\vspace\beforedescskip + \noindent\hspace*{\descindent}% + \fbox{\hspace*{\descsep}\usebox{\descbox}\hspace*{\descsep}}% + \par\vspace\afterdescskip +} +\def\PrintSubEnv{% + \hbox{\hbox{\usebox{\descbox}}}% +} +{% +\@firstofone{% + \catcode`\\=12 + \gdef\bslash +}{\} +}%} +\begingroup +\catcode`\%=12 +\gdef\percent{%} +\endgroup +\begingroup +\catcode`\<=1 +\catcode`\>=2 +\catcode`\{=12 +\catcode`\}=12 +\gdef\braceleft <{> +\gdef\braceright<}> +\endgroup +\def\y@bgroup{\bgroup\color@setgroup} +\def\y@egroup{\color@endgroup\egroup} +\endinput +%% +%% End of file `ydoc-desc.sty'. diff --git a/Master/texmf-dist/tex/latex/ydoc/ydoc-doc.sty b/Master/texmf-dist/tex/latex/ydoc/ydoc-doc.sty new file mode 100644 index 00000000000..e6fef3e7ffc --- /dev/null +++ b/Master/texmf-dist/tex/latex/ydoc/ydoc-doc.sty @@ -0,0 +1,119 @@ +%% +%% This is file `ydoc-doc.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ydoc.dtx (with options: `doc') +%% +%% Copyright (c) 2010 by Martin Scharrer +%% WWW: http://latex.scharrer-online.de/ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 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 ydoc.dtx and ydoc.ins +%% and the derived file ydoc.cls, ydoc.sty, ydoc-code.sty, +%% ydoc-expl.sty and ydoc-desc.sty. +%% +\RequirePackage{svn-prov}[2010/04/03] +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackageSVN + [ydoc-doc] + {$Id: ydoc.dtx 1847 2010-04-10 10:57:11Z martin $} + [v0.1alpha] + [ydoc package to provide 'doc' macros] +\newcount\ydoc@bslashcnt +\def\ydoc@countbslashes{% + \begingroup + \let\firstlinemacro\empty + \let\lastlinemacro\empty + \let\newlinemacro\empty + \let\spacemacro\empty + \def\bslashmacro{\global\advance\ydoc@bslashcnt by\@ne}% + \setbox\@tempboxa\hbox{\themacrocode}% + \endgroup +} +\def\CheckSum#1{% + \gdef\ydoc@checksum{#1}% +} +\let\ydoc@checksum\z@ +\def\AlsoImplementation{% + \gdef\StopEventually##1{% + \@bsphack + \gdef\Finale{##1\ydoc@checkchecksum}% + \@esphack + }% +} +\AlsoImplementation +\def\OnlyDescription{% + \@bsphack + \long\gdef\StopEventually##1{##1\endinput}% + \@esphack +} +\let\Finale\relax +\def\MakePercentIgnore{\catcode`\%9\relax} +\def\MakePercentComment{\catcode`\%14\relax} +\def\DocInput#1{\MakePercentIgnore\input{#1}\MakePercentComment} +\providecommand*\CharacterTable[1]{% + \PackageWarning{ydoc}{Ignoring Character Table - not implemented yet!}{}{}% +} +\providecommand*\DoNotIndex[1]{% + \PackageWarning{ydoc}{Ignoring DoNotIndex - not implemented yet!}{}{}% +} +\providecommand*\changes[3]{% + \PackageWarning{ydoc}{Ignoring changes - not implemented yet!}{}{}% +} +\providecommand*\RecordChanges{% + \PackageWarning{ydoc}{List of changes not implemented yet!}{}{}% +} +\providecommand*\PrintChanges{% + \PackageWarning{ydoc}{List of changes not implemented yet!}{}{}% +} +\providecommand*\PrintIndex{% + \PackageWarning{ydoc}{Code index not implemented yet!}{}{}% +} +\providecommand*\CodelineIndex{% + \PackageWarning{ydoc}{Code line index not implemented yet!}{}{}% +} +\providecommand*\EnableCrossrefs{% + \PackageWarning{ydoc}{Cross references not implemented yet!}{}{}% +} +\providecommand*\GetFileInfo[1]{% + \PackageWarning{ydoc}{Get File Info not implemented yet!}{}{}% +} +\def\ydoc@checkchecksum{% + \ifnum\ydoc@checksum=\m@ne + \message{^^J}% + \message{**********************^^J}% + \message{* No Checksum found! *^^J}% + \message{**********************^^J}% + \else + \ifnum\ydoc@checksum=\ydoc@bslashcnt + \message{^^J}% + \message{*******************^^J}% + \message{* Checksum passed *^^J}% + \message{*******************^^J}% + \else + \message{^^J}% + \message{****************************^^J}% + \message{* Checksum wrong (\ydoc@checksum<>\the\ydoc@bslashcnt) ^^J}% + \message{****************************^^J}% + \GenericError{Checksum wrong}{}{}{}% + \fi + \fi +} +\RequirePackage{shortvrb} +\MakeShortVerb{\|} +\endinput +%% +%% End of file `ydoc-doc.sty'. diff --git a/Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty b/Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty new file mode 100644 index 00000000000..d8daf010426 --- /dev/null +++ b/Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty @@ -0,0 +1,84 @@ +%% +%% This is file `ydoc-expl.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ydoc.dtx (with options: `expl') +%% +%% Copyright (c) 2010 by Martin Scharrer +%% WWW: http://latex.scharrer-online.de/ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 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 ydoc.dtx and ydoc.ins +%% and the derived file ydoc.cls, ydoc.sty, ydoc-code.sty, +%% ydoc-expl.sty and ydoc-desc.sty. +%% +\RequirePackage{svn-prov}[2010/04/03] +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackageSVN + [ydoc-expl] + {$Id: ydoc.dtx 1847 2010-04-10 10:57:11Z martin $} + [v0.1alpha] + [ydoc package to insert live examples of LaTeX code] +\RequirePackage{listings} +\lst@RequireAspects{writefile} +\def\ydoc@exafile{\jobname.exa} +\def\exampleprintsettings{frame=lines}% +\newbox\examplecodebox +\newbox\exampleresultbox +\def\BoxExample{% + \setbox\examplecodebox\hbox{\color@setgroup + \expandafter\expandafter\expandafter\lstinputlisting + \expandafter\expandafter\expandafter[% + \expandafter\exampleprintsettings\expandafter,\thisexampleprintsettings]% + {\ydoc@exafile}% + \color@endgroup}% + \setbox\exampleresultbox\hbox{\color@setgroup + \@@input\ydoc@exafile\relax + \color@endgroup}% +} +\RequirePackage{showexpl} +\def\PrintExample{% + \begingroup + \lstset{basicstyle=\ttfamily}% + \MakePercentComment + \LTXinputExample[varwidth]{\ydoc@exafile}% + \endgroup +} +\def\examplecodesettings{gobble=4} +\lstnewenvironment{examplecode}[1][]{% + \def\thisexampleprintsettings{#1}% + \expandafter\lstset\expandafter{\examplecodesettings,#1}% + \setbox\@tempboxa\hbox\bgroup + \lst@BeginWriteFile{\ydoc@exafile}% +} +{% + \lst@EndWriteFile + \egroup + \PrintExample +} +\RequirePackage{float} +\floatstyle{plain} +\newfloat{example}{tbhp}{loe} +\floatname{example}{\examplename} +\def\examplename{Example} +\newenvironment{exampletable}{% + \floatstyle{plaintop}% + \restylefloat{example}% + \example +}{\endexample} +\endinput +%% +%% End of file `ydoc-expl.sty'. diff --git a/Master/texmf-dist/tex/latex/ydoc/ydoc.cls b/Master/texmf-dist/tex/latex/ydoc/ydoc.cls new file mode 100644 index 00000000000..bbc121b7925 --- /dev/null +++ b/Master/texmf-dist/tex/latex/ydoc/ydoc.cls @@ -0,0 +1,38 @@ +%% +%% This is file `ydoc.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ydoc.dtx (with options: `class') +%% +%% Copyright (c) 2010 by Martin Scharrer +%% WWW: http://latex.scharrer-online.de/ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 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 ydoc.dtx and ydoc.ins +%% and the derived file ydoc.cls, ydoc.sty, ydoc-code.sty, +%% ydoc-expl.sty and ydoc-desc.sty. +%% +\RequirePackage{svn-prov}[2010/04/03] +\ProvidesClassSVN + {$Id: ydoc.dtx 1847 2010-04-10 10:57:11Z martin $} + [v0.1alpha] + [ydoc class: document LaTeX class and packages] +\LoadClassWithOptions{article} +%%\RequirePackage{doc} +\RequirePackage{ydoc} +\endinput +%% +%% End of file `ydoc.cls'. diff --git a/Master/texmf-dist/tex/latex/ydoc/ydoc.sty b/Master/texmf-dist/tex/latex/ydoc/ydoc.sty new file mode 100644 index 00000000000..08fce81ff34 --- /dev/null +++ b/Master/texmf-dist/tex/latex/ydoc/ydoc.sty @@ -0,0 +1,44 @@ +%% +%% This is file `ydoc.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ydoc.dtx (with options: `package') +%% +%% Copyright (c) 2010 by Martin Scharrer +%% WWW: http://latex.scharrer-online.de/ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 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 ydoc.dtx and ydoc.ins +%% and the derived file ydoc.cls, ydoc.sty, ydoc-code.sty, +%% ydoc-expl.sty and ydoc-desc.sty. +%% +\RequirePackage{svn-prov}[2010/04/03] +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackageSVN + {$Id: ydoc.dtx 1847 2010-04-10 10:57:11Z martin $} + [v0.1alpha] + [ydoc package: document LaTeX class and packages] +\RequirePackage{ydoc-code} +\RequirePackage{ydoc-expl} +\RequirePackage{ydoc-desc} +\RequirePackage{ydoc-doc} + +\RequirePackage{newverbs} +\MakeSpecialShortVerb{\qverb}{\"} +\AtBeginDocument{\catcode`\^^A=14\relax} +\endinput +%% +%% End of file `ydoc.sty'. diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index d98295070ca..1ea66299372 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -317,7 +317,7 @@ my @TLP_working = qw( xkeyval xlop xltxtra xmpincl xnewcommand xoptarg xpackages xq xskak xstring xtab xtcapts xunicode xwatermark xyling xypdf xypic-tut-pt xytree - yagusylo york-thesis youngtab yplan + yagusylo ydoc york-thesis youngtab yplan zed-csp zefonts ziffer zhmetrics zhspacing zwgetfdate zwpagelayout ); diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc index c263c48469f..b75dbb5eec9 100644 --- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc @@ -691,6 +691,7 @@ depend xwatermark depend xytree depend yafoot depend yagusylo +depend ydoc depend yplan depend zed-csp depend ziffer diff --git a/Master/tlpkg/tlpsrc/ydoc.tlpsrc b/Master/tlpkg/tlpsrc/ydoc.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d -- cgit v1.2.3