diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3doc.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3doc.dtx | 103 |
1 files changed, 95 insertions, 8 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx index 8cc7655d4dd..e6fdc679742 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx @@ -79,7 +79,7 @@ and all files in that bundle must be distributed together. % % \title{The \cls{l3doc} class} % \author{\Team} -% \date{Released 2019-02-15} +% \date{Released 2019-03-05} % \maketitle % \tableofcontents % @@ -334,6 +334,17 @@ and all files in that bundle must be distributed together. % class names, respectively. % \end{function} % +% \begin{function}{\NB, \NOTE} +% \begin{syntax} +% \cs{NB} \marg{tag} \marg{comments} +% \verb|\begin{NOTE}| \marg{tag} +% \qquad\meta{comments} +% \verb|\end{NOTE}| +% \end{syntax} +% Make notes in the source that are not typeset by default. When the \verb|show-notes| +% class option is active, the comments are typeset in a detokenized and verbatim mode, respectively. +% \end{function} +% % \subsection{Describing functions in the documentation} % % \DescribeEnv{function} @@ -694,6 +705,7 @@ and all files in that bundle must be distributed together. % \g_@@_checkfunc_bool, % \g_@@_checktest_bool, % \g_@@_cs_break_bool, +% \g_@@_show_notes_bool, % \g_@@_kernel_bool % } % Information about package options. @@ -703,6 +715,7 @@ and all files in that bundle must be distributed together. \bool_new:N \g_@@_checktest_bool \bool_new:N \g_@@_kernel_bool \bool_new:N \g_@@_cs_break_bool +\bool_new:N \g_@@_show_notes_bool \bool_gset_true:N \g_@@_cs_break_bool % \end{macrocode} % \end{variable} @@ -1430,6 +1443,13 @@ and all files in that bundle must be distributed together. % \end{macrocode} % % \begin{macrocode} +\DeclareOption { show-notes } + { \bool_gset_true:N \g_@@_show_notes_bool } +\DeclareOption { hide-notes } + { \bool_gset_false:N \g_@@_show_notes_bool } +% \end{macrocode} +% +% \begin{macrocode} \DeclareOption* { \PassOptionsToClass { \CurrentOption } { article } } \ExecuteOptions { full, kernel, nocheck, nochecktest, lm-default } \PassOptionsToClass { a4paper } { article } @@ -1885,6 +1905,7 @@ and all files in that bundle must be distributed together. \NewDocumentCommand { \CodedocExplainEXP } { } { \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{expstar}{}}% + \write \@auxout { \def \string \Codedoc@expstar { } } \@@_typeset_exp:\ indicates~fully~expandable~functions,~which~ can~be~used~within~an~\texttt{x}-type~argument~(in~plain~ \TeX{}~terms,~inside~an~\cs{edef}),~as~well~as~within~an~ @@ -1893,6 +1914,7 @@ and all files in that bundle must be distributed together. \NewDocumentCommand { \CodedocExplainREXP } { } { \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{rexpstar}{}}% + \write \@auxout { \def \string \Codedoc@rexpstar { } } \@@_typeset_rexp:\ indicates~ restricted~expandable~functions,~which~can~be~used~within~an~ \texttt{x}-type~argument~but~cannot~be~fully~expanded~within~an~ @@ -1901,6 +1923,7 @@ and all files in that bundle must be distributed together. \NewDocumentCommand { \CodedocExplainTF } { } { \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{explTF}{}}% + \write \@auxout { \def \string \Codedoc@explTF { } } \@@_typeset_TF:\ indicates~conditional~(\texttt{if})~functions~ whose~variants~with~\texttt{T},~\texttt{F}~and~\texttt{TF}~ argument~specifiers~expect~different~ @@ -2062,18 +2085,30 @@ and all files in that bundle must be distributed together. % to typeset conditionals and auxiliary functions. % \begin{macrocode} \cs_new_protected:Npn \@@_typeset_exp: - { \hyperlink{expstar} {$\star$} } + { + \cs_if_exist:NTF \Codedoc@expstar + { \hyperlink { expstar } } + { \mbox } + {$\star$} + } \cs_new_protected:Npn \@@_typeset_rexp: - { \hyperlink{rexpstar} {\ding{73}} } % hollow star + { + \cs_if_exist:NTF \Codedoc@rexpstar + { \hyperlink { rexpstar } } + { \mbox } + { \ding { 73 } } % hollow star + } \cs_new_protected:Npn \@@_typeset_TF: { - \hyperlink{explTF} + \cs_if_exist:NTF \Codedoc@explTF + { \hyperlink { explTF } } + { \mbox } { \color{black} \itshape TF \makebox[0pt][r] { - \color{red} + \cs_if_exist:NT \Codedoc@explTF { \color{red} } \underline { \phantom{\itshape TF} \kern-0.1em } } } @@ -2409,7 +2444,7 @@ and all files in that bundle must be distributed together. { \@@_date_set:Nn #1 {#2} \exp_args:No \@@_date_compare:nNnT - {#1} > { \tex_year:D - \tex_month:D - \tex_day:D } + {#1} > { \c_sys_year_int - \c_sys_month_int - \c_sys_day_int } { \msg_error:nnxx { l3doc } { future-date } { \tl_to_str:N \l_@@_macro_argument_tl } @@ -2430,7 +2465,7 @@ and all files in that bundle must be distributed together. { \@@_date_set:Nn \l_@@_tmpa_tl {#1} \exp_args:No \@@_date_compare:nNnT - { \l_@@_tmpa_tl } < { \tex_year:D - \tex_month:D - \tex_day:D } + { \l_@@_tmpa_tl } < { \c_sys_year_int - \c_sys_month_int - \c_sys_day_int } { \msg_error:nnxx { l3doc } { deprecated-function } { \tl_to_str:N \l_@@_macro_argument_tl } @@ -2495,6 +2530,7 @@ and all files in that bundle must be distributed together. \cs_new_protected:Npn \@@_function_typeset_stop: { \par + \dim_set:Nn \prevdepth { \box_dp:N \l_@@_descr_coffin } \allowbreak } % \end{macrocode} @@ -3435,6 +3471,57 @@ and all files in that bundle must be distributed together. % \end{environment} % \end{environment} % +% \subsubsection{NB and NOTE} +% +% These macros are intended for additional notes added to the source that are not typeset. +% +% \begin{macro}{\NB} +% \NB{wspr}{this is what I think about this!} +% \begin{verbatim} +% \NB{wspr}{this is what I think about this!} +% \end{verbatim} +% \begin{macrocode} +\bool_if:NTF \g_@@_show_notes_bool + { + \NewDocumentCommand\NB{mm} + { + (\emph{Note}\footnote{\ttfamily [#1]:~\detokenize{#2}}) + } + } + { + \NewDocumentCommand\NB{mm}{} + } +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{\NOTE} +% \begin{NOTE}{wspr} +% this is what I #$%& think about this! +% \end{NOTE} +% \begin{verbatim} +% \begin{NOTE}{wspr} +% this is what I #$%& think about this! +% \end{NOTE} +% \end{verbatim} +% \begin{macrocode} +\bool_if:NTF \g_@@_show_notes_bool + { + \NewDocumentEnvironment{NOTE}{m} + { + \par\noindent (\emph{Note}~[\texttt{#1}]:\par + \verbatim + } + { + \endverbatim + \par\noindent \emph{Note~end})\par + } + } + { + \NewDocumentEnvironment{NOTE}{m}{\comment}{\endcomment} + } +% \end{macrocode} +% \end{environment} +% % \subsection{Documenting templates} % % \begin{macrocode} @@ -3742,7 +3829,7 @@ and all files in that bundle must be distributed together. \@@_replace_at_at:N \l_@@_tmpa_tl \tl_gset:Nn \g_@@_module_name_tl {#2} - \tl_put_right:Nn \l_@@_tmpa_tl { < @ @ = #2 > } + \tl_put_right:Nn \l_@@_tmpa_tl { < \text { \verbatim@font @ @ = #2 } > } \tl_set:Nn \l_@@_tmpb_tl {#3} \@@_detect_internals:N \l_@@_tmpb_tl |