From ca1c73f9a8de69e467230c4a57ccf8b07cd275a9 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 16 Aug 2012 22:41:08 +0000 Subject: finish l3 update git-svn-id: svn://tug.org/texlive/trunk@27427 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/l3kernel/l3doc.dtx | 2040 +++++++++++---------- 1 file changed, 1091 insertions(+), 949 deletions(-) (limited to 'Master/texmf-dist/source/latex/l3kernel/l3doc.dtx') diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx index 137d75f056f..8e0c1fd39e8 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx @@ -38,7 +38,7 @@ \ifx\fmtname\nameofplainTeX\else \expandafter\begingroup \fi -\input docstrip.tex +\input l3docstrip.tex \askforoverwritefalse \preamble @@ -78,7 +78,7 @@ Do not distribute a modified version of this file. % % %<*driver|class> -\GetIdInfo$Id: l3doc.dtx 3989 2012-07-16 01:15:43Z bruno $ +\GetIdInfo$Id: l3doc.dtx 4070 2012-08-09 11:04:46Z joseph $ {L3 Experimental documentation class} % % @@ -463,85 +463,71 @@ Do not distribute a modified version of this file. %<*class> % \end{macrocode} % +% \begin{macrocode} +%<@@=codedoc> +% \end{macrocode} +% % \subsection{Variables} % % \begin{macrocode} -\coffin_new:N \l_doc_output_box -\coffin_new:N \l_doc_names_coffin -\coffin_new:N \l_doc_descr_coffin -\coffin_new:N \l_doc_syntax_coffin -\bool_new:N \l_doc_long_name_bool -\bool_new:N \g_doc_implementation_bool -\dim_new:N \l_doc_trial_width_dim -\tl_new:N \l_doc_macro_tl -\int_new:N \l_doc_macro_int -\int_new:N \g_doc_nested_macro_int -\prop_new:N \g_doc_missing_tests_prop +\coffin_new:N \l_@@_output_box +\coffin_new:N \l_@@_names_coffin +\coffin_new:N \l_@@_descr_coffin +\coffin_new:N \l_@@_syntax_coffin +\box_new:N \g_@@_syntax_box +\bool_new:N \l_@@_long_name_bool +\bool_new:N \g_@@_implementation_bool +\dim_new:N \l_@@_trial_width_dim +\tl_new:N \l_@@_macro_tl +\int_new:N \l_@@_macro_int +\int_new:N \g_@@_nested_macro_int +\int_new:N \g_@@_codeline_int +\prop_new:N \g_@@_missing_tests_prop \clist_new:N \g_docinput_clist +\tl_new:N \l_@@_at_replaced_macro_tl % \end{macrocode} % % \begin{macrocode} -\seq_new:N \g_doc_testfiles_seq +\seq_new:N \g_@@_testfiles_seq \seq_new:N \g_doc_functions_seq \seq_new:N \g_doc_macros_seq -\seq_new:N \g_doc_not_tested_seq +\seq_new:N \g_@@_not_tested_seq % \end{macrocode} % % For function/macro environments: % \begin{macrocode} -\bool_new:N \l_doc_meta_TF_bool -\bool_new:N \l_doc_meta_pTF_bool -\bool_new:N \l_doc_meta_EXP_bool -\bool_new:N \l_doc_meta_rEXP_bool -\bool_new:N \l_doc_macro_internal_bool -\bool_new:N \l_doc_macro_aux_bool -\bool_new:N \l_doc_macro_TF_bool -\bool_new:N \l_doc_macro_pTF_bool -\bool_new:N \l_doc_macro_var_bool +\bool_new:N \l_@@_meta_TF_bool +\bool_new:N \l_@@_meta_pTF_bool +\bool_new:N \l_@@_meta_EXP_bool +\bool_new:N \l_@@_meta_rEXP_bool +\bool_new:N \l_@@_macro_internal_bool +\bool_new:N \l_@@_macro_aux_bool +\bool_new:N \l_@@_macro_TF_bool +\bool_new:N \l_@@_macro_pTF_bool +\bool_new:N \l_@@_macro_var_bool % \end{macrocode} % % For package options: % \begin{macrocode} -\bool_new:N \g_doc_full_bool -\bool_new:N \g_doc_lmodern_bool -\bool_new:N \g_doc_checkfunc_bool -\bool_new:N \g_doc_checktest_bool +\bool_new:N \g_@@_full_bool +\bool_new:N \g_@@_lmodern_bool +\bool_new:N \g_@@_checkfunc_bool +\bool_new:N \g_@@_checktest_bool % \end{macrocode} % % Temporaries: % \begin{macrocode} -\seq_new:N \g_doc_tmpa_seq -\tl_new:N \l_doc_tmpa_tl -\tl_new:N \l_doc_tmpb_tl -\int_new:N \l_doc_tmpa_int +\seq_new:N \g_@@_tmpa_seq +\tl_new:N \l_@@_tmpa_tl +\tl_new:N \l_@@_tmpb_tl +\int_new:N \l_@@_tmpa_int % \end{macrocode} % % Other: % \begin{macrocode} -\bool_new:N \l_doc_tested_bool +\bool_new:N \l_@@_tested_bool % \end{macrocode} % -% \subsection{expl3 extras} -% -% \begin{macro} -% { -% \coffin_gset_eq:NN, \coffin_gset_eq:Nc, -% \coffin_gset_eq:cN, \coffin_gset_eq:cc -% } -% Setting two coffins equal is just a wrapper around other functions. -% Slightly naughty use of an internal coffin function here, but \ldots -% \begin{macrocode} -\cs_set_protected_nopar:Npn \coffin_gset_eq:NN #1#2 - { - \coffin_if_exist:NT #1 - { - \box_gset_eq:NN #1 #2 - \__coffin_gset_eq_structure:NN #1 #2 - } - } -\cs_generate_variant:Nn \coffin_gset_eq:NN { c , Nc , cc } -% \end{macrocode} -% \end{macro} % % % \subsection{Options and configuration} @@ -552,23 +538,23 @@ Do not distribute a modified version of this file. % % % \begin{macrocode} -\DeclareOption{full}{ \bool_set_true:N \g_doc_full_bool } -\DeclareOption{onlydoc}{ \bool_set_false:N \g_doc_full_bool } +\DeclareOption{full}{ \bool_set_true:N \g_@@_full_bool } +\DeclareOption{onlydoc}{ \bool_set_false:N \g_@@_full_bool } % \end{macrocode} % % \begin{macrocode} -\DeclareOption{check}{ \bool_set_true:N \g_doc_checkfunc_bool } -\DeclareOption{nocheck}{ \bool_set_false:N \g_doc_checkfunc_bool } +\DeclareOption{check}{ \bool_set_true:N \g_@@_checkfunc_bool } +\DeclareOption{nocheck}{ \bool_set_false:N \g_@@_checkfunc_bool } % \end{macrocode} % % \begin{macrocode} -\DeclareOption{checktest}{ \bool_set_true:N \g_doc_checktest_bool } -\DeclareOption{nochecktest}{ \bool_set_false:N \g_doc_checktest_bool } +\DeclareOption{checktest}{ \bool_set_true:N \g_@@_checktest_bool } +\DeclareOption{nochecktest}{ \bool_set_false:N \g_@@_checktest_bool } % \end{macrocode} % % \begin{macrocode} -\DeclareOption{cm-default}{ \bool_set_false:N \g_doc_lmodern_bool } -\DeclareOption{lm-default}{ \bool_set_true:N \g_doc_lmodern_bool } +\DeclareOption{cm-default}{ \bool_set_false:N \g_@@_lmodern_bool } +\DeclareOption{lm-default}{ \bool_set_true:N \g_@@_lmodern_bool } % \end{macrocode} % % \begin{macrocode} @@ -580,14 +566,14 @@ Do not distribute a modified version of this file. % % \begin{macrocode} \msg_new:nnn {l3doc} {input-cfg} - { - Local~config~file~l3doc.cfg~loaded. - } + { + Local~config~file~l3doc.cfg~loaded. + } \file_if_exist:nT {l3doc.cfg} - { - \file_input:n {l3doc.cfg} - \msg_info:nn {l3doc} {input-cfg} - } + { + \file_input:n {l3doc.cfg} + \msg_info:nn {l3doc} {input-cfg} + } % \end{macrocode} % % \begin{macrocode} @@ -609,13 +595,15 @@ Do not distribute a modified version of this file. color, colortbl, fixltx2e, + hologo, enumitem, pifont, textcomp, trace, underscore, csquotes, - fancyvrb + fancyvrb, + verbatim } \raggedbottom % \end{macrocode} @@ -630,57 +618,36 @@ Do not distribute a modified version of this file. % \end{macrocode} % % \begin{macrocode} -\bool_if:NT \g_doc_lmodern_bool { +\bool_if:NT \g_@@_lmodern_bool + { \RequirePackage[T1]{fontenc} \RequirePackage{lmodern} % \end{macrocode} % Now replace the italic typewriter font with the oblique shape instead; % the former makes my skin crawl. (Will, Aug 2011) % \begin{macrocode} - \begingroup + \group_begin: \ttfamily \DeclareFontShape{T1}{lmtt}{m}{it}{<->ec-lmtto10}{} - \endgroup -} + \group_end: + } % \end{macrocode} % +% Must be last, as usual. % \begin{macrocode} \RequirePackage{hypdoc} % \end{macrocode} -% Just want the "comment" environment from \pkg{verbatim}: -% \begin{macrocode} -\let\doc@verbatim\verbatim -\let\enddoc@verbatim\endverbatim -\let\doc@@verbatim\@verbatim -\expandafter\let\csname doc@verbatim*\expandafter\endcsname - \csname verbatim*\endcsname -\expandafter\let\csname enddoc@verbatim*\expandafter\endcsname - \csname endverbatim*\endcsname -\expandafter\let\csname doc@@verbatim*\expandafter\endcsname - \csname @verbatim*\endcsname -\RequirePackage{verbatim} -\AtBeginDocument{% - \let\verbatim\doc@verbatim - \let\endverbatim\enddoc@verbatim - \let\@verbatim\doc@@verbatim - \expandafter\let\csname verbatim*\expandafter\endcsname - \csname doc@verbatim*\endcsname - \expandafter\let\csname endverbatim*\expandafter\endcsname - \csname enddoc@verbatim*\endcsname - \expandafter\let\csname @verbatim*\expandafter\endcsname - \csname doc@@verbatim*\endcsname -} -% \end{macrocode} % % \subsection{Configuration} % % \begin{macro}{\MakePrivateLetters} % \begin{macrocode} -\cs_set_nopar:Npn \MakePrivateLetters { +\cs_set_nopar:Npn \MakePrivateLetters + { \char_set_catcode_letter:N \@ \char_set_catcode_letter:N \_ \char_set_catcode_letter:N \: -} + } % \end{macrocode} % \end{macro} % @@ -712,18 +679,19 @@ Do not distribute a modified version of this file. % % Customise lists: % \begin{macrocode} -\cs_set_eq:NN \@@oldlist\list -\cs_set_nopar:Npn \list#1#2{\@@oldlist{#1}{#2\listparindent\z@}} +\cs_set_eq:NN \@@_oldlist:nn \list +\cs_set_nopar:Npn \list #1 #2 { \@@_oldlist:nn {#1} { #2 \listparindent\z@ } } \setlength \parindent { 2em } \setlength \itemindent { 0pt } \setlength \parskip { 0pt plus 3pt minus 0pt } % \end{macrocode} % -% % Customise TOC (as we have so many sections). Different design and/or % structure is called for ): % \begin{macrocode} -\cs_set_nopar:Npn \l@section #1#2 { +\@addtoreset{section}{part} +\cs_set_nopar:Npn \l@section #1#2 + { \ifnum \c@tocdepth >\z@ \addpenalty\@secpenalty \addvspace{1.0em \@plus\p@} @@ -736,7 +704,8 @@ Do not distribute a modified version of this file. \hskip -\leftskip #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par \endgroup - \fi} + \fi + } \cs_set_nopar:Npn\l@subsection{\@dottedtocline{2}{2.5em}{2.3em}} % #2 = 1.5em % \end{macrocode} % @@ -747,26 +716,20 @@ Do not distribute a modified version of this file. % the document preamble, where an active character may interfere % with packages that are loaded. % \begin{macrocode} -\AtBeginDocument { +\AtBeginDocument + { \MakeShortVerb \" \MakeShortVerb \| -} + } % \end{macrocode} % % \begin{macrocode} -\providecommand*\eTeX{ - \if b\expandafter\@car\f@series\@nil\boldmath\fi - $\m@th\varepsilon$-\TeX -} -\providecommand*\IniTeX{Ini\TeX} +\providecommand*\eTeX{\hologo{eTeX}} +\providecommand*\IniTeX{\hologo{iniTeX}} \providecommand*\Lua{Lua} -\providecommand*\LuaTeX{\Lua\TeX} -\providecommand*\pdfTeX{pdf\TeX} -\RequirePackage{graphicx} -\cs_if_free:NT \XeTeX { - \cs_new_protected_nopar:Npn \XeTeX - {X\kern-.125em\lower.5ex\hbox{\reflectbox{E}}\kern-.1667em\TeX} -} +\providecommand*\LuaTeX{\hologo{LuaTeX}} +\providecommand*\pdfTeX{\hologo{pdfTeX}} +\providecommand*\XeTeX{\hologo{XeTeX}} % \end{macrocode} % % \begin{macro}{\cmd,\cs} @@ -775,23 +738,32 @@ Do not distribute a modified version of this file. % syntax. There is a bit of shuffling around to make sure that |_| % has the catcode that \cs{doc_replace_at_at:N} expects, without % rescanning the whole argument. For that we store in -% \cs{l_doc_tmpb_tl} a single underscore with the current catcode, +% \cs{l_@@_tmpb_tl} a single underscore with the current catcode, % then replace all such underscores by letter underscores in |#1| % (stored in the |tmpa| token list). After calling % \cs{doc_replace_at_at:N}, we replace the underscores back to their % old meaning before using the token list. % \begin{macrocode} -\cs_set_nopar:Npn \cmd #1 { \cs{\expandafter \doc_cmd_to_cs:w \string#1} } -\cs_set_nopar:Npn \doc_cmd_to_cs:w #1#2 { \char\number`#2\relax } -\DeclareRobustCommand \cs [1] - { - \tl_set_rescan:Nnn \l_doc_tmpb_tl { } { _ } - \tl_set:Nn \l_doc_tmpa_tl {#1} - \tl_replace_all:NVn \l_doc_tmpa_tl \l_doc_tmpb_tl { _ } - \doc_replace_at_at:N \l_doc_tmpa_tl - \tl_replace_all:NnV \l_doc_tmpa_tl { _ } \l_doc_tmpb_tl - \texttt { \char`\\ \tl_use:N \l_doc_tmpa_tl} - } +\DeclareDocumentCommand \cmd {m} { \@@_cmd:n { #1 } } +\DeclareDocumentCommand \cs {m} { \@@_cs:n { #1 } } +% \end{macrocode} +% +% This is |\cmd{\foo}| and |\cs{foo}|: \cmd\foo\ and \cs{foo}. +% \begin{macrocode} +\cs_new:Npn \@@_cmd:n #1 { \cs{ \expandafter \@@_cmd_to_cs:w \string#1 } } +\cs_set_nopar:Npn \@@_cmd_to_cs:w #1#2 { \char\number`#2\relax } +% \end{macrocode} +% +% \begin{macrocode} +\cs_new:Npn \@@_cs:n #1 + { + \tl_set_rescan:Nnn \l_@@_tmpb_tl { } { _ } + \tl_set:Nn \l_@@_tmpa_tl {#1} + \tl_replace_all:NVn \l_@@_tmpa_tl \l_@@_tmpb_tl { _ } + \@@_replace_at_at:N \l_@@_tmpa_tl + \tl_replace_all:NnV \l_@@_tmpa_tl { _ } \l_@@_tmpb_tl + \texttt { \char`\\ \tl_use:N \l_@@_tmpa_tl} + } \cs_generate_variant:Nn \tl_replace_all:Nnn { NV , NnV } % \end{macrocode} % \end{macro} @@ -819,13 +791,15 @@ Do not distribute a modified version of this file. % % \begin{environment}{texnote} % \begin{macrocode} -\newenvironment{texnote}{ +\newenvironment{texnote} + { \endgraf \vspace{3mm} \small\textbf{\TeX~hackers~note:} -}{ + } + { \vspace{3mm} -} + } % \end{macrocode} % \end{environment} % @@ -833,11 +807,16 @@ Do not distribute a modified version of this file. % As \cs{cs}. Use this to mark up all \TeX\ and \LaTeXe\ commands; they % then end up together in the index. TODO: hyperlinks in the index entries. % \begin{macrocode} -\newcommand\tn[1]{ +\DeclareDocumentCommand \tn {m} + { \texttt { \char`\\ #1 } - \index{TeX~and~LaTeX2e~commands\actualchar - \string\TeX{}~and~\string\LaTeXe{}~commands:\levelchar - #1\actualchar{\string\ttfamily\string\bslash{}#1}}} + \index + { + TeX~and~LaTeX2e~commands\actualchar + \string\TeX{}~and~\string\LaTeXe{}~commands:\levelchar + #1\actualchar{\string\ttfamily\string\bslash{}#1} + } + } % \end{macrocode} % \end{macro} % @@ -846,31 +825,40 @@ Do not distribute a modified version of this file. % \begin{macro}{\EnableDocumentation,\EnableImplementation} % \begin{macro}{\DisableDocumentation,\DisableImplementation} % \begin{macrocode} -\cs_new:Npn \doc_implementation: { - \DeclareDocumentCommand {\variable} { O{} } { \doc_macro:n { var , ##1 } } +\cs_new:Npn \@@_implementation: + { + \DeclareDocumentCommand {\variable} { O{} } { \@@_macro:n { var , ##1 } } \cs_set_eq:NN \endvariable \endmacro -} -\cs_new:Npn \doc_docu: { + } +\cs_new:Npn \@@_docu: + { \cs_set_eq:NN \variable \variabledoc \cs_set_eq:NN \endvariable \endvariabledoc -} -\AtEndOfPackage{\doc_docu:} -\newenvironment{documentation}{\doc_docu:}{} -\newenvironment{implementation}{\doc_implementation:}{} -\newcommand\EnableDocumentation{% - \renewenvironment{documentation}{\doc_docu:}{}% -} -\newcommand\EnableImplementation{% - \renewenvironment{implementation}{\doc_implementation:}{}% -} -\newcommand\DisableDocumentation{% + } +\AtEndOfPackage{\@@_docu:} +\newenvironment{documentation}{\@@_docu:}{} +\newenvironment{implementation}{\@@_implementation:}{} +% \end{macrocode} +% +% \begin{macrocode} +\NewDocumentCommand \EnableDocumentation {} + { + \renewenvironment{documentation}{\@@_docu:}{} + } +\NewDocumentCommand \EnableImplementation {} + { + \renewenvironment{implementation}{\@@_implementation:}{} + } +\NewDocumentCommand \DisableDocumentation {} + { \cs_set_eq:NN \documentation \comment \cs_set_eq:NN \enddocumentation \endcomment -} -\newcommand\DisableImplementation{% + } +\NewDocumentCommand \DisableImplementation {} + { \cs_set_eq:NN \implementation \comment \cs_set_eq:NN \endimplementation \endcomment -} + } % \end{macrocode} % \end{macro} % \end{macro} @@ -881,44 +869,47 @@ Do not distribute a modified version of this file. % This environment is designed to be used within a \env{macro} environment % to describe the arguments of the macro/function. % \begin{macrocode} -\newenvironment{arguments}{ +\newenvironment{arguments} + { \enumerate[ nolistsep, label=\texttt{\#\arabic*}~:, labelsep=*, ] -}{ + } + { \endenumerate -} + } % \end{macrocode} % \end{environment} % % \begin{macrocode} \keys_define:nn { l3doc/function } - { - TF .code:n = - { - \bool_gset_true:N \l_doc_meta_TF_bool - } , - EXP .code:n = - { - \bool_gset_true:N \l_doc_meta_EXP_bool - \bool_gset_false:N \l_doc_meta_rEXP_bool - } , - rEXP .code:n = - { - \bool_gset_false:N \l_doc_meta_EXP_bool - \bool_gset_true:N \l_doc_meta_rEXP_bool - } , - pTF .code:n = - { - \bool_gset_true:N \l_doc_meta_pTF_bool - \bool_gset_true:N \l_doc_meta_TF_bool - \bool_gset_true:N \l_doc_meta_EXP_bool - } , - added .tl_set:N = \l_doc_date_added_tl , - updated .tl_set:N = \l_doc_date_updated_tl , - } + { + TF .code:n = + { + \bool_gset_true:N \l_@@_meta_TF_bool + } , + EXP .code:n = + { + \bool_gset_true:N \l_@@_meta_EXP_bool + \bool_gset_false:N \l_@@_meta_rEXP_bool + } , + rEXP .code:n = + { + \bool_gset_false:N \l_@@_meta_EXP_bool + \bool_gset_true:N \l_@@_meta_rEXP_bool + } , + pTF .code:n = + { + \bool_gset_true:N \l_@@_meta_pTF_bool + \bool_gset_true:N \l_@@_meta_TF_bool + \bool_gset_true:N \l_@@_meta_EXP_bool + } , + added .tl_set:N = \l_@@_date_added_tl , + updated .tl_set:N = \l_@@_date_updated_tl , + tested .code:n = { } , + } % \end{macrocode} % % @@ -930,23 +921,25 @@ Do not distribute a modified version of this file. % Ignore spaces and sanitize with catcodes before reading argument. % \begin{macrocode} \char_set_catcode_active:N \< -\DeclareDocumentEnvironment {function} { O{} } { +\DeclareDocumentEnvironment {function} { O{} } + { \par\bigskip\noindent \phantomsection - \coffin_clear:N \l_doc_descr_coffin - \coffin_clear:N \l_doc_syntax_coffin - \coffin_clear:N \l_doc_names_coffin + \coffin_clear:N \l_@@_descr_coffin + \box_gclear:N \g_@@_syntax_box + \coffin_clear:N \l_@@_syntax_coffin + \coffin_clear:N \l_@@_names_coffin - \bool_set_false:N \l_doc_meta_TF_bool - \bool_set_false:N \l_doc_meta_pTF_bool - \bool_set_false:N \l_doc_meta_EXP_bool - \bool_set_false:N \l_doc_meta_rEXP_bool + \bool_set_false:N \l_@@_meta_TF_bool + \bool_set_false:N \l_@@_meta_pTF_bool + \bool_set_false:N \l_@@_meta_EXP_bool + \bool_set_false:N \l_@@_meta_rEXP_bool \keys_set:nn { l3doc/function } {#1} - \char_set_active_eq:NN < \doc_open_meta:w + \char_set_active_eq:NN < \@@_open_meta:w \group_begin: \MakePrivateLetters @@ -957,96 +950,101 @@ Do not distribute a modified version of this file. \char_set_catcode_ignore:N \^^I \exp_after:wN \group_end: - \function_aux:n - } - { - \vcoffin_set_end: - \bool_if:NTF \l_doc_long_name_bool - { - \coffin_join:NnnNnnnn - \l_doc_output_box {hc} {vc} - \l_doc_syntax_coffin {l} {T} - {0pt} {0pt} - \coffin_join:NnnNnnnn - \l_doc_output_box {l} {t} - \l_doc_names_coffin {r} {t} - {-\marginparsep} {0pt} - \coffin_join:NnnNnnnn - \l_doc_output_box {l} {b} - \l_doc_descr_coffin {l} {t} - {0.75\marginparwidth + \marginparsep} {-\medskipamount} + \@@_function:n + } + { + \vcoffin_set_end: + \hcoffin_set:Nn \l_@@_syntax_coffin { \box_use:N \g_@@_syntax_box } +% \end{macrocode} +% \cs{g_@@_syntax_box} is defined in the syntax environment. +% \begin{macrocode} + \bool_if:NTF \l_@@_long_name_bool + { + \coffin_join:NnnNnnnn + \l_@@_output_box {hc} {vc} + \l_@@_syntax_coffin {l} {T} + {0pt} {0pt} + \coffin_join:NnnNnnnn + \l_@@_output_box {l} {t} + \l_@@_names_coffin {r} {t} + {-\marginparsep} {0pt} + \coffin_join:NnnNnnnn + \l_@@_output_box {l} {b} + \l_@@_descr_coffin {l} {t} + {0.75\marginparwidth + \marginparsep} {-\medskipamount} - \coffin_typeset:Nnnnn \l_doc_output_box {\l_doc_descr_coffin-l} {\l_doc_descr_coffin-t} {0pt} {0pt} - } - { - \coffin_join:NnnNnnnn - \l_doc_output_box {hc} {vc} - \l_doc_syntax_coffin {l} {t} - {0pt} {0pt} - \coffin_join:NnnNnnnn - \l_doc_output_box {l} {b} - \l_doc_descr_coffin {l} {t} - {0pt} {-\medskipamount} - \coffin_join:NnnNnnnn - \l_doc_output_box {l} {t} - \l_doc_names_coffin {r} {t} - {-\marginparsep} {0pt} + \coffin_typeset:Nnnnn \l_@@_output_box {\l_@@_descr_coffin-l} {\l_@@_descr_coffin-t} {0pt} {0pt} + } + { + \coffin_join:NnnNnnnn + \l_@@_output_box {hc} {vc} + \l_@@_syntax_coffin {l} {t} + {0pt} {0pt} + \coffin_join:NnnNnnnn + \l_@@_output_box {l} {b} + \l_@@_descr_coffin {l} {t} + {0pt} {-\medskipamount} + \coffin_join:NnnNnnnn + \l_@@_output_box {l} {t} + \l_@@_names_coffin {r} {t} + {-\marginparsep} {0pt} - \coffin_typeset:Nnnnn - \l_doc_output_box {\l_doc_syntax_coffin-l} {\l_doc_syntax_coffin-T} - {0pt} {0pt} - } - \par - \allowbreak - } + \coffin_typeset:Nnnnn + \l_@@_output_box {\l_@@_syntax_coffin-l} {\l_@@_syntax_coffin-T} + {0pt} {0pt} + } + \par + \allowbreak + } \char_set_catcode_other:N \< \cs_set_eq:NN \variabledoc \function \cs_set_eq:NN \endvariabledoc \endfunction % \end{macrocode} % % -% \begin{macro}{\function_aux:n} +% \begin{macro}{\@@_function:n} % \begin{arguments} % \item Comma-separated list of functions; % input has already been sanitised by catcode changes before reading % the argument. % \end{arguments} % \begin{macrocode} -\cs_set_nopar:Npn \function_aux:n #1 { +\cs_set_nopar:Npn \@@_function:n #1 + { - \tl_set:Nn \l_doc_function_input_tl {#1} + \tl_set:Nn \l_@@_function_input_tl {#1} - \dim_zero:N \l_doc_trial_width_dim - \hcoffin_set:Nn \l_doc_names_coffin { \function_typeset:n {#1} } - \dim_set:Nn \l_doc_trial_width_dim { \box_wd:N \l_doc_names_coffin } + \dim_zero:N \l_@@_trial_width_dim + \hcoffin_set:Nn \l_@@_names_coffin { \function_typeset:n {#1} } + \dim_set:Nn \l_@@_trial_width_dim { \box_wd:N \l_@@_names_coffin } - \bool_set:Nn \l_doc_long_name_bool - { \dim_compare_p:nNn \l_doc_trial_width_dim > \marginparwidth } + \bool_set:Nn \l_@@_long_name_bool + { \dim_compare_p:nNn \l_@@_trial_width_dim > \marginparwidth } - \vcoffin_set:Nnw \l_doc_descr_coffin {\textwidth} + \vcoffin_set:Nnw \l_@@_descr_coffin {\textwidth} \noindent\ignorespaces -} + } \cs_gset_nopar:Npn \function_typeset:n #1 %^^A todo: use "\cs_new:Npn" here - { - \tl_gclear:N \g_doc_macro_tl + { + \tl_gclear:N \g_@@_macro_tl - % populate "\l_doc_functions_block_prop" with info on the functions present: - \clist_map_function:nN {#1} \doc_parse_functions:n + % populate "\l_@@_functions_block_prop" with info on the functions present: + \clist_map_function:nN {#1} \@@_parse_functions:n - \small\ttfamily - \begin{tabular}{ @{} l @{} r @{} } - \toprule - \prop_map_function:NN \l_doc_functions_block_prop \doc_typeset_functions:nn - \doc_typeset_dates: - \bottomrule - \end{tabular} - \normalfont\normalsize - } + \small\ttfamily + \begin{tabular}{ @{} l @{} r @{} } + \toprule + \prop_map_function:NN \l_@@_functions_block_prop \@@_typeset_functions:nn + \@@_typeset_dates: + \bottomrule + \end{tabular} + \normalfont\normalsize + } % \end{macrocode} % \end{macro} % -% \begin{macro}{\doc_parse_functions:n} -% The idea here is to populate "\l_doc_functions_block_prop" with information +% \begin{macro}{\@@_parse_functions:n} +% The idea here is to populate "\l_@@_functions_block_prop" with information % about the functions being typeset and their variants. % The property list uses a specific format: the keys contained are the function `names' (stripped of signature) with values specified by a comma-separated list containing two brace groups per item: % \begin{center} @@ -1054,289 +1052,311 @@ Do not distribute a modified version of this file. % \end{center} % This somewhat arcane syntax is chosen to distinguish between all variants of control sequence that may be being documented here. (With or without \textsf{expl3} function syntax.) % \begin{macrocode} -\prop_new:N \l_doc_functions_block_prop +\prop_new:N \l_@@_functions_block_prop \cs_generate_variant:Nn \prop_put:Nnn {Nxx} -\cs_new:Nn \doc_parse_functions:n - { - \exp_args:Nxx \tl_if_head_eq_charcode:nNTF { \token_to_str:N #1 } {\cs_to_str:N \\} - { - \tl_gset_eq:NN \l_doc_function_name_prefix_tl \@backslashchar - % for the weird functions named "\::N" and so on: - \exp_args:Nx \tl_if_head_eq_charcode:nNTF { \cs_to_str:N #1 } { : } - { - % again, no variants: - \prop_put:Nxx \l_doc_functions_block_prop { \cs_to_str:N #1 } { {-1} {} } - } - { - % finally, for regular old csnames: - \exp_args:NNf \prop_get:NnNTF - \l_doc_functions_block_prop - { \__cs_get_function_name:N #1 } \l_doc_tmpb_tl - { - \prop_put:Nxx \l_doc_functions_block_prop - { \__cs_get_function_name:N #1 } - { - \l_doc_tmpb_tl , - {\__cs_count_signature:N #1} - {\__cs_get_function_signature:N #1} - } - } - { - \prop_put:Nxx \l_doc_functions_block_prop - { \__cs_get_function_name:N #1 } - { - {\__cs_count_signature:N #1} - {\__cs_get_function_signature:N #1} - } - } - } - } - % for keys and things that aren't actually csnames: - { - % for now don't bother splitting into variants: - \tl_gclear:N \l_doc_function_name_prefix_tl - \prop_put:Nxx \l_doc_functions_block_prop { \tl_to_str:n {#1} } { {-1} {} } - } - } - +\cs_new:Nn \@@_parse_functions:n + { + \exp_args:Nxx \tl_if_head_eq_charcode:nNTF { \token_to_str:N #1 } {\cs_to_str:N \\} + { + \tl_gset_eq:NN \l_@@_function_name_prefix_tl \@backslashchar + % for the weird functions named "\::N" and so on: + \exp_args:Nx \tl_if_head_eq_charcode:nNTF { \cs_to_str:N #1 } { : } + { + % again, no variants: + \prop_put:Nxx \l_@@_functions_block_prop { \cs_to_str:N #1 } { {-1} {} } + } + { + % finally, for regular old csnames: + \exp_args:NNf \prop_get:NnNTF + \l_@@_functions_block_prop + { \__cs_get_function_name:N #1 } \l_@@_tmpb_tl + { + \prop_put:Nxx \l_@@_functions_block_prop + { \__cs_get_function_name:N #1 } + { + \l_@@_tmpb_tl , + {\__cs_count_signature:N #1} + {\__cs_get_function_signature:N #1} + } + } + { + \prop_put:Nxx \l_@@_functions_block_prop + { \__cs_get_function_name:N #1 } + { + {\__cs_count_signature:N #1} + {\__cs_get_function_signature:N #1} + } + } + } + } +% \end{macrocode} +% False branch for keys and things that aren't actually csnames: +% \begin{macrocode} + { + % for now don't bother splitting into variants: + \tl_gclear:N \l_@@_function_name_prefix_tl + \prop_put:Nxx \l_@@_functions_block_prop { \tl_to_str:n {#1} } { {-1} {} } + } + } % \end{macrocode} % \end{macro} % \end{environment} % \end{environment} % % -% \begin{macro}{\doc_typeset_functions:nn} +% \begin{macro}{\@@_typeset_functions:nn} % \begin{arguments} % \item Function/macro/variable name (stripped of signature in the first case, if any) % \item Comma-list containing information about the signature variants being documented (if any) % \end{arguments} % \begin{macrocode} -\cs_new:Nn \doc_typeset_functions:nn - { - \clist_gset:Nn \l_doc_variants_clist {#2} - \clist_gpop:NN \l_doc_variants_clist \l_doc_tmpb_tl - \exp_args:Nc \doc_typeset_functions_aux:N - { - #1 - \int_compare:nT { \exp_after:wN \use_i:nn \l_doc_tmpb_tl > -1 } {:} - \int_compare:nT { \exp_after:wN \use_i:nn \l_doc_tmpb_tl > 0 } - { \exp_after:wN \use_ii:nn \l_doc_tmpb_tl } - } - \\ - } +\cs_new:Nn \@@_typeset_functions:nn + { + \clist_gset:Nn \l_@@_variants_clist {#2} + \clist_gpop:NN \l_@@_variants_clist \l_@@_tmpb_tl + \exp_args:Nc \@@_typeset_functions_aux:N + { + #1 + \int_compare:nT { \exp_after:wN \use_i:nn \l_@@_tmpb_tl > -1 } {:} + \int_compare:nT { \exp_after:wN \use_i:nn \l_@@_tmpb_tl > 0 } + { \exp_after:wN \use_ii:nn \l_@@_tmpb_tl } + } + \\ + } -\cs_new_nopar:Nn \doc_typeset_functions_aux:N -{ - \bool_if:NT \l_doc_meta_pTF_bool { - \tl_set:Nx \l_doc_pTF_name_tl - { \l_doc_function_name_prefix_tl \doc_predicate_from_base:N #1 } - \doc_special_main_index:o { \l_doc_pTF_name_tl } +\cs_new_nopar:Nn \@@_typeset_functions_aux:N + { + \bool_if:NT \l_@@_meta_pTF_bool + { + \tl_set:Nx \l_@@_pTF_name_tl + { \l_@@_function_name_prefix_tl \@@_predicate_from_base:N #1 } + \@@_special_main_index:o { \l_@@_pTF_name_tl } \seq_gput_right:Nx \g_doc_functions_seq - { \tl_to_str:N \l_doc_pTF_name_tl } - \tl_set:Nx \l_doc_pTF_name_tl { \doc_predicate_from_base:N #1 } - } - - \tl_set:Nx \l_doc_tmpa_tl - { - \l_doc_function_name_prefix_tl - \cs_to_str:N #1 - \bool_if:NT \l_doc_meta_TF_bool { \tl_to_str:n {TF} } - } - \doc_special_main_index:o { \l_doc_tmpa_tl } - \seq_gput_right:No \g_doc_functions_seq { \l_doc_tmpa_tl } + { \tl_to_str:N \l_@@_pTF_name_tl } + \tl_set:Nx \l_@@_pTF_name_tl { \@@_predicate_from_base:N #1 } + } - \bool_if:NTF \l_doc_meta_pTF_bool { + \tl_set:Nx \l_@@_tmpa_tl + { + \l_@@_function_name_prefix_tl + \cs_to_str:N #1 + \bool_if:NT \l_@@_meta_TF_bool { \tl_to_str:n {TF} } + } + \@@_special_main_index:o { \l_@@_tmpa_tl } + \seq_gput_right:No \g_doc_functions_seq { \l_@@_tmpa_tl } - \bool_gset_false:N \l_doc_meta_TF_bool - \exp_args:Nc \doc_typeset_function_block:N { \l_doc_pTF_name_tl } - \bool_gset_true:N \l_doc_meta_TF_bool + \bool_if:NTF \l_@@_meta_pTF_bool + { + \bool_gset_false:N \l_@@_meta_TF_bool + \exp_args:Nc \@@_typeset_function_block:N { \l_@@_pTF_name_tl } + \bool_gset_true:N \l_@@_meta_TF_bool \\ - \doc_typeset_function_block:N #1 - - }{ + \@@_typeset_function_block:N #1 + } + { \exp_args:Nx \tl_if_head_eq_charcode:nNTF { \exp_after:wN \use_none:n \token_to_str:N #1 } {:} - { \doc_show_macro_unusual:N #1 } - { \doc_typeset_function_block:N #1 } - } + { \@@_show_macro_unusual:N #1 } + { \@@_typeset_function_block:N #1 } + } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\doc_typeset_function_block:N} +% \begin{macro}[internal]{\@@_typeset_function_block:N} % \begin{macrocode} -\cs_set_nopar:Nn \doc_typeset_function_block:N { - \tl_gset:Nx \l_doc_function_name_tl { \__cs_get_function_name:N #1 } - \tl_gset:Nx \l_doc_function_sig_tl { \__cs_get_function_signature:N #1 } - \tl_gset:Nx \g_doc_macro_tl { \l_doc_function_name_prefix_tl \l_doc_function_name_tl } - - \doc_typeset_function_basename:N #1 - \bool_if:NT \l_doc_meta_TF_bool { \doc_typeset_TF: } - \doc_typeset_expandability: - \clist_if_empty:NF \l_doc_variants_clist { \doc_typeset_variants: } - \bool_if:NT \g_doc_full_bool { \doc_label_function:N #1 } +\cs_set_nopar:Nn \@@_typeset_function_block:N + { + \tl_gset:Nx \l_@@_function_name_tl { \__cs_get_function_name:N #1 } + \tl_gset:Nx \l_@@_function_sig_tl { \__cs_get_function_signature:N #1 } + \tl_gset:Nx \g_@@_macro_tl { \l_@@_function_name_prefix_tl \l_@@_function_name_tl } -} -\cs_set:Nn \doc_typeset_function_basename:N - { \l_doc_function_name_prefix_tl \cs_to_str:N #1 } -\cs_set:Nn \doc_typeset_expandability: - { - & - \bool_if:NT \l_doc_meta_EXP_bool { - \hspace{\tabcolsep} - \hyperlink{expstar} {$\star$} - } - \bool_if:NT \l_doc_meta_rEXP_bool { - \hspace{\tabcolsep} - \hyperlink{rexpstar} {\ding{73}} % hollow star - } - } -\cs_set:Nn \doc_typeset_variants: - { - \\ - \doc_typeset_aux:n \g_doc_macro_tl : - \int_compare:nTF { \clist_count:N \l_doc_variants_clist == 1 } - { \exp_after:wN \use_ii:nn \l_doc_variants_clist } - { - \textrm( - \clist_pop:NN \l_doc_variants_clist \l_doc_tmpb_tl - \exp_after:wN \use_ii:nn \l_doc_tmpb_tl - \clist_map_inline:Nn \l_doc_variants_clist {\textrm| \use_ii:nn ##1} - \textrm) - } - \bool_if:NT \l_doc_meta_TF_bool { \doc_typeset_TF: } - & - \bool_if:NT \l_doc_meta_EXP_bool { - \hspace{\tabcolsep} - \hyperlink{expstar} {$\star$} - } - \bool_if:NT \l_doc_meta_rEXP_bool { - \hspace{\tabcolsep} - \hyperlink{rexpstar} {\ding{73}} % hollow star + \@@_typeset_function_basename:N #1 + \bool_if:NT \l_@@_meta_TF_bool { \@@_typeset_TF: } + \@@_typeset_expandability: + \clist_if_empty:NF \l_@@_variants_clist { \@@_typeset_variants: } + \bool_if:NT \g_@@_full_bool { \@@_label_function:N #1 } + } +% \end{macrocode} +% +% \begin{macrocode} +\cs_set:Nn \@@_typeset_function_basename:N + { \l_@@_function_name_prefix_tl \cs_to_str:N #1 } +% \end{macrocode} +% +% \begin{macrocode} +\cs_set:Nn \@@_typeset_expandability: + { + & + \bool_if:NT \l_@@_meta_EXP_bool + { + \hspace{\tabcolsep} + \hyperlink{expstar} {$\star$} + } + \bool_if:NT \l_@@_meta_rEXP_bool + { + \hspace{\tabcolsep} + \hyperlink{rexpstar} {\ding{73}} % hollow star } - } -\cs_set:Nn \doc_label_function:N - { - \tl_set:Nx \l_doc_tmpa_tl { \l_doc_function_name_prefix_tl \cs_to_str:N #1 } - \exp_args:NNf \tl_replace_all:Nnn \l_doc_tmpa_tl {\token_to_str:N _} {/} - \exp_args:NNf \tl_remove_all:Nn \l_doc_tmpa_tl {\@backslashchar} - \exp_args:Nx \label {doc/function//\l_doc_tmpa_tl} - } + } +% \end{macrocode} +% +% \begin{macrocode} +\cs_set:Nn \@@_typeset_variants: + { + \\ + \@@_typeset_aux:n \g_@@_macro_tl : + \int_compare:nTF { \clist_count:N \l_@@_variants_clist == 1 } + { \exp_after:wN \use_ii:nn \l_@@_variants_clist } + { + \textrm( + \clist_pop:NN \l_@@_variants_clist \l_@@_tmpb_tl + \exp_after:wN \use_ii:nn \l_@@_tmpb_tl + \clist_map_inline:Nn \l_@@_variants_clist {\textrm| \use_ii:nn ##1} + \textrm) + } + \bool_if:NT \l_@@_meta_TF_bool { \@@_typeset_TF: } + & + \bool_if:NT \l_@@_meta_EXP_bool + { + \hspace{\tabcolsep} + \hyperlink{expstar} {$\star$} + } + \bool_if:NT \l_@@_meta_rEXP_bool + { + \hspace{\tabcolsep} + \hyperlink{rexpstar} {\ding{73}} % hollow star + } + } +% \end{macrocode} +% +% \begin{macrocode} +\cs_set:Nn \@@_label_function:N + { + \tl_set:Nx \l_@@_tmpa_tl { \l_@@_function_name_prefix_tl \cs_to_str:N #1 } + \exp_args:NNf \tl_replace_all:Nnn \l_@@_tmpa_tl {\token_to_str:N _} {/} + \exp_args:NNf \tl_remove_all:Nn \l_@@_tmpa_tl {\@backslashchar} + \exp_args:Nx \label {doc/function//\l_@@_tmpa_tl} + } % \end{macrocode} % \end{macro} % -% \begin{macro}[aux]{\doc_show_macro_unusual:N} +% \begin{macro}[aux]{\@@_show_macro_unusual:N} % This is for the case when the function is one of the weird ones like \cs{::N}. % \begin{macrocode} -\cs_set_nopar:Nn \doc_show_macro_unusual:N { - \tl_gset:Nx \g_doc_macro_tl { \token_to_str:N #1} +\cs_set_nopar:Nn \@@_show_macro_unusual:N + { + \tl_gset:Nx \g_@@_macro_tl { \token_to_str:N #1} \token_to_str:N #1 & - \exp_args:NNf \tl_replace_all:Nnn \g_doc_macro_tl {\token_to_str:N _} {/} - \exp_args:NNf \tl_replace_all:Nnn \g_doc_macro_tl {\@backslashchar} {} - \bool_if:NT \g_doc_full_bool { - \exp_args:Nx \label { doc/function//\g_doc_macro_tl } - } -} + \exp_args:NNf \tl_replace_all:Nnn \g_@@_macro_tl {\token_to_str:N _} {/} + \exp_args:NNf \tl_replace_all:Nnn \g_@@_macro_tl {\@backslashchar} {} + \bool_if:NT \g_@@_full_bool + { + \exp_args:Nx \label { doc/function//\g_@@_macro_tl } + } + } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\doc_typeset_dates:} +% \begin{macro}[internal]{\@@_typeset_dates:} % To display metadata for when functions are added/modified. % \begin{macrocode} -\cs_set:Nn \doc_typeset_dates: - { - \bool_if:nF { \tl_if_empty_p:N \l_doc_date_added_tl && - \tl_if_empty_p:N \l_doc_date_updated_tl } - { \midrule } +\cs_set:Nn \@@_typeset_dates: + { + \bool_if:nF { \tl_if_empty_p:N \l_@@_date_added_tl && + \tl_if_empty_p:N \l_@@_date_updated_tl } + { \midrule } - \tl_if_empty:NF \l_doc_date_added_tl - { - \multicolumn{2}{@{}r@{}} - { \scriptsize New:\,\l_doc_date_added_tl } \\ - } + \tl_if_empty:NF \l_@@_date_added_tl + { + \multicolumn{2}{@{}r@{}} + { \scriptsize New:\,\l_@@_date_added_tl } \\ + } - \tl_if_empty:NF \l_doc_date_updated_tl - { - \multicolumn{2}{@{}r@{}} - { \scriptsize Updated:\,\l_doc_date_updated_tl } \\ - } - } + \tl_if_empty:NF \l_@@_date_updated_tl + { + \multicolumn{2}{@{}r@{}} + { \scriptsize Updated:\,\l_@@_date_updated_tl } \\ + } + } % \end{macrocode} % \end{macro} % % \begin{environment}{syntax} % Syntax block placed next to the list of functions to illustrate their use. % \begin{macrocode} -\newenvironment{syntax}{ +\newenvironment{syntax} + { \small\ttfamily - \bool_if:NTF \l_doc_long_name_bool + \bool_if:NTF \l_@@_long_name_bool { - \hcoffin_set:Nw \l_doc_syntax_coffin - \arrayrulecolor{white} - \begin{tabular}{@{}l@{}} - \toprule - \begin{minipage} - { \textwidth+0.75\marginparwidth-\l_doc_trial_width_dim } + \hbox_gset:Nw \g_@@_syntax_box + \arrayrulecolor{white} + \begin{tabular}{@{}l@{}} + \toprule + \begin{minipage} + { \textwidth+0.75\marginparwidth-\l_@@_trial_width_dim } } { - \hcoffin_set:Nw \l_doc_syntax_coffin - \arrayrulecolor{white} - \begin{tabular}{@{}l@{}} - \toprule - \begin{minipage}{ \textwidth } + \hbox_gset:Nw \g_@@_syntax_box + \arrayrulecolor{white} + \begin{tabular}{@{}l@{}} + \toprule + \begin{minipage}{ \textwidth } } \raggedright \obeyspaces\obeylines -}{ + } + { \end{minipage} \end{tabular} \arrayrulecolor{black} - \hcoffin_set_end: - \coffin_gset_eq:NN \l_doc_syntax_coffin \l_doc_syntax_coffin + \hbox_set_end: \ignorespacesafterend -} + } % \end{macrocode} % \end{environment} % -% \begin{macro}{\doc_ensuremath_sb:n} +% \begin{macro}{\@@_ensuremath_sb:n} % \begin{macrocode} -\cs_new:Npn \doc_ensuremath_sb:n #1 - { - \ensuremath{\sb{#1}} - } +\cs_new:Npn \@@_ensuremath_sb:n #1 + { + \ensuremath{\sb{#1}} + } % \end{macrocode} % \end{macro} % -% \begin{macro}{\doc_open_meta:w,\doc_close_meta:n} +% \begin{macro}{\@@_open_meta:w,\@@_close_meta:n} % \begin{macrocode} -\cs_set_eq:NN \doc_meta:n \meta +\cs_set_eq:NN \@@_meta:n \meta \cs_set:Npn \meta - { - \group_begin: - \char_set_active_eq:NN _ \doc_ensuremath_sb:n - \doc_close_meta:n - } -\cs_new:Npn \doc_open_meta:w - { - \group_begin: - \char_set_active_eq:NN _ \doc_ensuremath_sb:n - \doc_close_meta:w - } + { + \group_begin: + \char_set_active_eq:NN _ \@@_ensuremath_sb:n + \@@_close_meta:n + } +\cs_new:Npn \@@_open_meta:w + { + \group_begin: + \char_set_active_eq:NN _ \@@_ensuremath_sb:n + \@@_close_meta:w + } \cs_new:Npn \Arg - { - \texttt{ \char`\{ } - \group_begin: - \char_set_active_eq:NN _ \doc_ensuremath_sb:n - \doc_close_Arg:n - } -\cs_new_nopar:Npn \doc_close_meta:n #1 { \doc_meta:n {#1} \group_end: } -\cs_new_nopar:Npn \doc_close_meta:w #1> { \doc_meta:n {#1} \group_end: } -\cs_new_nopar:Npn \doc_close_Arg:n #1 { - \doc_meta:n {#1} + { + \texttt{ \char`\{ } + \group_begin: + \char_set_active_eq:NN _ \@@_ensuremath_sb:n + \@@_close_Arg:n + } +\cs_new_nopar:Npn \@@_close_meta:n #1 { \@@_meta:n {#1} \group_end: } +\cs_new_nopar:Npn \@@_close_meta:w #1> { \@@_meta:n {#1} \group_end: } +\cs_new_nopar:Npn \@@_close_Arg:n #1 + { + \@@_meta:n {#1} \group_end: \texttt{ \char`\} } -} + } % \end{macrocode} % \end{macro} % @@ -1347,99 +1367,103 @@ Do not distribute a modified version of this file. % Keyval: % \begin{macrocode} \keys_define:nn { l3doc/macro } - { - aux .code:n = - { \bool_set_true:N \l_doc_macro_aux_bool } , - internal .code:n = - { \bool_set_true:N \l_doc_macro_internal_bool } , - var .code:n = - { \bool_set_true:N \l_doc_macro_var_bool } , - TF .code:n = - { \bool_set_true:N \l_doc_macro_TF_bool } , - pTF .code:n = - { \bool_set_true:N \l_doc_macro_pTF_bool } , - tested .code:n = - { } , - } + { + aux .code:n = + { \bool_set_true:N \l_@@_macro_aux_bool } , + internal .code:n = + { \bool_set_true:N \l_@@_macro_internal_bool } , + int .code:n = + { \bool_set_true:N \l_@@_macro_internal_bool } , + var .code:n = + { \bool_set_true:N \l_@@_macro_var_bool } , + TF .code:n = + { \bool_set_true:N \l_@@_macro_TF_bool } , + pTF .code:n = + { \bool_set_true:N \l_@@_macro_pTF_bool } , + tested .code:n = + { } , + EXP .code:n = {} , % TODO + rEXP .code:n = {} , % TODO + added .code:n = {} , % TODO + updated .code:n = {} , % TODO + } % \end{macrocode} % % \begin{macrocode} -\RenewDocumentCommand { \macro } { O{} } { \doc_macro:n {#1} } -\cs_new_protected:Npn \doc_macro:n #1 { +\RenewDocumentCommand { \macro } { O{} } { \@@_macro:n {#1} } +\cs_new_protected:Npn \@@_macro:n #1 + { \int_compare:nNnTF \currentgrouplevel=2 - { \int_gzero:N \g_doc_nested_macro_int } - { \int_incr:N \g_doc_nested_macro_int } + { \int_gzero:N \g_@@_nested_macro_int } + { \int_incr:N \g_@@_nested_macro_int } - \bool_gset_false:N \l_doc_macro_aux_bool - \bool_gset_false:N \l_doc_macro_internal_bool - \bool_gset_false:N \l_doc_macro_TF_bool - \bool_gset_false:N \l_doc_macro_pTF_bool - \bool_gset_false:N \l_doc_macro_var_bool - \bool_gset_false:N \l_doc_tested_bool + \bool_gset_false:N \l_@@_macro_aux_bool + \bool_gset_false:N \l_@@_macro_internal_bool + \bool_gset_false:N \l_@@_macro_TF_bool + \bool_gset_false:N \l_@@_macro_pTF_bool + \bool_gset_false:N \l_@@_macro_var_bool + \bool_gset_false:N \l_@@_tested_bool - \cs_set_eq:NN \doc_macroname_prefix:n \use:n - \cs_set_eq:NN \doc_macroname_suffix: \c_empty_tl + \cs_set_eq:NN \@@_macroname_prefix:n \use:n + \cs_set_eq:NN \@@_macroname_suffix: \c_empty_tl \keys_set:nn { l3doc/macro } {#1} - \cs_set_eq:NN \testfile \doc_print_testfile:n + \cs_set_eq:NN \testfile \@@_print_testfile:n \peek_meaning_ignore_spaces:NTF \c_group_begin_token - { - \group_begin: - \MakePrivateLetters - \char_set_catcode_letter:N \\ - \char_set_catcode_ignore:N \ % space - \char_set_catcode_ignore:N \^^M - \char_set_catcode_ignore:N \^^I - \doc_macro_aux:n - } - { - \doc_macro_verbatim:w - } -} -\NewDocumentCommand {\doc_macro_verbatim:w} {v} - { - \group_begin: % pretty useless - \doc_macro_aux:n {#1} - } -\keys_define:nn { l3doc/macro } - { - unknown .code:n = { \use:c{doc_macro_opt_#1:} } - } + { + \group_begin: + \MakePrivateLetters + \char_set_catcode_letter:N \\ + \char_set_catcode_ignore:N \ % space + \char_set_catcode_ignore:N \^^M + \char_set_catcode_ignore:N \^^I + \@@_macro_aux:n + } + { + \@@_macro_verbatim:w + } + } +\NewDocumentCommand {\@@_macro_verbatim:w} {v} + { + \group_begin: % pretty useless + \@@_macro_aux:n {#1} + } % \end{macrocode} % After changing the catcodes, parse the arguments: % \begin{macrocode} -\clist_new:N \l_doc_macro_input_clist -\cs_new_nopar:Npn \doc_macro_aux:n #1 { +\clist_new:N \l_@@_macro_input_clist +\cs_new_nopar:Npn \@@_macro_aux:n #1 + { \group_end: - \clist_set:Nn \l_doc_macro_input_clist {#1} - \bool_if:NTF \l_doc_macro_pTF_bool - { - \clist_map_inline:Nn \l_doc_macro_input_clist + \clist_set:Nn \l_@@_macro_input_clist {#1} + \bool_if:NTF \l_@@_macro_pTF_bool + { + \clist_map_inline:Nn \l_@@_macro_input_clist { - \exp_args:Nx \doc_macro_single:n { \doc_predicate_from_base:w ##1 \q_nil } + \exp_args:Nx \@@_macro_single:n { \@@_predicate_from_base:w ##1 \q_nil } } - \bool_set_true:N \l_doc_macro_TF_bool - \clist_map_function:NN \l_doc_macro_input_clist \doc_macro_single:n - \bool_set_false:N \l_doc_macro_TF_bool - } - { \clist_map_function:NN \l_doc_macro_input_clist \doc_macro_single:n } -} + \bool_set_true:N \l_@@_macro_TF_bool + \clist_map_function:NN \l_@@_macro_input_clist \@@_macro_single:n + \bool_set_false:N \l_@@_macro_TF_bool + } + { \clist_map_function:NN \l_@@_macro_input_clist \@@_macro_single:n } + } % \end{macrocode} % % \end{environment} % % \begin{macrocode} -\cs_set:Nn \doc_predicate_from_base:N - { - \__cs_get_function_name:N #1 _p: \__cs_get_function_signature:N #1 - } -\cs_set:Npn \doc_predicate_from_base:w #1 : #2 \q_nil - { - #1 _p: #2 - } +\cs_set:Nn \@@_predicate_from_base:N + { + \__cs_get_function_name:N #1 _p: \__cs_get_function_signature:N #1 + } +\cs_set:Npn \@@_predicate_from_base:w #1 : #2 \q_nil + { + #1 _p: #2 + } % \end{macrocode} % % \begin{environment}{doc_macro_single} @@ -1449,15 +1473,17 @@ Do not distribute a modified version of this file. % \begin{arguments} % \item Macro/function/whatever name; input has already been sanitised. % \end{arguments} -% \cs{l_doc_at_replaced_macro_tl} stores the macro name after +% \cs{l_@@_at_replaced_macro_tl} stores the macro name after % replacement of |@@|. % \begin{macrocode} -\tl_new:N \l_doc_at_replaced_macro_tl -\cs_set_nopar:Npn \doc_macro_single:n #1 { - \int_incr:N \l_doc_macro_int - \tl_set:Nx \l_doc_at_replaced_macro_tl { \token_to_str:N #1 } - \doc_replace_at_at:N \l_doc_at_replaced_macro_tl - \tl_set_eq:NN \saved@macroname \l_doc_at_replaced_macro_tl +\cs_set_nopar:Npn \@@_macro_single:n #1 + { + \int_incr:N \l_@@_macro_int + + \tl_set:Nx \l_@@_at_replaced_macro_tl { \token_to_str:N #1 } + \@@_replace_at_at:N \l_@@_at_replaced_macro_tl + \tl_set_eq:NN \saved@macroname \l_@@_at_replaced_macro_tl + \topsep\MacroTopsep \trivlist \cs_set_nopar:Npn \makelabel ##1 { \llap{##1} } @@ -1468,60 +1494,71 @@ Do not distribute a modified version of this file. \cs_set_nopar:Npx \@tempa{\@tempa\hbox{\strut}} \advance\count@\m@ne \repeat - \cs_set_nopar:Npx \makelabel ##1 { + \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: - } + \bool_if:NT \l_@@_macro_aux_bool + { + \cs_set_eq:NN \@@_macroname_prefix:n \@@_typeset_aux:n + } + \bool_if:NT \l_@@_macro_TF_bool + { + \cs_set_eq:NN \@@_macroname_suffix: \@@_typeset_TF: + } - \bool_if:NF \l_doc_macro_aux_bool { - \tl_gset:Nx \l_doc_macro_tl { \tl_to_str:N \l_doc_at_replaced_macro_tl } - \exp_args:NNf \tl_greplace_all:Nnn \l_doc_macro_tl {\token_to_str:N _} {/} - \exp_args:NNf \tl_greplace_all:Nnn \l_doc_macro_tl {\@backslashchar} {} - } + \bool_if:NF \l_@@_macro_aux_bool + { + \tl_gset:Nx \l_@@_macro_tl { \tl_to_str:N \l_@@_at_replaced_macro_tl } + \exp_args:NNf \tl_greplace_all:Nnn \l_@@_macro_tl {\token_to_str:N _} {/} + \exp_args:NNf \tl_greplace_all:Nnn \l_@@_macro_tl {\@backslashchar} {} + } - \use:x { - \exp_not:N \item [ \exp_not:N \doc_print_macroname:n { - \tl_to_str:N \l_doc_at_replaced_macro_tl + \use:x + { + \exp_not:N \item [ \exp_not:N \@@_print_macroname:n { + \tl_to_str:N \l_@@_at_replaced_macro_tl }] - } - \global\advance \c@CodelineNo \@ne + } + \int_gincr:N \g_@@_codeline_int - \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 \l_doc_at_replaced_macro_tl \tl_to_str:n {TF} } - \seq_gput_right:Nx \g_doc_macros_seq { \tl_to_str:N \l_doc_at_replaced_macro_tl \tl_to_str:n {T } } - \seq_gput_right:Nx \g_doc_macros_seq { \tl_to_str:N \l_doc_at_replaced_macro_tl \tl_to_str:n { F} } - }{ - \seq_gput_right:Nx \g_doc_macros_seq { \tl_to_str:N \l_doc_at_replaced_macro_tl } - } - } - \bool_if:NTF \l_doc_macro_TF_bool { - \exp_args:Nx \SpecialMainIndex{ \tl_to_str:N \l_doc_at_replaced_macro_tl TF}\nobreak - \exp_args:Nx \DoNotIndex{ \tl_to_str:N \l_doc_at_replaced_macro_tl TF} - }{ - \exp_args:Nx \SpecialMainIndex{ \tl_to_str:N \l_doc_at_replaced_macro_tl }\nobreak - \exp_args:Nx \DoNotIndex{ \tl_to_str:N \l_doc_at_replaced_macro_tl } - } + \bool_if:NF \l_@@_macro_aux_bool + { + \bool_if:NTF \l_@@_macro_TF_bool + { + \seq_gput_right:Nx \g_doc_macros_seq { \tl_to_str:N \l_@@_at_replaced_macro_tl \tl_to_str:n {TF} } + \seq_gput_right:Nx \g_doc_macros_seq { \tl_to_str:N \l_@@_at_replaced_macro_tl \tl_to_str:n {T } } + \seq_gput_right:Nx \g_doc_macros_seq { \tl_to_str:N \l_@@_at_replaced_macro_tl \tl_to_str:n { F} } + } + { + \seq_gput_right:Nx \g_doc_macros_seq { \tl_to_str:N \l_@@_at_replaced_macro_tl } + } + } + \bool_if:NTF \l_@@_macro_TF_bool + { + \exp_args:Nx \SpecialMainIndex{ \tl_to_str:N \l_@@_at_replaced_macro_tl TF}\nobreak + \exp_args:Nx \DoNotIndex{ \tl_to_str:N \l_@@_at_replaced_macro_tl TF} + } + { + \exp_args:Nx \SpecialMainIndex{ \tl_to_str:N \l_@@_at_replaced_macro_tl }\nobreak + \exp_args:Nx \DoNotIndex{ \tl_to_str:N \l_@@_at_replaced_macro_tl } + } - \global\advance \c@CodelineNo \m@ne + \int_gdecr:N \g_@@_codeline_int \ignorespaces -} + } % \end{macrocode} % -% \begin{macro}{\doc_print_macroname:n} +% \begin{macro}{\@@_print_macroname:n} % \begin{macrocode} -\tl_clear:N \l_doc_macro_tl -\cs_set_nopar:Npn \doc_print_macroname:n #1 { +\tl_clear:N \l_@@_macro_tl +\cs_set_nopar:Npn \@@_print_macroname:n #1 + { \strut \HD@target \int_compare:nTF { \tl_count:n {#1} <= 28 } @@ -1529,118 +1566,143 @@ Do not distribute a modified version of this file. % INEFFICIENT: (!) \exp_args:NNx \seq_if_in:NnTF \g_doc_functions_seq - { #1 \bool_if:NT \l_doc_macro_TF_bool { \tl_to_str:n {TF} } } - { - \hyperref [doc/function//\l_doc_macro_tl] - } - { \use:n } - { - \doc_macroname_prefix:n {#1} \doc_macroname_suffix: \ % space! - } -} + { #1 \bool_if:NT \l_@@_macro_TF_bool { \tl_to_str:n {TF} } } + { + \hyperref [doc/function//\l_@@_macro_tl] + } + { \use:n } + { + \@@_macroname_prefix:n {#1} \@@_macroname_suffix: \ % space! + } + } % \end{macrocode} % \end{macro} % \end{environment} % % \begin{macro}{\MacroLongFont} % \begin{macrocode} -\providecommand \MacroLongFont { +\providecommand \MacroLongFont + { \fontfamily{lmtt}\fontseries{lc}\small -} + } % \end{macrocode} % \end{macro} % -% \begin{macro}{\doc_typeset_TF:,\doc_typeset_aux:n} +% \begin{macro}{\@@_typeset_TF:,\@@_typeset_aux:n} % Used by \cs{doc_macro_single} and \cs{doc_showmacro_aux_ii:w} to typeset % conditionals and auxiliary functions. % \begin{macrocode} -\cs_set_nopar:Npn \doc_typeset_TF: { - \hyperlink{explTF}{% - \color{black}% - \itshape TF% - \makebox[0pt][r]{% +\cs_set_nopar:Npn \@@_typeset_TF: + { + \hyperlink{explTF} + { + \color{black} + \itshape TF + \makebox[0pt][r] + { \color{red} \underline { \phantom{\itshape TF} \kern-0.1em } - } - } -} -\cs_set_nopar:Npn \doc_typeset_aux:n #1 { - {\color[gray]{0.7} #1} -} + } + } + } +\cs_set_nopar:Npn \@@_typeset_aux:n #1 + { + { \color[gray]{0.7} #1 } + } % \end{macrocode} % \end{macro} % -% \begin{macro}{\doc_print_testfile:n} +% \begin{macro}{\@@_print_testfile:n} % Used to show that a macro has a test, somewhere. % \begin{macrocode} -\DeclareDocumentCommand \doc_print_testfile:n {m} { - \bool_set_true:N \l_doc_tested_bool - \tl_if_eq:nnF {#1} {*} { - \seq_if_in:NnF \g_doc_testfiles_seq {#1} - { - \par{\footnotesize(\textit{ - The~ test~ suite~ for~ this~ command,~ and~ others~ in~ this~ file,~ is~ \textsf{#1}}. - )\par} - \seq_gput_right:Nn \g_doc_testfiles_seq {#1} - } - } -} +\DeclareDocumentCommand \@@_print_testfile:n {m} + { + \bool_set_true:N \l_@@_tested_bool + \tl_if_eq:nnF {#1} {*} + { + \seq_if_in:NnF \g_@@_testfiles_seq {#1} + { + \seq_gput_right:Nn \g_@@_testfiles_seq {#1} + \par + \@@_print_testfile_aux:n {#1} + } + } + } +% \end{macrocode} +% Text for displaying: +% \begin{macrocode} +\cs_new_protected:Npn \@@_print_testfile_aux:n #1 + { + \footnotesize + ( + \textit{ + The~ test~ suite~ for~ this~ command,~ + and~ others~ in~ this~ file,~ is~ \textsf{#1} + }. + )\par + } % \end{macrocode} % \end{macro} % % \begin{macro}{\TestFiles} % \begin{macrocode} -\DeclareDocumentCommand \TestFiles {m} { +\DeclareDocumentCommand \TestFiles {m} + { \par {\itshape The~ following~ test~ files~ are~ used~ for~ this~ code:~ \textsf{#1}. } \par\ignorespaces -} + } % \end{macrocode} % \end{macro} % % \begin{macro}{\UnitTested} % \begin{macrocode} -\DeclareDocumentCommand \UnitTested {} { - \testfile* -} +\DeclareDocumentCommand \UnitTested {} { \testfile* } % \end{macrocode} % \end{macro} % % \begin{macro}{\TestMissing} -% Note: There \cs{l_doc_macro_input_clist} may contain unconverted |@@|. +% Note: There \cs{l_@@_macro_input_clist} may contain unconverted |@@|. % \begin{macrocode} \cs_generate_variant:Nn \prop_gput:Nnn {NVx} -\DeclareDocumentCommand \TestMissing {m} { - \prop_if_in:NVTF \g_doc_missing_tests_prop \l_doc_macro_input_clist - { - \prop_get:NVN \g_doc_missing_tests_prop \l_doc_macro_input_clist \l_doc_tmpa_tl - \prop_gput:NVx \g_doc_missing_tests_prop \l_doc_macro_input_clist - { - *~ \l_doc_tmpa_tl +\DeclareDocumentCommand \TestMissing {m} + { + \prop_if_in:NVTF \g_@@_missing_tests_prop \l_@@_macro_input_clist + { + \prop_get:NVN \g_@@_missing_tests_prop \l_@@_macro_input_clist \l_@@_tmpa_tl + \prop_gput:NVx \g_@@_missing_tests_prop \l_@@_macro_input_clist + { + *~ \l_@@_tmpa_tl ^^J \exp_not:n {\space\space\space\space\space\space} *~ #1 - } - } - { \prop_gput:NVn \g_doc_missing_tests_prop \l_doc_macro_input_clist {#1} } -} + } + } + { \prop_gput:NVn \g_@@_missing_tests_prop \l_@@_macro_input_clist {#1} } + } % \end{macrocode} % \end{macro} % -% \begin{variable}{\g_doc_module_name_tl} -% \begin{macro}[int]{\doc_replace_at_at:N} +% \begin{variable}{\g_@@_module_name_tl} +% \begin{macro}[internal]{\@@_replace_at_at:N} % \begin{macrocode} -\tl_new:N \g_doc_module_name_tl -\cs_new_protected:Npn \doc_replace_at_at:N #1 { - \tl_if_empty:NF \g_doc_module_name_tl - { - \tl_replace_all:Non #1 { \token_to_str:N @ } { @ } - \tl_replace_all:Non #1 { \token_to_str:N _ } { _ } - \tl_replace_all:Nox #1 { _@@ } { __ \g_doc_module_name_tl } - \tl_replace_all:Nox #1 { @@ } { __ \g_doc_module_name_tl } - } -} +\tl_new:N \g_@@_module_name_tl +\cs_new_protected:Npn \@@_replace_at_at:N #1 + { + \tl_if_empty:NF \g_@@_module_name_tl + { + \tl_replace_all:Non #1 { \token_to_str:N @ } { @ } + \tl_replace_all:Non #1 { \token_to_str:N _ } { _ } +% \end{macrocode} +% To make the search-and-replace work, in the source of l3doc +% itself the \verb|@@| search string needs to be protected from +% replacement by l3docstrip! This is easy to do by adding a space. +% \begin{macrocode} + \tl_replace_all:Nox #1 { _@ @ } { __ \g_@@_module_name_tl } + \tl_replace_all:Nox #1 { @ @ } { __ \g_@@_module_name_tl } + } + } \cs_generate_variant:Nn \tl_replace_all:Nnn { Non, Nox } % \end{macrocode} % \end{macro} @@ -1652,69 +1714,74 @@ Do not distribute a modified version of this file. % go inline in the definition of \cs{endmacro}, but somehow the |#| % doesn't go through some \LaTeXe{} internals. % \begin{macrocode} -\cs_new_protected:Nn \doc_endmacro_build_seq:N - { - \seq_gclear:N #1 - \clist_map_inline:Nn \l_doc_macro_input_clist - { - \tl_set:Nn \l_doc_tmpa_tl {##1} - \doc_replace_at_at:N \l_doc_tmpa_tl - \seq_gput_right:No #1 { \l_doc_tmpa_tl } - } - } -\cs_set_protected:Nn \doc_endmacro_wrap_each:N - { - \bool_if:NTF \l_doc_macro_TF_bool - { \seq_gset_map:NNn #1 #1 { \exp_not:N \texttt { ##1 TF } } } - { \seq_gset_map:NNn #1 #1 { \exp_not:N \texttt { ##1 } } } - } -\cs_set:Nn \doc_texttt_comma:n {\,,~\texttt{#1}} -\cs_set:Npn \endmacro { - \int_compare:nT {\g_doc_nested_macro_int<1} - { - \par\nobreak\noindent{\footnotesize(\emph{ +\cs_new_protected:Nn \@@_endmacro_build_seq:N + { + \seq_gclear:N #1 + \clist_map_inline:Nn \l_@@_macro_input_clist + { + \tl_set:Nn \l_@@_tmpa_tl {##1} + \@@_replace_at_at:N \l_@@_tmpa_tl + \seq_gput_right:No #1 { \l_@@_tmpa_tl } + } + } +\cs_set_protected:Nn \@@_endmacro_wrap_each:N + { + \bool_if:NTF \l_@@_macro_TF_bool + { \seq_gset_map:NNn #1 #1 { \exp_not:N \texttt { ##1 TF } } } + { \seq_gset_map:NNn #1 #1 { \exp_not:N \texttt { ##1 } } } + } +\cs_set:Nn \@@_texttt_comma:n {\,,~\texttt{#1}} +\cs_set:Npn \endmacro + { + \int_compare:nT { \g_@@_nested_macro_int < 1 } + { + \par\nobreak\noindent{\footnotesize(\emph{ End~ definition~ for~ - \doc_endmacro_build_seq:N \g_doc_tmpa_seq - \doc_endmacro_wrap_each:N \g_doc_tmpa_seq - \int_compare:nTF { \seq_count:N \g_doc_tmpa_seq <= 3 } + \@@_endmacro_build_seq:N \g_@@_tmpa_seq + \@@_endmacro_wrap_each:N \g_@@_tmpa_seq + \int_compare:nTF { \seq_count:N \g_@@_tmpa_seq <= 3 } { - \seq_use:Nnnn \g_doc_tmpa_seq + \seq_use:Nnnn \g_@@_tmpa_seq { \,~and~ } { \,,~ } { \,,~and~ } } - { \seq_item:Nn \g_doc_tmpa_seq {1}\,~and~others. } - \bool_if:nT { - !\l_doc_macro_aux_bool && - !\l_doc_macro_internal_bool && - \int_compare_p:n {\g_doc_nested_macro_int<1} - } - { - \int_compare:nNnTF \l_doc_macro_int=1 {~This~} {~These~} - \bool_if:NTF \l_doc_macro_var_bool{variable}{function} - \int_compare:nNnTF \l_doc_macro_int=1 {~is~}{s~are~} - documented~on~page~ - \exp_args:Nx\pageref{doc/function//\l_doc_macro_tl}. - } - })\par} - } + { \seq_item:Nn \g_@@_tmpa_seq {1}\,~and~others. } + + \bool_if:nT + { + !\l_@@_macro_aux_bool && + !\l_@@_macro_internal_bool && + \int_compare_p:n {\g_@@_nested_macro_int<1} + } + { + \int_compare:nNnTF \l_@@_macro_int=1 {~This~} {~These~} + \bool_if:NTF \l_@@_macro_var_bool{variable}{function} + \int_compare:nNnTF \l_@@_macro_int=1 {~is~}{s~are~} + documented~on~page~ + \exp_args:Nx\pageref{doc/function//\l_@@_macro_tl}. + } + })\par} + } + \bool_if:nT - { \g_doc_checktest_bool && - !( \l_doc_macro_aux_bool || \l_doc_macro_var_bool ) && - !\l_doc_tested_bool - } - { - \seq_gput_right:Nx \g_doc_not_tested_seq - { - \seq_use:Nnnn \g_doc_tmpa_seq { , } { , } { , } - \bool_if:NT \l_doc_macro_pTF_bool {~(pTF)} - \bool_if:NT \l_doc_macro_TF_bool {~(TF)} - } - } -} + { + \g_@@_checktest_bool && + !( \l_@@_macro_aux_bool || \l_@@_macro_var_bool ) && + !\l_@@_tested_bool + } + { + \seq_gput_right:Nx \g_@@_not_tested_seq + { + \seq_use:Nnnn \g_@@_tmpa_seq { , } { , } { , } + \bool_if:NT \l_@@_macro_pTF_bool {~(pTF)} + \bool_if:NT \l_@@_macro_TF_bool {~(TF)} + } + } + } % \end{macrocode} % \end{macro} % % \begin{environment}{macrocode} -% \begin{macro}[aux]{\doc_xmacro_code:n} +% \begin{macro}[aux]{\@@_xmacro_code:n} % Hook into the \texttt{macrocode} environment in a dirty way: % \cs{xmacro@code} is responsible for grabbing (and tokenizing) the % body of the environment. Redefine it to pass what it grabs to @@ -1739,39 +1806,39 @@ Do not distribute a modified version of this file. \char_set_lccode:nn { `\^^L } { `\{ } \char_set_lccode:nn { `\^^R } { `\} } \tl_to_lowercase:n - { - \group_end: - \cs_set_protected:Npn \xmacro@code - #1 ^^A ^^S^^S^^S^^S ^^Bend ^^Lmacrocode^^R - { \doc_xmacro_code:n {#1} /end{macrocode} } - } + { + \group_end: + \cs_set_protected:Npn \xmacro@code + #1 ^^A ^^S^^S^^S^^S ^^Bend ^^Lmacrocode^^R + { \@@_xmacro_code:n {#1} /end{macrocode} } + } \group_begin: \char_set_catcode_active:N \< \char_set_catcode_active:N \> - \cs_new_protected:Npn \doc_xmacro_code:n #1 - { - \tl_if_in:nnTF {#1} { < @ @ = } - { \doc_xmacro_code:w #1 \q_stop } - { - \tl_set:Nn \l_doc_tmpa_tl {#1} - \doc_replace_at_at:N \l_doc_tmpa_tl - \tl_use:N \l_doc_tmpa_tl - } - } - \cs_new_protected:Npn \doc_xmacro_code:w #1 < @ @ = #2 > #3 \q_stop - { - \tl_set:Nn \l_doc_tmpa_tl {#1} - \doc_replace_at_at:N \l_doc_tmpa_tl + \cs_new_protected:Npn \@@_xmacro_code:n #1 + { + \tl_if_in:nnTF {#1} { < @ @ = } + { \@@_xmacro_code:w #1 \q_stop } + { + \tl_set:Nn \l_@@_tmpa_tl {#1} + \@@_replace_at_at:N \l_@@_tmpa_tl + \tl_use:N \l_@@_tmpa_tl + } + } + \cs_new_protected:Npn \@@_xmacro_code:w #1 < @ @ = #2 > #3 \q_stop + { + \tl_set:Nn \l_@@_tmpa_tl {#1} + \@@_replace_at_at:N \l_@@_tmpa_tl - \tl_gset:Nn \g_doc_module_name_tl {#2} - \tl_put_right:Nn \l_doc_tmpa_tl { < @ @ = #2 > } + \tl_gset:Nn \g_@@_module_name_tl {#2} + \tl_put_right:Nn \l_@@_tmpa_tl { < @ @ = #2 > } - \tl_set:Nn \l_doc_tmpb_tl {#3} - \doc_replace_at_at:N \l_doc_tmpb_tl - \tl_put_right:No \l_doc_tmpa_tl { \l_doc_tmpb_tl } + \tl_set:Nn \l_@@_tmpb_tl {#3} + \@@_replace_at_at:N \l_@@_tmpb_tl + \tl_put_right:No \l_@@_tmpa_tl { \l_@@_tmpb_tl } - \tl_use:N \l_doc_tmpa_tl - } + \tl_use:N \l_@@_tmpa_tl + } \group_end: % \end{macrocode} % \end{macro} @@ -1781,42 +1848,54 @@ Do not distribute a modified version of this file. % For describing package options. Due to Joseph Wright. % Name/usage might change soon. % \begin{macrocode} -\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 -} +\newcommand*{\DescribeOption} + { + \leavevmode + \@bsphack + \begingroup + \MakePrivateLetters + \Describe@Option + } +% \end{macrocode} +% +% \begin{macrocode} +\newcommand*{\Describe@Option}[1] + { + \endgroup + \marginpar{ + \raggedleft + \PrintDescribeEnv{#1} + } + \SpecialOptionIndex{#1} + \@esphack + \ignorespaces + } +% \end{macrocode} +% +% \begin{macrocode} +\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 + } % \end{macrocode} % \end{macro} % @@ -1844,14 +1923,16 @@ Do not distribute a modified version of this file. % package that might be tricky to use. % FIXME: Has to be fixed when in combination with a macro-definition. % \begin{macrocode} -\newenvironment {danger} { +\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} -} + } % \end{macrocode} % % \begin{ddanger} @@ -1860,14 +1941,15 @@ Do not distribute a modified version of this file. % about such things. % \end{ddanger} % \begin{macrocode} -\newenvironment {ddanger} { +\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} -} + } % \end{macrocode} % \end{environment} % \end{environment} @@ -1876,47 +1958,61 @@ Do not distribute a modified version of this file. % % \begin{macrocode} \newenvironment{TemplateInterfaceDescription}[1] - {\subsection{The~object~type~`#1'}% - \begingroup - \@beginparpenalty\@M - \description - \def\TemplateArgument##1##2{\item[Arg:~##1]##2\par}% - \def\TemplateSemantics{\enddescription\endgroup - \subsubsection*{Semantics:}}% - } - {\par\bigskip} + { + \subsection{The~object~type~`#1'} + \begingroup + \@beginparpenalty\@M + \description + \def\TemplateArgument##1##2{\item[Arg:~##1]##2\par} + \def\TemplateSemantics + { + \enddescription\endgroup + \subsubsection*{Semantics:} + } + } + { + \par\bigskip + } % \end{macrocode} % % \begin{macrocode} \newenvironment{TemplateDescription}[2] - {\subsection{The~template~`#2'~(object~type~#1)}% - \subsubsection*{Attributes:}% + { + \subsection{The~template~`#2'~(object~type~#1)} + \subsubsection*{Attributes:} \begingroup \@beginparpenalty\@M \description - \def\TemplateKey##1##2##3##4{\item[##1~(##2)]##3% + \def\TemplateKey##1##2##3##4 + { + \item[##1~(##2)]##3% \ifx\TemplateKey##4\TemplateKey\else % \hskip0ptplus3em\penalty-500\hskip 0pt plus 1filll Default:~##4% \hfill\penalty500\hbox{}\hfill Default:~##4% \nobreak\hskip-\parfillskip\hskip0pt\relax \fi - \par}% - \def\TemplateSemantics{\enddescription\endgroup - \subsubsection*{Semantics~\&~Comments:}}% + \par + } + \def\TemplateSemantics + { + \enddescription\endgroup + \subsubsection*{Semantics~\&~Comments:} + } } {\par\bigskip} % \end{macrocode} % % \begin{macrocode} \newenvironment{InstanceDescription}[4][xxxxxxxxxxxxxxx] - {\subsubsection{The~instance~`#3'~(template~#2/#4)}% - \subsubsection*{Attribute~values:}% + { + \subsubsection{The~instance~`#3'~(template~#2/#4)} + \subsubsection*{Attribute~values:} \begingroup \@beginparpenalty\@M - \def\InstanceKey##1##2{\>\textbf{##1}\>##2\\}% + \def\InstanceKey##1##2{\>\textbf{##1}\>##2\\} \def\InstanceSemantics{\endtabbing\endgroup \vskip-30pt\vskip0pt - \subsubsection*{Layout~description~\&~Comments:}}% + \subsubsection*{Layout~description~\&~Comments:}} \tabbing xxxx\=#1\=\kill } @@ -1930,22 +2026,25 @@ Do not distribute a modified version of this file. % % \begin{macro}{\StopEventually,\Finale,\AlsoImplementation,\OnlyDescription} % \begin{macrocode} -\cs_set_nopar:Npn \AlsoImplementation { - \bool_set_true:N \g_doc_implementation_bool - \cs_set:Npn \StopEventually ##1 { +\cs_set_nopar:Npn \AlsoImplementation + { + \bool_set_true:N \g_@@_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 { +\cs_set_nopar:Npn \OnlyDescription + { \@bsphack - \bool_set_false:N \g_doc_implementation_bool + \bool_set_false:N \g_@@_implementation_bool \cs_set:Npn \StopEventually ##1 { ##1 \endinput } \@esphack -} + } \cs_set_eq:NN \Finale \relax % \end{macrocode} % \end{macro} @@ -1957,14 +2056,16 @@ Do not distribute a modified version of this file. % \begin{macro}{\DocInput} % From \pkg{doc}. Now accepts comma-list input (who has commas in filenames?). % \begin{macrocode} -\cs_set:Npn \DocInput #1 { - \clist_map_inline:nn {#1} { +\cs_set:Npn \DocInput #1 + { + \clist_map_inline:nn {#1} + { \clist_put_right:Nn \g_docinput_clist {##1} \MakePercentIgnore \input{##1} \MakePercentComment - } -} + } + } % \end{macrocode} % \end{macro} % @@ -1972,13 +2073,15 @@ Do not distribute a modified version of this file. % Uses "\g_docinput_clist" to re-input whatever's already been "\DocInput"-ed until now. % May be used multiple times. % \begin{macrocode} -\cs_set:Npn \DocInputAgain { - \clist_map_inline:Nn \g_docinput_clist { +\cs_set:Npn \DocInputAgain + { + \clist_map_inline:Nn \g_docinput_clist + { \MakePercentIgnore \input{##1} \MakePercentComment - } -} + } + } % \end{macrocode} % \end{macro} % @@ -1990,33 +2093,34 @@ Do not distribute a modified version of this file. % \end{macrocode} % % \begin{macrocode} -\newcommand*{\DocInclude}[1]{% +\newcommand*{\DocInclude}[1] + { \relax\clearpage \docincludeaux - \IfFileExists{#1.fdd}{ - \cs_set_nopar:Npn \currentfile{#1.fdd} - }{ - \cs_set_nopar:Npn \currentfile{#1.dtx} - } + \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 \@docinclude #1 \fi -} + } % \end{macrocode} % % \begin{macrocode} -\cs_set_nopar:Npn \@docinclude #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{ + \@for\@tempa:=\@partlist\do + { \ifx\@tempa\@tempb\@tempswatrue\fi - } + } \fi \if@tempswa \cs_set_eq:NN \@auxout\@partaux @@ -2045,16 +2149,18 @@ Do not distribute a modified version of this file. \@nameuse{cp@#1} \fi \cs_set_eq:NN \@auxout\@mainaux -} + } % \end{macrocode} % % \begin{macrocode} -\cs_gset_nopar:Npn \codeline@wrindex #1 { - \immediate\write\@indexfile { +\cs_gset_nopar:Npn \codeline@wrindex #1 + { + \immediate\write\@indexfile + { \string\indexentry{#1} - {\filesep\number\c@CodelineNo} - } -} + { \filesep \int_use:N \g_@@_codeline_int } + } + } % \end{macrocode} % \end{macro} % @@ -2064,21 +2170,26 @@ Do not distribute a modified version of this file. % % \begin{macro}{\docincludeaux} % \begin{macrocode} -\cs_set_nopar:Npn \docincludeaux { +\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}{ + \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{ + \cs_gset_nopar:Npn\@oddfoot + { \expandafter\ifx\csname ver@\currentfile\endcsname\relax File~\thepart :~{\ttfamily\currentfile}~ \else @@ -2088,9 +2199,9 @@ Do not distribute a modified version of this file. Version~\ExplFileVersion \fi \hfill\thepage - } + } \cs_set_eq:NN \@evenfoot \@oddfoot -} + } % \end{macrocode} % \end{macro} % @@ -2099,106 +2210,120 @@ Do not distribute a modified version of this file. % Print all defined and documented macros/functions. % % \begin{macrocode} -\iow_new:N \g_doc_func_iow +\iow_new:N \g_@@_func_iow % \end{macrocode} % % \begin{macrocode} -\cs_new_nopar:Npn \doc_show_functions_defined: { - \bool_if:nT { \g_doc_implementation_bool && \g_doc_checkfunc_bool } { +\cs_new_nopar:Npn \@@_show_functions_defined: + { + \bool_if:nT { \g_@@_implementation_bool && \g_@@_checkfunc_bool } + { \typeout{ ======================================== ^^J } - \iow_open:Nn \g_doc_func_iow { \c_job_name_tl .cmds } + \iow_open:Nn \g_@@_func_iow { \c_job_name_tl .cmds } - \tl_clear:N \l_doc_tmpa_tl - \seq_map_inline:Nn \g_doc_functions_seq { - \seq_if_in:NnT \g_doc_macros_seq {##1} { - \tl_put_right:Nn \l_doc_tmpa_tl { ##1 ^^J } - \iow_now:Nn \g_doc_func_iow { > ~ ##1 } - } - } + \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_@@_func_iow { > ~ ##1 } + } + } - \doc_functions_typeout:n { - Functions~both~documented~and~defined:^^J (In~order~of~being~documented) - } + \@@_functions_typeout:n + { + Functions~both~documented~and~defined:^^J + (In~order~of~being~documented) + } - \seq_map_inline:Nn \g_doc_functions_seq { - \seq_if_in:NnF \g_doc_macros_seq {##1} { - \tl_put_right:Nn \l_doc_tmpa_tl { ##1 ^^J } - \iow_now:Nn \g_doc_func_iow { ! ~ ##1} - } - } - \doc_functions_typeout:n { Functions~documented~but~not~defined: } + \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 } + \iow_now:Nn \g_@@_func_iow { ! ~ ##1} + } + } + \@@_functions_typeout:n { Functions~documented~but~not~defined: } - \seq_map_inline:Nn \g_doc_macros_seq { - \seq_if_in:NnF \g_doc_functions_seq {##1} { - \tl_put_right:Nn \l_doc_tmpa_tl { ##1 ^^J } - \iow_now:Nn \g_doc_func_iow { ? ~ ##1} - } - } - \doc_functions_typeout:n { Functions~defined~but~not~documented: } + \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 } + \iow_now:Nn \g_@@_func_iow { ? ~ ##1} + } + } + \@@_functions_typeout:n { Functions~defined~but~not~documented: } - \iow_close:N \g_doc_func_iow + \iow_close:N \g_@@_func_iow \typeout{ ======================================== } } } -\AtEndDocument{ \doc_show_functions_defined: } +\AtEndDocument{ \@@_show_functions_defined: } % \end{macrocode} % % \begin{macrocode} -\cs_set_nopar:Npn \doc_functions_typeout:n #1 { - \tl_if_empty:NF \l_doc_tmpa_tl { - \typeout{ +\cs_set_nopar:Npn \@@_functions_typeout:n #1 + { + \tl_if_empty:NF \l_@@_tmpa_tl + { + \typeout + { -------------------------------------- ^^J #1 ^^J - -------------------------------------- ^^J \l_doc_tmpa_tl - } - \tl_clear:N \l_doc_tmpa_tl - } -} + -------------------------------------- ^^J \l_@@_tmpa_tl + } + \tl_clear:N \l_@@_tmpa_tl + } + } % \end{macrocode} % % \begin{macrocode} -\cs_new:Npn \doc_show_not_tested: { - \bool_if:NT \g_doc_checktest_bool - { - \bool_if:nT { !(\seq_if_empty_p:N \g_doc_not_tested_seq) || - !(\prop_if_empty_p:N \g_doc_missing_tests_prop) } - { - \tl_clear:N \l_doc_tmpa_tl - \prop_if_empty:NF \g_doc_missing_tests_prop - { - \tl_put_right:Nn \l_doc_tmpa_tl - { +\cs_new:Npn \@@_show_not_tested: + { + \bool_if:NT \g_@@_checktest_bool + { + \bool_if:nT { !(\seq_if_empty_p:N \g_@@_not_tested_seq) || + !(\prop_if_empty_p:N \g_@@_missing_tests_prop) } + { + \tl_clear:N \l_@@_tmpa_tl + \prop_if_empty:NF \g_@@_missing_tests_prop + { + \tl_put_right:Nn \l_@@_tmpa_tl + { ^^J^^JThe~ following~ macro(s)~ have~ incomplete~ tests:^^J - } - \prop_map_inline:Nn \g_doc_missing_tests_prop - { - \tl_put_right:Nn \l_doc_tmpa_tl + } + \prop_map_inline:Nn \g_@@_missing_tests_prop + { + \tl_put_right:Nn \l_@@_tmpa_tl {^^J\space\space\space\space ##1 ^^J\space\space\space\space\space\space ##2} - } - } - \seq_if_empty:NF \g_doc_not_tested_seq - { - \tl_put_right:Nn \l_doc_tmpa_tl - { + } + } + \seq_if_empty:NF \g_@@_not_tested_seq + { + \tl_put_right:Nn \l_@@_tmpa_tl + { ^^J^^J The~ following~ macro(s)~ do~ not~ have~ any~ tests:^^J - } - \seq_map_inline:Nn \g_doc_not_tested_seq - { + } + \seq_map_inline:Nn \g_@@_not_tested_seq + { \clist_map_inline:nn {##1} - { - \tl_put_right:Nn \l_doc_tmpa_tl {^^J\space\space\space\space ####1} - } - } + { + \tl_put_right:Nn \l_@@_tmpa_tl {^^J\space\space\space\space ####1} + } + } \int_set:Nn \l_tmpa_int {\etex_interactionmode:D} \errorstopmode - \ClassError{l3doc}{\l_doc_tmpa_tl}{} + \ClassError{l3doc}{\l_@@_tmpa_tl}{} \int_set:Nn \etex_interactionmode:D {\l_tmpa_int} - } - } - } -} -\AtEndDocument{ \doc_show_not_tested: } + } + } + } + } +\AtEndDocument{ \@@_show_not_tested: } % \end{macrocode} % % \subsection{Indexing} @@ -2215,7 +2340,8 @@ Do not distribute a modified version of this file. % % Set up the Index to use "\part" % \begin{macrocode} -\IndexPrologue{ +\IndexPrologue + { \part*{Index} \markboth{Index}{Index} \addcontentsline{toc}{part}{Index} @@ -2223,34 +2349,36 @@ Do not distribute a modified version of this file. corresponding~entry~is~described,~ numbers~underlined~point~to~the~definition,~ all~others~indicate~the~places~where~it~is~used. -} + } % \end{macrocode} % % -% \begin{macro}{\doc_special_main_index:n,\doc_special_main_index:o, \doc_special_main_index:x} +% \begin{macro}{\@@_special_main_index:n,\@@_special_main_index:o, \@@_special_main_index:x} % Heiko's replacement to play nicely with |hypdoc|: % \begin{macrocode} -\cs_set_nopar:Npn \doc_special_main_index:n #1 { +\cs_set_nopar:Npn \@@_special_main_index:n #1 + { \HD@target - \index{ + \index + { \@gobble#1 \actualchar \string\verb\quotechar*\verbatimchar#1\verbatimchar \encapchar hdclindex{\the\c@HD@hypercount}{usage} - } -} -\cs_generate_variant:Nn \doc_special_main_index:n { o , x } + } + } +\cs_generate_variant:Nn \@@_special_main_index:n { o , x } % \end{macrocode} % \end{macro} % % \begin{macrocode} \msg_new:nnn {l3doc} {print-index-howto} - { - Generate~the~index~by~executing\\ - \iow_indent:n { makeindex~-s~l3doc.ist~-o~\c_job_name_tl .ind~\c_job_name_tl .idx } - } + { + Generate~the~index~by~executing\\ + \iow_indent:n { makeindex~-s~l3doc.ist~-o~\c_job_name_tl .ind~\c_job_name_tl .idx } + } \tl_gput_right:Nn \PrintIndex { \AtEndDocument{ \msg_info:nn {l3doc} {print-index-howto} } } % \end{macrocode} % @@ -2259,20 +2387,21 @@ Do not distribute a modified version of this file. % Set the change history to use "\part". % Allow control names to be hyphenated in here... % \begin{macrocode} -\GlossaryPrologue{ +\GlossaryPrologue + { \part*{Change~History} {\GlossaryParms\ttfamily\hyphenchar\font=`\-} \markboth{Change~History}{Change~History} \addcontentsline{toc}{part}{Change~History} -} + } % \end{macrocode} % % \begin{macrocode} \msg_new:nnn {l3doc} {print-changes-howto} - { - Generate~the~change~list~by~executing\\ - \iow_indent:n { makeindex~-s~gglo.ist~-o~\c_job_name_tl .gls~\c_job_name_tl .glo } - } + { + Generate~the~change~list~by~executing\\ + \iow_indent:n { makeindex~-s~gglo.ist~-o~\c_job_name_tl .gls~\c_job_name_tl .glo } + } \tl_gput_right:Nn \PrintChanges { \AtEndDocument{ \msg_info:nn {l3doc} {print-changes-howto} } } % \end{macrocode} % @@ -2299,16 +2428,18 @@ Do not distribute a modified version of this file. % \subsection{Default configuration} % % \begin{macrocode} -\bool_if:NTF \g_doc_full_bool { +\bool_if:NTF \g_@@_full_bool + { \RecordChanges \CodelineIndex \EnableCrossrefs \AlsoImplementation -}{ + } + { \CodelineNumbered \DisableCrossrefs \OnlyDescription -} + } % \end{macrocode} % % @@ -2329,26 +2460,37 @@ Do not distribute a modified version of this file. % % The Guilty Parties. % \begin{macrocode} -\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,~Bruno~Le~Floch}} +\tl_new:N \Team +\tl_set:Nn \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,~Bruno~Le~Floch + } + } % \end{macrocode} % % \begin{macrocode} \NewDocumentCommand{\ExplMakeTitle}{mm} { - \title + \title + { + The~\pkg{#1}~package \\ #2 + \thanks { - The~\pkg{#1}~package \\ #2 - \thanks{This~file~describes~v\ExplFileVersion,~ - last~revised~\ExplFileDate.} + This~file~describes~v\ExplFileVersion,~ + last~revised~\ExplFileDate. } - \author{The~\LaTeX3~Project\thanks{E-mail:~ + } + \author + { + The~\LaTeX3~Project\thanks{E-mail:~ \href{mailto:latex-l@listserv.uni-heidelberg.de} - {latex-l@listserv.uni-heidelberg.de}}} + {latex-l@listserv.uni-heidelberg.de}} + } \date{Released~\ExplFileDate} \maketitle } @@ -2369,14 +2511,14 @@ Do not distribute a modified version of this file. % % \begin{macrocode} \AtBeginDocument - { - \clist_map_inline:nn - { - asin, acos, atan, acot, - asinh, acosh, atanh, acoth, round, floor, ceil - } - { \exp_args:Nc \DeclareMathOperator{#1}{#1} } - } + { + \clist_map_inline:nn + { + asin, acos, atan, acot, + asinh, acosh, atanh, acoth, round, floor, ceil + } + { \exp_args:Nc \DeclareMathOperator{#1}{#1} } + } % \end{macrocode} % % \begin{macro}{\nan} -- cgit v1.2.3