diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/expl3/l3doc.cls')
-rw-r--r-- | Master/texmf-dist/tex/latex/expl3/l3doc.cls | 1050 |
1 files changed, 689 insertions, 361 deletions
diff --git a/Master/texmf-dist/tex/latex/expl3/l3doc.cls b/Master/texmf-dist/tex/latex/expl3/l3doc.cls index da59bf174ef..09d6928412f 100644 --- a/Master/texmf-dist/tex/latex/expl3/l3doc.cls +++ b/Master/texmf-dist/tex/latex/expl3/l3doc.cls @@ -1,5 +1,21 @@ -% \iffalse -%% File: l3doc.dtx Copyright (C) 1990-2008 LaTeX3 project +%% +%% This is file `l3doc.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3doc.dtx (with options: `class') +%% +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% +%% File: l3doc.dtx Copyright (C) 1990-2009 LaTeX3 project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -17,7 +33,7 @@ %% %% The development version of the bundle can be found at %% -%% http://www.latex-project.org/cgi-bin/cvsweb.cgi/ +%% http://www.latex-project.org/svnroot/experimental/trunk/ %% %% for those people who are interested. %% @@ -31,385 +47,697 @@ %% prior consultation with the LaTeX Project Team. %% %% ----------------------------------------------------------------------- -%% \fi -% \iffalse -% \begin{macrocode} -%<*class> -\NeedsTeXFormat{LaTeX2e} -\ProvidesClass{l3doc} - [2008/08/01 v0.0k class for documenting experimental stuff] -% -\NeedsTeXFormat{LaTeX2e} -%</class> -% \end{macrocode} -% -% \section{Options} -% -% \begin{macrocode} -%<*class> -\DeclareOption{a5paper}{\@latexerr{Option not supported}% - {}} -\DeclareOption{full}{\AtBeginDocument{\input{l3full.cfg}}} -% \end{macrocode} -% -% \begin{macrocode} +\RequirePackage{l3names} +\let \filenameOld \filename +\let \filenameextOld \filenameext +\let \filedateOld \filedate +\let \fileversionOld \fileversion +\let \filedescriptionOld \filedescription +\GetIdInfo$Id: l3doc.dtx 1398 2009-06-08 15:53:26Z joseph $ + {L3 Experimental documentation class} +\ProvidesExplClass + {\filename}{\filedate}{\fileversion}{\filedescription} +\RequirePackage{expl3} +\let \filename \filenameOld +\let \filenameext \filenameextOld +\let \filedate \filedateOld +\let \fileversion \fileversionOld +\let \filedescription \filedescriptionOld +\cs_new_nopar:Npn\Team{% + The~\LaTeX3~Project\thanks{% + Frank~Mittelbach,~Denys~Duchier,~Chris~Rowley,~ + Rainer~Sch\"opf,~Johannes~Braams,~Michael~Downes,~ + David~Carlisle,~Alan~Jeffrey,~Morten~H\o{}gholm,~Thomas~Lotze,~ + Javier~Bezos,~Will~Robertson,~Joseph~Wright}} +\DeclareOption{a5paper}{\@latexerr{Option not supported}{}} +\bool_new:N \g_doc_full_bool +\bool_set_false:N \g_doc_full_bool +\DeclareOption{full}{ \bool_set_true:N \g_doc_full_bool } +\DeclareOption{onlydoc}{ \bool_set_false:N \g_doc_full_bool } +\bool_new:N \g_doc_checkfunc_bool +\bool_set_true:N \g_doc_checkfunc_bool +\DeclareOption{check}{ \bool_set_true:N \g_doc_checkfunc_bool } +\DeclareOption{nocheck}{ \bool_set_false:N \g_doc_checkfunc_bool } \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} -% \end{macrocode} -% -% \section{Option Processing} -% -% \begin{macrocode} +\ExecuteOptions{full} \ProcessOptions -% \end{macrocode} -% -% \section{Loading article and doc} -% -% \begin{macrocode} -\LoadClass{article} -% \end{macrocode} -% We need eTeX. Otherwise stop processing now. -% \begin{macrocode} -\@ifundefined{eTeXversion}{% - \ClassError{l3doc}{This document class requires eTeX extensions}% - {I'm going to stop now.}% - \endinput\stop -}{} -% \end{macrocode} -% -% \begin{macrocode} -\RequirePackage{l3names,trace} +\LoadClass[a4paper]{article} \RequirePackage{doc} -\renewcommand\MakePrivateLetters{\makeatletter - \catcode`\_=11\relax - \catcode`\:=11\relax} -% \end{macrocode} -% -% \section{Configuration} -% Input a local configuration file, if it exists. -% \begin{macrocode} -\InputIfFileExists{l3doc.cfg} - {\typeout{*************************************^^J% - * Local config file l3doc.cfg used^^J% - *************************************}} - {} -% \end{macrocode} -% -% taken out for the moment as my laptop doesn't have a full set of -% type 1 fonts installed right now --- fmi -%\RequirePackage[T1]{fontenc} - -%% The Guilty Parties -\def\Team{% - The \LaTeX3 Project\thanks{% - Frank Mittelbach, Denys Duchier, Chris Rowley, - Rainer Sch\"opf, Johannes Braams, Michael Downes, - David Carlisle, Alan Jeffrey, Morten H\o gholm, Thomas Lotze, - Javier Bezos}} - -%% You do not want to look at the mess below this line. -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -\catcode`\_=11 -\AtBeginDocument{\catcode`\_=11\relax} -% \end{macrocode} -% -% Make \verb+|+ and \verb+"+ be `short verb' characters, but not in -% the document preamble, where an active character may interfere -% with packages that are loaded. -% \begin{macrocode} -\MakeShortVerb\" -\MakeShortVerb\| -% \end{macrocode} -% -% As `doc' documents tend to have a lot of monospaced material, -% Set up some |tt| substitutions to occur silently. -% \begin{macrocode} -\DeclareFontShape{OT1}{cmtt}{bx}{n}{<-> ssub * cmtt/m/n}{} -\DeclareFontFamily{OMS}{cmtt}{\skewchar\font 48} % '60 -\DeclareFontShape{OMS}{cmtt}{m}{n}{<-> ssub * cmsy/m/n}{} -\DeclareFontShape{OMS}{cmtt}{bx}{n}{<-> ssub * cmsy/b/n}{} -% \end{macrocode} -% This substitution is in the standard fd file, but not silent. -% \begin{macrocode} -\DeclareFontShape{OT1}{cmss}{m}{it}{<->ssub*cmss/m/sl}{} -% \begin{macrocode} -\CodelineNumbered -\DisableCrossrefs -% \end{macrocode} -% -% Increase the text width slightly so that width the standard fonts -% 72 columns of code may appear in a |macrocode| environment. -% \changes{v2.0c}{1994/03/15}{Set \cs{textwidth}.} -% \begin{macrocode} -\setlength{\textwidth}{355pt} -% \end{macrocode} -% -% Increase the marginpar width slightly, for long command names. -% And increase the left margin by a similar amount -% \changes{v2.0l} -% {1994/05/25}{Increase \cs{marginparwidth}} -% \changes{v2.0q}{1995/11/28} -% {Increase \cs{marginparwidth} and page margin.} -% \begin{macrocode} -\addtolength\marginparwidth{30pt} -\addtolength\oddsidemargin{20pt} -\addtolength\evensidemargin{20pt} -% \end{macrocode} -% -% -% \begin{macrocode} +\RequirePackage{array,alphalph,color,fixltx2e,enumitem,trace,underscore} +\RequirePackage[T1]{fontenc} +\RequirePackage{lmodern,textcomp} +\RequirePackage{hypdoc} +\let\doc@verbatim\verbatim +\let\enddoc@verbatim\endverbatim +\let\doc@@verbatim\@verbatim +\usepackage{verbatim} +\AtBeginDocument{% + \let\verbatim\doc@verbatim + \let\endverbatim\enddoc@verbatim + \let\@verbatim\doc@@verbatim +} +\cs_set_nopar:Npn \MakePrivateLetters { + \char_make_letter:N \@ + \char_make_letter:N \_ + \char_make_letter:N \: +} \setcounter{StandardModuleDepth}{1} -% \end{macrocode} -% -% \begin{macrocode} -\newcommand{\tn}[1]{{\ttfamily\bslash #1}% - \index{TeX and LaTeX2e commands\actualchar - \string\TeX{} and \string\LaTeXe{} commands:\levelchar - #1\actualchar{\string\ttfamily\string\bslash{}#1}}} -\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}} -% This command will be used to input the patch file -% if that file exists. -\newcommand{\includeltpatch}{% - \def\currentfile{l3patch.ltx} - \part{l3patch} - {\let\ttfamily\relax - \xdef\filekey{\filekey, \thepart={\ttfamily\currentfile}}}% - Things we did wrong\ldots - \IndexInput{l3patch.ltx}} - -% Get the date from ltvers.dtx -\def\patchdate{0} -\begingroup - %%\def\ProvidesFile#1\fmtversion#2{\date{#2}\endinput} - \def\ProvidesFile#1[#2#3]{\date{#2}\endinput} - \input{l3vers.dtx} - \xdef\@date{\@date} - \global\let\X@date=\@date -% Add the patch version if available. - \long\def\Xdef#1#2#3\def#4#5{% - \xdef\X@date{#2}% - \xdef\patchdate{#5}% - \endinput}% - \InputIfFileExists{l3patch.ltx} - {\let\def\Xdef}{\global\let\includeltpatch\relax} -\endgroup - -\ifx\@date\X@date - \def\Xpatch{0} - \ifx\patchdate\Xpatch\else - \edef\@date{\@date\space Patch level \patchdate} - \fi -\else - \@warning{l3patch.ltx does not match l3vers.dtx!} - \let\includeltpatch\relax -\fi - -\providecommand*\eTeX{% +\@addtoreset{CodelineNo}{part} +\cs_set_nopar:Npn \theCodelineNo { + \textcolor[gray]{0.5}{ \sffamily\tiny\arabic{CodelineNo} } +} +\setlength \textwidth { 385pt } +\addtolength \marginparwidth { 30pt } +\addtolength \oddsidemargin { 20pt } +\addtolength \evensidemargin { 20pt } +\cs_set_eq:NN \@@oldlist\list +\cs_set_nopar:Npn \list#1#2{\@@oldlist{#1}{#2\listparindent\z@}} +\setlength \parindent { 0pt } +\setlength \itemindent { 0pt } +\setlength \parskip { \medskipamount } +\AtBeginDocument { + \MakeShortVerb \" + \MakeShortVerb \| +} +\providecommand*\eTeX{ \if b\expandafter\@car\f@series\@nil\boldmath\fi - $\m@th\varepsilon$-\TeX} + $\m@th\varepsilon$-\TeX +} +\cs_set_nopar:Npn \cmd #1 { \cs{\expandafter\cmd@to@cs\string#1} } +\cs_set_nopar:Npn \cmd@to@cs #1#2 { \char\number`#2\relax } +\DeclareRobustCommand \cs [1] { \texttt { \char`\\ #1 } } +\providecommand\marg[1]{ \texttt{\char`\{} \meta{#1} \texttt{\char`\}} } +\providecommand\oarg[1]{ \texttt[ \meta{#1} \texttt] } +\providecommand\parg[1]{ \texttt( \meta{#1} \texttt) } +\cs_set_eq:NN \m \meta +\cs_set_eq:NN \file \nolinkurl +\DeclareRobustCommand \env {\texttt} +\DeclareRobustCommand \pkg {\textsf} +\DeclareRobustCommand \cls {\textsf} +\newenvironment{texnote}{ + \endgraf + \vspace{3mm} + \small\textbf{\TeX~hackers~note:} +}{ + \vspace{3mm} +} +\newcommand\tn[1]{ + \texttt{\bslash #1} + \index{TeX~and~LaTeX2e~commands\actualchar + \string\TeX{}~and~\string\LaTeXe{}~commands:\levelchar + #1\actualchar{\string\ttfamily\string\bslash{}#1}}} +\newenvironment{documentation}{}{} +\newenvironment{implementation}{}{} +\newcommand\EnableDocumentation{% + \renewenvironment{documentation}{}{}% +} +\newcommand\EnableImplementation{% + \renewenvironment{implementation}{}{}% +} +\newcommand\DisableDocumentation{% + \cs_set_eq:NN \documentation \comment + \cs_set_eq:NN \enddocumentation \endcomment +} +\newcommand\DisableImplementation{% + \cs_set_eq:NN \implementation \comment + \cs_set_eq:NN \endimplementation \endcomment +} +\newenvironment{arguments}{ + \enumerate[ + nolistsep, + label=\texttt{\#\arabic*}~:, + labelsep=*, + ] +}{ + \endenumerate +} +\group_begin: +\char_make_active:N \< +\cs_gnew_nopar:Npn \function { + \char_make_active:N \< + \cs_set_eq:NN < \doc_open_meta:n + \group_begin: + \MakePrivateLetters + \char_make_other:N \| + \char_make_other:N \^ + \char_make_other:N \\ + \char_make_space:N \~ + \char_make_ignore:N \ % space + \char_make_ignore:N \^^M + \char_make_ignore:N \^^I + \function_aux:n +} +\group_end: +\cs_set_eq:NN \variable \function +\cs_set_nopar:Npn \function_aux:n #1 { + \cs_set_nopar:Npn \nextnewline{\cs_gset_nopar:Npn\nextnewline{\\}} + \tl_gset_eq:NN \g_doc_macro_tl \c_empty_tl + \bigskip\endgraf\noindent\ttfamily + \tabular[b]{ | l @{} c | } + \hline + \doc_showmacro:w #1 | \q_stop \\ + \hline + \endtabular + \group_end: +} +\cs_set_nopar:Npn \doc_showmacro:w #1 | { + \tl_if_blank:nTF {#1} { + \use_none:n + }{ + \doc_showmacro_aux:w #1 / \q_stop + \peek_meaning:NTF \q_stop { \use_none:n } { \doc_showmacro:w } + } +} +\bool_new:N \l_doc_meta_TF_bool +\bool_new:N \l_doc_meta_EXP_bool +\cs_new_nopar:Npn \doc_showmacro_aux:w #1 / #2 \q_stop { -\providecommand*\file{\texttt} + \tl_if_in:nnTF {#2} { (TF) } { + \bool_gset_true:N \l_doc_meta_TF_bool + }{ + \bool_gset_false:N \l_doc_meta_TF_bool + } + \tl_if_in:nnTF {#2} { (EXP) } { + \bool_gset_true:N \l_doc_meta_EXP_bool + }{ + \bool_gset_false:N \l_doc_meta_EXP_bool + } + \bool_if:NTF \l_doc_meta_TF_bool { + \doc_special_main_index:o { #1 TF } + \seq_gput_right:Nx \g_doc_functions_seq { \tl_to_str:n { #1 TF } } + \seq_gput_right:Nx \g_doc_functions_seq { \tl_to_str:n { #1 T } } + \seq_gput_right:Nx \g_doc_functions_seq { \tl_to_str:n { #1 F } } + }{ + \doc_special_main_index:o { #1 } + \seq_gput_right:Nx \g_doc_functions_seq { \tl_to_str:n { #1 } } + } -\def\vindex#1>#2\@nil{% - \edef\temp{\foo#2<>\@nil}% - \ifx\temp\space\else - \expandafter\SpecialMainIndexB\expandafter{\temp}\fi} + \doc_showmacro_aux_ii:w #1::\q_stop +} +\cs_set_nopar:Npn \doc_showmacro_aux_ii:w #1:#2:#3 \q_stop { + \nextnewline -% remove <foo> from index (quick hack, could be better) -\def\foo#1<#2>#3\@nil{% - #1\ifx\foo#3\foo - \else#2\expandafter\foo\fi#3\@nil} -%\def\foo#1<#2>#3\@nil{#1<#2>#3} -\def\foo#1<#2>#3\@nil{#1} + \tl_if_eq:xxTF {#1} {\g_doc_macro_tl} { + \doc_typeset_aux:n + }{ + \tl_gset:Nn \g_doc_macro_tl {#1} + \use:n + } + { \g_doc_macro_tl } + #3 + #2 + \bool_if:NT \l_doc_meta_TF_bool { \doc_typeset_TF: } + & + \bool_if:NT \l_doc_meta_EXP_bool { + \hspace{\tabcolsep} + $\star$ + } +} +\newenvironment{syntax}{% + \minipage[b]{.7\textwidth}% + \cs_set_nopar:Npn \meta@font@select{\rmfamily\itshape} % (Will: I HATE italic cmtt!) + \small\ttfamily\raggedright + \obeyspaces\obeylines +}{% + \endminipage + \hfil\break + \global\@ignoretrue +} +\tl_map_inline:nn {0123456789} { \cs_gset_eq:cN {char_other_#1} #1 } +\group_begin: + \tl_map_inline:nn {0123456789} { \char_make_active:N #1 } + \cs_gnew:Npn \doc_open_meta:n { + \group_begin: + \tl_map_function:nN {0123456789} \doc_assign_num:n + \doc_close_meta:w + } + \cs_gnew:Npn \Arg { + \texttt{ \char`\{ } + \group_begin: + \tl_map_function:nN {0123456789} \doc_assign_num:n + \doc_close_Arg:n + } +\group_end: +\cs_new_nopar:Npn \doc_close_meta:w #1> { \meta {#1} \group_end: } +\cs_new_nopar:Npn \doc_close_Arg:n #1 { + \meta {#1} + \group_end: + \texttt{ \char`\} } +} +\cs_new_nopar:Npn \doc_assign_num:n #1 { + \cs_set_eq:cc { \string #1 } { char_other_\string #1 } + \char_make_active:N #1 + \cs_set_nopar:Npn #1 { \unskip \, $ {} \sb { \use:c { char_other_\string #1 } } $ } +} +\renewcommand \macro [1][] { + \bool_set_false:N \l_doc_macro_aux_bool + \bool_set_false:N \l_doc_macro_TF_bool + \cs_set_eq:NN \doc_macroname_prefix:n \use:n + \cs_set_eq:NN \doc_macroname_suffix: \c_empty_tl -% Cant remember why I switched from \SpecialMainIndexB -%%\gdef\SpecialMainIndexB#1{\index{\@gobble#1\space\actualchar{\string\verb+#1+}}} + \cs_set_nopar:Npn \KV_key_no_value_elt:n ##1 { \use:c {doc_macro_opt_##1:} } + \KV_parse_space_removal_sanitize:n {#1} -\gdef\SpecialMainIndexB#1{\index{\@gobble#1\actualchar\string\verb - \quotechar*\verbatimchar#1\verbatimchar\encapchar usage}} + \group_begin: + \MakePrivateLetters + \char_make_letter:N \\ + \char_make_ignore:N \ % space + \char_make_ignore:N \^^M + \char_make_ignore:N \^^I + \doc_macro_aux:n +} +\cs_new_nopar:Npn \doc_macro_aux:n #1 { + \group_end: + \clist_map_inline:nn {#1} { \doc_macro_single {##1} } +} +\bool_new:N \l_doc_macro_aux_bool +\bool_new:N \l_doc_macro_TF_bool +\cs_set_nopar:Npn \doc_macro_opt_aux: { \bool_set_true:N \l_doc_macro_aux_bool } +\cs_set_nopar:Npn \doc_macro_opt_TF: { \bool_set_true:N \l_doc_macro_TF_bool } +\cs_set_nopar:Npn \doc_macro_single #1 { -% A helper for later on. -\def\q@nil{\q@nil} -\long\def\tlist@if@blank@p@n #1{% - \expandafter\tlist@if@blank@p@aux@w\detokenize{#1}aa..\q@nil} -\def\tlist@if@blank@p@aux@w #1#2a#3#4\q@nil{% - \ifx #3#400\else01\fi} + \topsep\MacroTopsep + \trivlist + \cs_set_nopar:Npn \makelabel ##1 { \llap{##1} } + \if@inlabel + \cs_set_eq:NN \@tempa \@empty + \count@ \macro@cnt + \loop \ifnum\count@>\z@ + \cs_set_nopar:Npx \@tempa{\@tempa\hbox{\strut}} + \advance\count@\m@ne + \repeat + \cs_set_nopar:Npx \makelabel ##1 { + \llap{\vtop to\baselineskip {\@tempa\hbox{##1}\vss}} + } + \advance \macro@cnt \@ne + \else + \macro@cnt \@ne + \fi + \bool_if:NT \l_doc_macro_aux_bool { + \cs_set_eq:NN \doc_macroname_prefix:n \doc_typeset_aux:n + } + \bool_if:NT \l_doc_macro_TF_bool { + \cs_set_eq:NN \doc_macroname_suffix: \doc_typeset_TF: + } -\let\m\meta -\newenvironment{texnote}% - {\endgraf\vspace{3mm}\textbf{\TeX{}hackers~note:}\small} - {\vspace{3mm}} -% stick the function names in a box. -{\catcode`\|=\active\catcode`\<=\active + \cs_set_nopar:Npx \@tempa { + \exp_not:N \item [ \exp_not:N \doc_print_macroname:n { + \tl_to_str:n {#1} + }] + } \@tempa + \global\advance \c@CodelineNo \@ne + \bool_if:NF \l_doc_macro_aux_bool { + \bool_if:NTF \l_doc_macro_TF_bool { + \seq_gput_right:Nx \g_doc_macros_seq { \tl_to_str:n { #1 TF } } + \seq_gput_right:Nx \g_doc_macros_seq { \tl_to_str:n { #1 T } } + \seq_gput_right:Nx \g_doc_macros_seq { \tl_to_str:n { #1 F } } + }{ + \seq_gput_right:Nx \g_doc_macros_seq { \tl_to_str:n {#1} } + } + } + \bool_if:NTF \l_doc_macro_TF_bool { + \SpecialMainIndex{#1 TF}\nobreak + \DoNotIndex{#1 TF} + }{ + \SpecialMainIndex{#1}\nobreak + \DoNotIndex{#1} + } - -% index fuction lists (could be better...) -\gdef\funcindex#1|{% - \if\tlist@if@blank@p@n{#1}% - \expandafter\@firstoftwo + \global\advance \c@CodelineNo \m@ne + \ignorespaces +} +\cs_set_nopar:Npn \doc_print_macroname:n #1 { + \strut \MacroFont + \doc_macroname_prefix:n {#1} \doc_macroname_suffix: \ % space! +} +\cs_set_nopar:Npn \doc_typeset_TF: { + \color[gray]{0.5} + \underline { \color{black} \itshape TF \kern-0.1em } +} +\cs_set_nopar:Npn \doc_typeset_aux:n #1 { + {\color[gray]{0.5} #1} +} +\newcommand*{\DescribeOption}{ + \leavevmode + \@bsphack + \begingroup + \MakePrivateLetters + \Describe@Option +} +\newcommand*{\Describe@Option}[1]{ + \endgroup + \marginpar{ + \raggedleft + \PrintDescribeEnv{#1} + } + \SpecialOptionIndex{#1} + \@esphack + \ignorespaces +} +\newcommand*{\SpecialOptionIndex}[1]{ + \@bsphack + \begingroup + \HD@target + \let\HDorg@encapchar\encapchar + \edef\encapchar usage{ + \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage} + } + \index{ + #1\actualchar{\protect\ttfamily#1} (option) + \encapchar usage + } + \index{ + options:\levelchar#1\actualchar{\protect\ttfamily#1} + \encapchar usage + } + \endgroup + \@esphack +} +\font\manual=manfnt +\cs_set_nopar:Npn \dbend { {\manual\char127} } +\newenvironment {danger} { + \begin{trivlist}\item[]\noindent + \begingroup\hangindent=2pc\hangafter=-2 + \cs_set_nopar:Npn \par{\endgraf\endgroup} + \hbox to0pt{\hskip-\hangindent\dbend\hfill}\ignorespaces +}{ + \par\end{trivlist} +} +\newenvironment {ddanger} { + \begin{trivlist}\item[]\noindent + \begingroup\hangindent=3.5pc\hangafter=-2 + \cs_set_nopar:Npn \par{\endgraf\endgroup} + \hbox to0pt{\hskip-\hangindent\dbend\kern2pt\dbend\hfill}\ignorespaces +}{ + \par\end{trivlist} +} +\newenvironment{TemplateInterfaceDescription}[1] + {\subsection{The template type `#1'}% + \begingroup + \@beginparpenalty\@M + \description + \def\TemplateArgument##1##2{\item[Arg: ##1]##2\par}% + \def\TemplateSemantics{\enddescription\endgroup + \subsubsection*{Semantics:}}% + } + {\par\bigskip} +\newenvironment{TemplateDescription}[2] + {\subsection{The template `#2' (type #1)}% + \subsubsection*{Attributes:}% + \begingroup + \@beginparpenalty\@M + \description + \def\TemplateKey##1##2##3##4{\item[##1 (##2)]##3% + \ifx\TemplateKey##4\TemplateKey\else + \hfill\penalty500\hbox{}\hfill Default:~##4% + \nobreak\hskip-\parfillskip\hskip0pt\relax + \fi + \par}% + \def\TemplateSemantics{\enddescription\endgroup + \subsubsection*{Semantics \& Comments:}}% + } + {\par\bigskip} +\newenvironment{InstanceDescription}[4][xxxxxxxxxxxxxxx] + {\subsubsection{The instance `#3' (template #2/#4)}% + \subsubsection*{Attribute values:}% + \begingroup + \@beginparpenalty\@M + \def\InstanceKey##1##2{\>\textbf{##1}\>##2\\}% + \def\InstanceSemantics{\endtabbing\endgroup + \vskip-30pt\vskip0pt + \subsubsection*{Layout description \& Comments:}}% + \tabbing + xxxx\=#1\=\kill + } + {\par\bigskip} +\bool_new:N \g_doc_implementation_bool +\cs_set_nopar:Npn \AlsoImplementation { + \bool_set_true:N \g_doc_implementation_bool + \cs_set:Npn \StopEventually ##1 { + \@bsphack + \cs_gset_nopar:Npn \Finale { ##1 \check@checksum } + \init@checksum + \@esphack + } +} +\AlsoImplementation +\cs_set_nopar:Npn \OnlyDescription { + \@bsphack + \bool_set_false:N \g_doc_implementation_bool + \cs_set:Npn \StopEventually ##1 { ##1 \endinput } + \@esphack +} +\cs_set_eq:NN \Finale \relax +\cs_set_nopar:Npn \partname{File} +\clist_new:N \g_docinput_clist +\cs_set:Npn \DocInput #1 { + \clist_map_inline:nn {#1} { + \clist_put_right:Nn \g_docinput_clist {##1} + \MakePercentIgnore + \input{##1} + \MakePercentComment + } +} +\cs_set:Npn \DocInputAgain { + \clist_map_inline:Nn \g_docinput_clist { + \MakePercentIgnore + \input{##1} + \MakePercentComment + } +} +\cs_set_nopar:Npn \partname{File} +\newcommand*{\DocInclude}[1]{% + \relax\clearpage + \docincludeaux + \IfFileExists{#1.fdd}{ + \cs_set_nopar:Npn \currentfile{#1.fdd} + }{ + \cs_set_nopar:Npn \currentfile{#1.dtx} + } + \ifnum\@auxout=\@partaux + \@latexerr{\string\include\space cannot~be~nested}\@eha \else - \expandafter\@secondoftwo + \@docinclude #1 \fi - {\@ifnextchar|{\@gobble}{}}% at the end, look for extra | and remove it - {\def\yyy{#1}\expandafter\vindex\meaning\yyy\@nil \funcindex}% } - -\gdef\function{% - \catcode`\<=\active\def<##1>{\meta{##1}}% - \bigskip - \bgroup - \@makeother\\ - \@makeother\_ - \catcode`\ =9 - \catcode`\^^M=9 - \catcode`\^^I=9 - \catcode`\|=\active\def|{\\}% - \@function} -\gdef\@function#1{% - \ifx\@function#1\@function\else - \funcindex#1| |% +\cs_set_nopar:Npn \@docinclude #1 { + \clearpage + \immediate\write\@mainaux{\string\@input{#1.aux}} + \@tempswatrue + \if@partsw + \@tempswafalse + \cs_set_nopar:Npx \@tempb{#1} + \@for\@tempa:=\@partlist\do{ + \ifx\@tempa\@tempb\@tempswatrue\fi + } \fi - \ttfamily - \endgraf - \noindent\hspace*{-2\parindent}% - \tabular[b]% - {@{\vline\hskip\tabcolsep}l@{\hskip\tabcolsep\vline}}% - \hline - #1\crcr - \hline - \noalign{\kern-2pt}% - \endtabular - \egroup}} - - -\let\variable\function - -% syntax for functions -\def\syntax{% - \@syntax} - -\def\@syntax{% - \minipage[b]{.7\textwidth}% - \small\ttfamily\raggedright - \obeyspaces\obeylines} -\def\endsyntax{\endminipage\hfil\break\global\@ignoretrue} - + \if@tempswa + \cs_set_eq:NN \@auxout\@partaux + \immediate\openout\@partaux #1.aux + \immediate\write\@partaux{\relax} + \cs_set_eq:NN \@ltxdoc@PrintIndex\PrintIndex + \cs_set_eq:NN \PrintIndex\relax + \cs_set_eq:NN \@ltxdoc@PrintChanges\PrintChanges + \cs_set_eq:NN \PrintChanges\relax + \cs_set_eq:NN \@ltxdoc@theglossary\theglossary + \cs_set_eq:NN \@ltxdoc@endtheglossary\endtheglossary + \part{\currentfile} + { + \cs_set_eq:NN \ttfamily\relax + \cs_gset_nopar:Npx \filekey{\filekey, \thepart={\ttfamily\currentfile}} + } + \DocInput{\currentfile} + \cs_set_eq:NN \PrintIndex\@ltxdoc@PrintIndex + \cs_set_eq:NN \PrintChanges\@ltxdoc@PrintChanges + \cs_set_eq:NN \theglossary\@ltxdoc@theglossary + \cs_set_eq:NN \endtheglossary\@ltxdoc@endtheglossary + \clearpage + \@writeckpt{#1} + \immediate\closeout\@partaux + \else + \@nameuse{cp@#1} + \fi + \cs_set_eq:NN \@auxout\@mainaux +} +\cs_gset_nopar:Npn \codeline@wrindex #1 { + \immediate\write\@indexfile { + \string\indexentry{#1} + {\filesep\number\c@CodelineNo} + } +} +\cs_set_eq:NN \filesep \@empty +\cs_set_nopar:Npn \docincludeaux { + \cs_set_nopar:Npn \thepart {\alphalph{part}} + \cs_set_nopar:Npn \filesep {\thepart-} + \cs_set_eq:NN \filekey\@gobble + \g@addto@macro\index@prologue{ + \cs_gset_nopar:Npn\@oddfoot{ + \parbox{\textwidth}{ + \strut\footnotesize + \raggedright{\bfseries File~Key:}~\filekey + } + } + \cs_set_eq:NN \@evenfoot\@oddfoot + } + \cs_gset_eq:NN \docincludeaux\relax + \cs_gset_nopar:Npn\@oddfoot{ + \expandafter\ifx\csname ver@\currentfile\endcsname\relax + File~\thepart :~{\ttfamily\currentfile}~ + \else + \GetFileInfo{\currentfile} + File~\thepart :~{\ttfamily\filename}~ + Date:~\filedate\ % space + Version~\fileversion + \fi + \hfill\thepage + } + \cs_set_eq:NN \@evenfoot \@oddfoot +} +\seq_new:N \g_doc_functions_seq +\seq_new:N \g_doc_macros_seq +\iow_new:N \g_write_func_stream +\iow_open:Nn \g_write_func_stream { \jobname.cmds } +\cs_new_nopar:Npn \doc_show_functions_defined: { + \bool_if:nT { \g_doc_implementation_bool && \g_doc_checkfunc_bool } { + \typeout{ ======================================== ^^J } -%The toks file uses these, Icould not see the original definition... -\let\zz\m -\let\zv\m + \tl_clear:N \l_tmpa_tl + \seq_map_inline:Nn \g_doc_functions_seq { + \seq_if_in:NnT \g_doc_macros_seq {##1} { + \tl_put_right:Nn \l_tmpa_tl { ##1 ^^J } + \iow_now:Nn \g_write_func_stream { ##1 } + } + } + \iow_close:N \g_write_func_stream + \doc_functions_typeout:n { + Functions~both~documented~and~defined:^^J (In~order~of~being~documented) + } -\setcounter{StandardModuleDepth}{1} -\addtolength{\textwidth}{30pt} + \seq_map_inline:Nn \g_doc_functions_seq { + \seq_if_in:NnF \g_doc_macros_seq {##1} { + \tl_put_right:Nn \l_tmpa_tl { ##1 ^^J } + } + } + \doc_functions_typeout:n { Functions~documented~but~not~defined: } -\let\@@oldlist\list -\def\list#1#2{\@@oldlist{#1}{#2\listparindent\z@}} + \seq_map_inline:Nn \g_doc_macros_seq { + \seq_if_in:NnF \g_doc_functions_seq {##1} { + \tl_put_right:Nn \l_tmpa_tl { ##1 ^^J } + } + } + \doc_functions_typeout:n { Functions~defined~but~not~documented: } -\setlength{\parindent}{0pt} -\setlength{\itemindent}{0pt} -\setlength{\parskip}{\medskipamount} - -% \section{DocInclude} -% -% \begin{macrocode} -\@addtoreset{CodelineNo}{part} -% \end{macrocode} -% -% \begin{macro}{\DocInclude} -% More or less exactly the same as |\include|, but uses |\DocInput| -% on a |dtx| file, not |\input| on a |tex| file. -% \changes{v2.0b}{1994/03/14}{Rename from \cs{docinclude}} -% \changes{v2.0f}{1994/03/25}{Use \cs{part}} -% \changes{v2.0u}{1999/08/08}{Also works for .fdd (M. Schroeder)} -% \begin{macrocode} -\def\partname{File} -% \end{macrocode} -% -% \begin{macrocode} -\newcommand*{\DocInclude}[1]{% - \relax - \clearpage - \docincludeaux - \IfFileExists{#1.fdd}{\def\currentfile{#1.fdd}}{\def\currentfile{#1.dtx}}% - \ifnum\@auxout=\@partaux - \@latexerr{\string\include\space cannot be nested}\@eha - \else \@docinclude#1 \fi} -\def\@docinclude#1 {\clearpage -\if@filesw \immediate\write\@mainaux{\string\@input{#1.aux}}\fi -\@tempswatrue\if@partsw \@tempswafalse\edef\@tempb{#1}\@for -\@tempa:=\@partlist\do{\ifx\@tempa\@tempb\@tempswatrue\fi}\fi -\if@tempswa \let\@auxout\@partaux \if@filesw -\immediate\openout\@partaux #1.aux -\immediate\write\@partaux{\relax}\fi -% \end{macrocode} -% We need to save (and later restore) various index-related -% commands which might be changed by the included file. -% \begin{macrocode} -\let\@ltxdoc@PrintIndex\PrintIndex -\let\PrintIndex\relax -\let\@ltxdoc@PrintChanges\PrintChanges -\let\PrintChanges\relax -\let\@ltxdoc@theglossary\theglossary -\let\@ltxdoc@endtheglossary\endtheglossary -\part{\currentfile}% - {\let\ttfamily\relax - \xdef\filekey{\filekey, \thepart={\ttfamily\currentfile}}}% -\DocInput{\currentfile}% -\let\PrintIndex\@ltxdoc@PrintIndex -\let\PrintChanges\@ltxdoc@PrintChanges -\let\theglossary\@ltxdoc@theglossary -\let\endtheglossary\@ltxdoc@endtheglossary -\clearpage -\@writeckpt{#1}\if@filesw \immediate\closeout\@partaux \fi -\else\@nameuse{cp@#1}\fi\let\@auxout\@mainaux} -% \end{macrocode} -% -% \begin{macrocode} -\gdef\codeline@wrindex#1{\if@filesw - \immediate\write\@indexfile - {\string\indexentry{#1}% - {\filesep\number\c@CodelineNo}}\fi}% -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\let\filesep\@empty -% \end{macrocode} -% -% \begin{macro}{\docincludeaux} -% \changes{v2.06}{1994/03/31}{Use \cs{footnotesize} in file key.} -% \changes{v2.0k}{1994/05/21}{Use \cs{aalph}} -% \begin{macrocode} -\def\docincludeaux{% - \def\thepart{\aalph{part}}\def\filesep{\thepart-}% - \let\filekey\@gobble - \g@addto@macro\index@prologue{% - \gdef\@oddfoot{\parbox{\textwidth}{\strut\footnotesize - \raggedright{\bfseries File Key:} \filekey}}% - \let\@evenfoot\@oddfoot}% - \global\let\docincludeaux\relax - \gdef\@oddfoot{% - \expandafter\ifx\csname ver@\currentfile\endcsname\relax - File \thepart: {\ttfamily\currentfile} % - \else - \GetFileInfo{\currentfile}% - File \thepart: {\ttfamily\filename} % - Date: \filedate\ % - Version \fileversion - \fi - \hfill\thepage}% - \let\@evenfoot\@oddfoot}% -% \end{macrocode} -% \end{macro} -% -% -% \begin{macrocode} -\def\task#1#2{} -%</class> -% \end{macrocode} -% \Finale -% + \typeout{ ======================================== } + } +} +\AtEndDocument{ \doc_show_functions_defined: } +\cs_set_nopar:Npn \doc_functions_typeout:n #1 { + \tl_if_empty:NF \l_tmpa_tl { + \typeout{ + -------------------------------------- ^^J #1 ^^J + -------------------------------------- ^^J \l_tmpa_tl + } + \tl_clear:N \l_tmpa_tl + } +} +\g@addto@macro\theindex{\MakePrivateLetters} +\setcounter{IndexColumns}{2} +\IndexPrologue{ + \part*{Index} + \markboth{Index}{Index} + \addcontentsline{toc}{part}{Index} + The~italic~numbers~denote~the~pages~where~the~ + corresponding~entry~is~described,~ + numbers~underlined~point~to~the~definition,~ + all~others~indicate~the~places~where~it~is~used. +} +\cs_set_nopar:Npn \doc_special_main_index:n #1 { + \index{ + \@gobble#1 + \actualchar + \string\verb\quotechar*\verbatimchar#1\verbatimchar + \encapchar + hdpgindex{\thepage}{usage} + } +} +\cs_set_nopar:Npn \doc_special_main_index:o { \exp_args:No \doc_special_main_index:n } +\cs_set_nopar:Npn \hdpgindex #1#2#3 { + \csname\ifx\\#2\\relax\else#2\fi\endcsname{ + \hyperlink{page.#1}{#3} + } +} +\g@addto@macro \PrintIndex { \AtEndDocument{ \typeout{^^J + ========================================^^J + Generate~the~index~by~executing^^J + \msg_four_spaces: makeindex~-s~l3doc.ist~-o~\jobname.ind~\jobname.idx^^J + ========================================^^J + }} +} +\GlossaryPrologue{ + \part*{Change~History} + {\GlossaryParms\ttfamily\hyphenchar\font=`\-} + \markboth{Change~History}{Change~History} + \addcontentsline{toc}{part}{Change~History} +} +\g@addto@macro \PrintChanges { \AtEndDocument{ \typeout{^^J + ========================================^^J + Generate~the~change~list~by~executing^^J + \msg_four_spaces: makeindex~-s~gglo.ist~~-o~\jobname.gls~\jobname.glo^^J + ========================================^^J + }} +} +\cs_new_nopar:Npn \includeltpatch { + \cs_set_nopar:Npn \currentfile {l3patch.ltx} + \part{l3patch} + {\cs_set_eq:NN \ttfamily\relax + \cs_gset_nopar:Npx \filekey{\filekey, \thepart={\ttfamily\currentfile}}} + Things~we~did~wrong\ldots + \IndexInput{l3patch.ltx}} +\cs_set_nopar:Npn \patchdate{0} +\begingroup + %%\cs_set_nopar:Npn \ProvidesFile#1\fmtversion#2{\date{#2}\endinput} + \cs_set_nopar:Npn \ProvidesFile#1[#2#3]{\date{#2}\endinput} + \input{l3vers.dtx} + \cs_gset_nopar:Npx \@date{\@date} + \cs_gset_eq:NN \X@date \@date + \cs_set:Npn \Xdef#1#2#3\def#4#5 { + \cs_gset_nopar:Npx \X@date{#2} + \cs_gset_nopar:Npx \patchdate{#5} + \endinput + } + \InputIfFileExists{l3patch.ltx}{ + \cs_set_eq:NN \cs_set_nopar:Npn \Xdef + }{ + \cs_gset_eq:NN \includeltpatch \relax + } +\endgroup +\ifx\@date\X@date + \cs_set_nopar:Npn \Xpatch{0} + \ifx\patchdate\Xpatch\else + \cs_set_nopar:Npx \@date {\@date\space Patch level \patchdate} + \fi +\else + \@warning{l3patch.ltx does not match l3vers.dtx!} + \cs_set_eq:NN \includeltpatch \relax +\fi +\bool_if:NTF \g_doc_full_bool { + \RecordChanges + \CodelineIndex + \EnableCrossrefs + \AlsoImplementation +}{ + \CodelineNumbered + \DisableCrossrefs + \OnlyDescription +} +\InputIfFileExists{l3doc.cfg}{ + \typeout{*************************************^^J + *~Local~config~file~l3doc.cfg~used ^^J + *************************************} +}{} +%% +%% +%% End of file `l3doc.cls'. |