diff options
author | Karl Berry <karl@freefriends.org> | 2019-03-05 22:35:14 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-03-05 22:35:14 +0000 |
commit | 68872ff6a2a91fa0e84763fc9316493d82075c95 (patch) | |
tree | 0546ec4c414553802e31a423aec44f74d252f645 /Master/texmf-dist/tex/latex/l3kernel/l3doc.cls | |
parent | 541c4ddf7c5b402b9cfe8af5ef4e49ffa15d3e83 (diff) |
l3 (5mar19)
git-svn-id: svn://tug.org/texlive/trunk@50246 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3doc.cls')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3doc.cls | 60 |
1 files changed, 53 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls index cf71077feaf..ed111045fbf 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls +++ b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls @@ -58,6 +58,7 @@ \bool_new:N \g__codedoc_checktest_bool \bool_new:N \g__codedoc_kernel_bool \bool_new:N \g__codedoc_cs_break_bool +\bool_new:N \g__codedoc_show_notes_bool \bool_gset_true:N \g__codedoc_cs_break_bool \tl_new:N \l__codedoc_tmpa_tl \tl_new:N \l__codedoc_tmpb_tl @@ -424,6 +425,10 @@ { \bool_gset_false:N \g__codedoc_cs_break_bool } \DeclareOption { cs-break-nohyphen } { \PassOptionsToPackage{nohyphen}{underscore} } +\DeclareOption { show-notes } + { \bool_gset_true:N \g__codedoc_show_notes_bool } +\DeclareOption { hide-notes } + { \bool_gset_false:N \g__codedoc_show_notes_bool } \DeclareOption* { \PassOptionsToClass { \CurrentOption } { article } } \ExecuteOptions { full, kernel, nocheck, nochecktest, lm-default } \PassOptionsToClass { a4paper } { article } @@ -650,6 +655,7 @@ \NewDocumentCommand { \CodedocExplainEXP } { } { \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{expstar}{}}% + \write \@auxout { \def \string \Codedoc@expstar { } } \__codedoc_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~ @@ -658,6 +664,7 @@ \NewDocumentCommand { \CodedocExplainREXP } { } { \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{rexpstar}{}}% + \write \@auxout { \def \string \Codedoc@rexpstar { } } \__codedoc_typeset_rexp:\ indicates~ restricted~expandable~functions,~which~can~be~used~within~an~ \texttt{x}-type~argument~but~cannot~be~fully~expanded~within~an~ @@ -666,6 +673,7 @@ \NewDocumentCommand { \CodedocExplainTF } { } { \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{explTF}{}}% + \write \@auxout { \def \string \Codedoc@explTF { } } \__codedoc_typeset_TF:\ indicates~conditional~(\texttt{if})~functions~ whose~variants~with~\texttt{T},~\texttt{F}~and~\texttt{TF}~ argument~specifiers~expect~different~ @@ -765,18 +773,30 @@ \ensuremath \rangle } \cs_new_protected:Npn \__codedoc_typeset_exp: - { \hyperlink{expstar} {$\star$} } + { + \cs_if_exist:NTF \Codedoc@expstar + { \hyperlink { expstar } } + { \mbox } + {$\star$} + } \cs_new_protected:Npn \__codedoc_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 \__codedoc_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 } } } @@ -997,7 +1017,7 @@ { \__codedoc_date_set:Nn #1 {#2} \exp_args:No \__codedoc_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__codedoc_macro_argument_tl } @@ -1008,7 +1028,7 @@ { \__codedoc_date_set:Nn \l__codedoc_tmpa_tl {#1} \exp_args:No \__codedoc_date_compare:nNnT - { \l__codedoc_tmpa_tl } < { \tex_year:D - \tex_month:D - \tex_day:D } + { \l__codedoc_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__codedoc_macro_argument_tl } @@ -1042,6 +1062,7 @@ \cs_new_protected:Npn \__codedoc_function_typeset_stop: { \par + \dim_set:Nn \prevdepth { \box_dp:N \l__codedoc_descr_coffin } \allowbreak } \cs_new_protected:Npn \__codedoc_function_init: @@ -1670,6 +1691,31 @@ }{ \par\end{trivlist} } +\bool_if:NTF \g__codedoc_show_notes_bool + { + \NewDocumentCommand\NB{mm} + { + (\emph{Note}\footnote{\ttfamily [#1]:~\detokenize{#2}}) + } + } + { + \NewDocumentCommand\NB{mm}{} + } +\bool_if:NTF \g__codedoc_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} + } \newenvironment{TemplateInterfaceDescription}[1] { \subsection{The~object~type~`#1'} @@ -1891,7 +1937,7 @@ \__codedoc_replace_at_at:N \l__codedoc_tmpa_tl \tl_gset:Nn \g__codedoc_module_name_tl {#2} - \tl_put_right:Nn \l__codedoc_tmpa_tl { < @ @ = #2 > } + \tl_put_right:Nn \l__codedoc_tmpa_tl { < \text { \verbatim@font @ @ = #2 } > } \tl_set:Nn \l__codedoc_tmpb_tl {#3} \__codedoc_detect_internals:N \l__codedoc_tmpb_tl |