summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-10-19 20:38:20 +0000
committerKarl Berry <karl@freefriends.org>2016-10-19 20:38:20 +0000
commit52b787d36c60fda90673669dd2809c95c1fdfca5 (patch)
treebeb7faf87e1ab5be65f7437e500619b20eba20a1 /Master/texmf-dist/tex/latex/l3kernel/l3doc.cls
parent97a401ad817da2dafd1069df9d87a28ed39df69b (diff)
l3 (19oct16)
git-svn-id: svn://tug.org/texlive/trunk@42306 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.cls1269
1 files changed, 814 insertions, 455 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls
index aa9ac162b60..0dc4351b3e7 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls
+++ b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls
@@ -50,7 +50,7 @@
\let \fileversionOld \ExplFileVersion
\let \filedescriptionOld \ExplFileDescription
\RequirePackage{expl3,xparse,calc}
-\GetIdInfo$Id: l3doc.dtx 6474 2016-04-11 18:09:21Z qinglee $
+\GetIdInfo$Id: l3doc.dtx 6701 2016-09-08 13:56:52Z qinglee $
{L3 Experimental documentation class}
\ProvidesExplClass
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
@@ -58,80 +58,11 @@
\let \ExplFileDate \filedateOld
\let \ExplFileVersion \fileversionOld
\let \ExplFileDescription \filedescriptionOld
-\cs_generate_variant:Nn \tl_count:n { f }
-\cs_generate_variant:Nn \tl_greplace_all:Nnn { Nx }
-\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNTF { o }
-\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNT { o }
-\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNF { o }
-\cs_generate_variant:Nn \tl_if_in:NnTF { No }
-\cs_generate_variant:Nn \tl_if_in:NnT { No }
-\cs_generate_variant:Nn \tl_if_in:NnF { No }
-\cs_generate_variant:Nn \tl_remove_all:Nn { Nx }
-\cs_generate_variant:Nn \tl_replace_all:Nnn { Nx , Nnx, No , Nno }
-\cs_generate_variant:Nn \tl_replace_once:Nnn { Noo }
-\cs_generate_variant:Nn \prop_get:NnNTF { Nx }
-\cs_generate_variant:Nn \prop_put:Nnn { Nx }
-\cs_generate_variant:Nn \prop_gput:Nnn { NVx }
-\cs_new_protected:Npn \__codedoc_replace_at_at:N #1
- {
- \tl_if_empty:NF \g__codedoc_module_name_tl
- {
- \exp_args:NNo \__codedoc_replace_at_at_aux:Nn
- #1 \g__codedoc_module_name_tl
- }
- }
-\cs_new_protected:Npn \__codedoc_replace_at_at_aux:Nn #1#2
- {
- \tl_replace_all:Non #1 { \token_to_str:N @ } { @ }
- \tl_replace_all:Non #1 { \token_to_str:N _ } { _ }
- \tl_replace_all:Nnn #1 { _ @ @ } { _ _ #2 }
- \tl_replace_all:Nnn #1 { @ @ } { _ _ #2 }
- }
-\cs_new_protected:Npn \__codedoc_verb_get_seq:nN #1#2
- {
- \tl_set:Nx \l__codedoc_tmpa_tl { \tl_to_str:n {#1} }
- \tl_remove_all:Nx \l__codedoc_tmpa_tl
- { \iow_char:N \^^M \iow_char:N \% }
- \tl_remove_all:Nx \l__codedoc_tmpa_tl { \tl_to_str:n { ^ ^ A } }
- \tl_remove_all:Nx \l__codedoc_tmpa_tl { \iow_char:N \^^I }
- \tl_remove_all:Nx \l__codedoc_tmpa_tl { \iow_char:N \^^M }
- \__codedoc_replace_at_at:N \l__codedoc_tmpa_tl
- \exp_args:NNx \seq_set_from_clist:Nn #2
- { \tl_to_str:N \l__codedoc_tmpa_tl }
- }
-\cs_new:Npn \__codedoc_signature_base_form:n #1
- { \__codedoc_signature_base_form_aux:n #1 \c_empty_tl }
-\cs_new:Npn \__codedoc_signature_base_form_aux:n #1
- {
- \str_case:nnTF {#1}
- {
- { N } { N }
- { c } { N }
- { n } { n }
- { o } { n }
- { f } { n }
- { x } { n }
- { V } { n }
- { v } { n }
- }
- { \__codedoc_signature_base_form_aux:n }
- {#1}
- }
-\cs_new:Npn \__codedoc_predicate_from_base:N #1
- {
- \__cs_get_function_name:N #1 _p:
- \__cs_get_function_signature:N #1
- }
-\cs_new_protected:Npn \CodedocUseCs #1 { \use:c { \tl_to_str:n {#1} } }
-\cs_new:Npn \CodedocUnexpandedTokens #1 #
- { \use:c { CodedocUnexpandedTokens ~ } \__codedoc_exp_not:n }
-\cs_new_protected:cpn { CodedocUnexpandedTokens ~ } #1#2 {#2}
-\cs_new:Npn \__codedoc_exp_not:n #1 { \exp_not:n { \__codedoc_exp_not:n {#1} } }
\clist_new:N \g_docinput_clist
\seq_new:N \g_doc_functions_seq
\seq_new:N \g_doc_macros_seq
\coffin_new:N \l__codedoc_output_coffin
-\coffin_new:N \l__codedoc_names_coffin
+\coffin_new:N \l__codedoc_functions_coffin
\coffin_new:N \l__codedoc_descr_coffin
\coffin_new:N \l__codedoc_syntax_coffin
\box_new:N \g__codedoc_syntax_box
@@ -146,35 +77,44 @@
\bool_new:N \l__codedoc_macro_aux_bool
\bool_new:N \l__codedoc_macro_TF_bool
\bool_new:N \l__codedoc_macro_pTF_bool
+\bool_new:N \l__codedoc_macro_noTF_bool
\bool_new:N \l__codedoc_macro_EXP_bool
\bool_new:N \l__codedoc_macro_rEXP_bool
\bool_new:N \l__codedoc_macro_var_bool
+\tl_new:N \l__codedoc_override_module_tl
+\tl_set:Nn \l__codedoc_override_module_tl { \q_no_value }
+\tl_new:N \l__codedoc_macro_documented_tl
\bool_new:N \g__codedoc_lmodern_bool
\bool_new:N \g__codedoc_checkfunc_bool
\bool_new:N \g__codedoc_checktest_bool
\tl_new:N \l__codedoc_tmpa_tl
\tl_new:N \l__codedoc_tmpb_tl
\int_new:N \l__codedoc_tmpa_int
-\prop_new:N \l__codedoc_functions_block_prop
-\seq_new:N \l__codedoc_function_input_seq
-\seq_new:N \l__codedoc_macro_input_seq
+\int_new:N \l__codedoc_tmpa_seq
+\tl_new:N \l__codedoc_names_block_tl
+\seq_new:N \g__codedoc_variants_seq
+\bool_new:N \l__codedoc_names_verb_bool
+\seq_new:N \l__codedoc_names_seq
+\seq_new:N \g__codedoc_nested_names_seq
\tl_const:Nx \c__codedoc_backslash_tl { \iow_char:N \\ }
\exp_last_unbraced:NNo
\cs_new_eq:NN \c__codedoc_backslash_token { \c__codedoc_backslash_tl }
-\tl_new:N \g__codedoc_function_name_prefix_tl
\tl_new:N \l__codedoc_index_macro_tl
\tl_new:N \l__codedoc_index_key_tl
\tl_new:N \l__codedoc_index_module_tl
+\bool_new:N \l__codedoc_index_internal_bool
\tl_new:N \g__codedoc_module_name_tl
\tl_const:Nn \c__codedoc_iow_rule_tl
{ ======================================== }
\tl_const:Nn \c__codedoc_iow_mid_rule_tl
{ -------------------------------------- }
-\box_new:N \l__codedoc_macro_index_box
\box_new:N \l__codedoc_macro_box
+\box_new:N \l__codedoc_macro_index_box
\int_new:N \l__codedoc_macro_int
\tl_new:N \l__codedoc_cmd_tl
\tl_new:N \l__codedoc_cmd_index_tl
+\tl_new:N \l__codedoc_cmd_module_tl
+\bool_new:N \l__codedoc_cmd_noindex_bool
\bool_new:N \l__codedoc_cmd_replace_bool
\bool_new:N \l__codedoc_in_implementation_bool
\bool_new:N \g__codedoc_typeset_documentation_bool
@@ -183,9 +123,213 @@
\bool_set_true:N \g__codedoc_typeset_implementation_bool
\tl_new:N \g__codedoc_base_name_tl
\prop_new:N \l__codedoc_variants_prop
+\clist_new:N \l__codedoc_function_label_clist
\bool_new:N \l__codedoc_no_label_bool
+\tl_new:N \l__codedoc_date_added_tl
+\tl_new:N \l__codedoc_date_updated_tl
+\tl_new:N \l__codedoc_macro_argument_tl
\cs_new_eq:NN \__codedoc_tmpa:w ?
\cs_new_eq:NN \__codedoc_tmpb:w ?
+\cs_generate_variant:Nn \seq_set_split:Nnn { NoV }
+\cs_generate_variant:Nn \str_case:nn { fn }
+\cs_generate_variant:Nn \tl_count:n { f }
+\cs_generate_variant:Nn \tl_greplace_all:Nnn { Nx , Nno }
+\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNTF { o }
+\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNT { o }
+\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNF { o }
+\cs_generate_variant:Nn \tl_if_head_eq_meaning:nNF { V }
+\cs_generate_variant:Nn \tl_if_in:nnTF { no }
+\cs_generate_variant:Nn \tl_if_in:NnTF { No }
+\cs_generate_variant:Nn \tl_if_in:NnT { No }
+\cs_generate_variant:Nn \tl_if_in:NnF { No }
+\cs_generate_variant:Nn \tl_remove_all:Nn { Nx }
+\cs_generate_variant:Nn \tl_replace_all:Nnn { Nx , Nnx, No , Nno }
+\cs_generate_variant:Nn \tl_replace_once:Nnn { Noo }
+\cs_generate_variant:Nn \tl_to_str:n { f , o }
+\cs_generate_variant:Nn \prop_get:NnNTF { Nx }
+\cs_generate_variant:Nn \prop_put:Nnn { Nx }
+\cs_generate_variant:Nn \prop_gput:Nnn { NVx }
+\prg_new_protected_conditional:Npnn \__codedoc_if_almost_str:n #1 { TF , T , F }
+ {
+ \int_compare:nNnTF
+ { \tl_count:n {#1} }
+ < { \tl_count:f { \tl_to_str:f {#1} } }
+ { \prg_return_false: }
+ { \prg_return_true: }
+ }
+\cs_generate_variant:Nn \__codedoc_if_almost_str:nT { V }
+\cs_new_protected:Npn \__codedoc_replace_at_at:N #1
+ {
+ \tl_if_empty:NF \g__codedoc_module_name_tl
+ {
+ \exp_args:NNo \__codedoc_replace_at_at_aux:Nn
+ #1 \g__codedoc_module_name_tl
+ }
+ }
+\cs_new_protected:Npn \__codedoc_replace_at_at_aux:Nn #1#2
+ {
+ \tl_replace_all:Non #1 { \token_to_str:N @ } { @ }
+ \tl_replace_all:Non #1 { \token_to_str:N _ } { _ }
+ \tl_replace_all:Nnn #1 { _ @ @ } { _ _ #2 }
+ \tl_replace_all:Nnn #1 { @ @ } { _ _ #2 }
+ }
+\cs_new:Npn \__codedoc_signature_base_form:n #1
+ { \__codedoc_signature_base_form_aux:n #1 \q_stop }
+\cs_new:Npn \__codedoc_signature_base_form_aux:n #1
+ {
+ \str_case:nnTF {#1}
+ {
+ { N } { N }
+ { c } { N }
+ { n } { n }
+ { o } { n }
+ { f } { n }
+ { x } { n }
+ { V } { n }
+ { v } { n }
+ }
+ { \__codedoc_signature_base_form_aux:n }
+ { \__codedoc_signature_base_form_aux:w #1 }
+ }
+\cs_new:Npn \__codedoc_signature_base_form_aux:w #1 \q_stop
+ { \exp_not:n {#1} }
+\cs_new:Npn \__codedoc_predicate_from_base:n #1
+ {
+ \__codedoc_get_function_name:n {#1}
+ \tl_to_str:n { _p: }
+ \__codedoc_get_function_signature:n {#1}
+ }
+\cs_new:Npn \__codedoc_get_function_name:n #1
+ { \__codedoc_split_function_do:nn {#1} { \use_i:nnn } }
+\cs_new:Npn \__codedoc_get_function_signature:n #1
+ { \__codedoc_split_function_do:nn {#1} { \use_ii:nnn } }
+\cs_set_protected:Npn \__codedoc_tmpa:w #1
+ {
+ \cs_new:Npn \__codedoc_split_function_do:nn ##1
+ {
+ \exp_after:wN \__codedoc_split_function_auxi:w
+ \tl_to_str:n {##1} \q_mark \c_true_bool
+ #1 \q_mark \c_false_bool
+ \q_stop
+ }
+ \cs_new:Npn \__codedoc_split_function_auxi:w
+ ##1 #1 ##2 \q_mark ##3##4 \q_stop ##5
+ { \__codedoc_split_function_auxii:w {##5} ##1 \q_mark \q_stop {##2} ##3 }
+ \cs_new:Npn \__codedoc_split_function_auxii:w
+ ##1##2 \q_mark ##3 \q_stop
+ { ##1 {##2} }
+ }
+\exp_args:No \__codedoc_tmpa:w { \token_to_str:N : }
+\cs_generate_variant:Nn \__codedoc_split_function_do:nn { o }
+\cs_new_protected:Npn \__codedoc_key_get_base:nN #1#2
+ {
+ \__codedoc_if_almost_str:nTF {#1}
+ {
+ \__codedoc_key_get_base_TF:nN {#1} \l__codedoc_tmpa_tl
+ \tl_set:Nx #2
+ { \__codedoc_split_function_do:on \l__codedoc_tmpa_tl { \__codedoc_base_form_aux:nnN } }
+ }
+ { \tl_set:Nn #2 {#1} }
+ }
+\cs_new:Npx \__codedoc_key_get_base_TF:nN #1#2
+ {
+ \tl_set:Nx #2 { \exp_not:N \tl_to_str:n {#1} \scan_stop: }
+ \tl_if_in:NnTF #2 { \tl_to_str:n { F } \scan_stop: }
+ {
+ \tl_if_in:NnF #2 { \tl_to_str:n { TF } \scan_stop: }
+ {
+ \tl_replace_once:Nnn #2
+ { \tl_to_str:n { F } \scan_stop: }
+ { \tl_to_str:n { TF } \scan_stop: }
+ }
+ }
+ {
+ \tl_replace_once:Nnn #2
+ { \tl_to_str:n { T } \scan_stop: }
+ { \tl_to_str:n { TF } \scan_stop: }
+ }
+ \tl_remove_once:Nn #2 { \scan_stop: }
+ }
+\cs_new:Npn \__codedoc_base_form_aux:nnN #1#2#3
+ {
+ \exp_not:n {#1}
+ \bool_if:NT #3
+ {
+ \token_to_str:N :
+ \str_if_eq:nnTF { #1 ~ } { \exp_args }
+ { \exp_not:n {#2} }
+ { \__codedoc_signature_base_form:n {#2} }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_base_form_signature_do:nnn #1#2#3
+ {
+ \__codedoc_split_function_do:nn {#1}
+ { \__codedoc_base_form_aux:nnnnnN {#1} {#2} {#3} }
+ }
+\cs_new_protected:Npn \__codedoc_base_form_aux:nnnnnN #1#2#3#4#5#6
+ {
+ \bool_if:NTF #6
+ {
+ \tl_if_head_eq_charcode:nNTF {#4} :
+ { #2 {#1} }
+ {
+ \use:x
+ {
+ \exp_not:n {#3}
+ { \__codedoc_base_form_aux:nnN {#4} {#5} #6 }
+ }
+ {#4} {#5}
+ }
+ }
+ { #2 {#1} }
+ }
+\prg_new_conditional:Npnn \__codedoc_date_compare:nNn #1#2#3 { TF , T , F , p }
+ { \__codedoc_date_compare_aux:w #1--- \q_mark #2 #3--- \q_stop }
+\cs_new:Npn \__codedoc_date_compare_aux:w
+ #1 - #2 - #3 - #4 \q_mark #5 #6 - #7 - #8 - #9 \q_stop
+ {
+ \__codedoc_date_compare_aux:nnnNnnn
+ { \tl_if_empty:nTF {#1} { 0 } {#1} }
+ { \tl_if_empty:nTF {#2} { 0 } {#2} }
+ { \tl_if_empty:nTF {#3} { 0 } {#3} }
+ #5
+ { \tl_if_empty:nTF {#6} { 0 } {#6} }
+ { \tl_if_empty:nTF {#7} { 0 } {#7} }
+ { \tl_if_empty:nTF {#8} { 0 } {#8} }
+ }
+\cs_new:Npn \__codedoc_date_compare_aux:nnnNnnn #1#2#3#4#5#6#7
+ {
+ \int_compare:nNnTF {#1} = {#5}
+ {
+ \int_compare:nNnTF {#2} = {#6}
+ {
+ \int_compare:nNnTF {#3} #4 {#7}
+ { \prg_return_true: } { \prg_return_false: }
+ }
+ {
+ \int_compare:nNnTF {#2} #4 {#6}
+ { \prg_return_true: } { \prg_return_false: }
+ }
+ }
+ {
+ \int_compare:nNnTF {#1} #4 {#5}
+ { \prg_return_true: } { \prg_return_false: }
+ }
+ \use_none:n
+ \q_stop
+ }
+\cs_new:Npn \__codedoc_gprop_name:n #1 { g__codedoc ~ \tl_to_str:n {#1} }
+\cs_new:Npn \__codedoc_lseq_name:n #1 { l__codedoc ~ \tl_to_str:n {#1} }
+\msg_new:nnnn { l3doc } { no-signature-TF }
+ { Function/macro~'#1'~cannot~be~turned~into~a~conditional. }
+ {
+ A~function~or~macro~environment~with~option~pTF,~TF~or~noTF~
+ received~the~argument~'#1'.~This~function's~name~has~no~
+ ':'~hence~it~is~not~clear~where~to~add~'_p'~or~'TF'.~
+ Please~follow~expl3~naming~conventions.
+ }
+\msg_new:nnn { l3doc } { deprecated-function }
+ { The~deprecated~function(s)~'#1'~should~have~been~removed~on~#2. }
\DeclareOption { a5paper } { \@latexerr { Option~not~supported } { } }
\DeclareOption { full }
{
@@ -210,7 +354,8 @@
\DeclareOption { lm-default }
{ \bool_gset_true:N \g__codedoc_lmodern_bool }
\DeclareOption* { \PassOptionsToClass { \CurrentOption } { article } }
-\ExecuteOptions { full, a4paper, nocheck, nochecktest, lm-default }
+\ExecuteOptions { full, nocheck, nochecktest, lm-default }
+\PassOptionsToClass { a4paper } { article }
\msg_new:nnn { l3doc } { input-cfg }
{ Local~config~file~l3doc.cfg~loaded. }
\file_if_exist:nT { l3doc.cfg }
@@ -254,7 +399,7 @@
\group_end:
}
\RequirePackage{hypdoc}
-\cs_gset_nopar:Npn \MakePrivateLetters
+\cs_gset:Npn \MakePrivateLetters
{
\char_set_catcode_letter:N \@
\char_set_catcode_letter:N \_
@@ -268,19 +413,30 @@
\fvset{gobble=2}
\cs_gset_eq:NN \verbatim \Verbatim
\cs_gset_eq:NN \endverbatim \endVerbatim
+\cs_set_protected:Npn \ifnot@excluded
+ {
+ \exp_args:Nxx \expanded@notin
+ { \c__codedoc_backslash_tl \tl_to_str:N \macro@namepart , }
+ { \exp_args:NV \tl_to_str:n \index@excludelist }
+ }
+\cs_new:Npn \pdfstringnewline { : ~ }
+\DeclareExpandableDocumentCommand
+ { \__codedoc_pdfstring_newline:w } { s o m } { \pdfstringnewline #3 }
+\pdfstringdefDisableCommands
+ { \cs_set_eq:NN \\ \__codedoc_pdfstring_newline:w }
\setlength \textwidth { 385pt }
\addtolength \marginparwidth { 30pt }
\addtolength \oddsidemargin { 20pt }
\addtolength \evensidemargin { 20pt }
\cs_new_eq:NN \__codedoc_oldlist:nn \list
-\cs_gset_nopar:Npn \list #1 #2
+\cs_gset:Npn \list #1 #2
{ \__codedoc_oldlist:nn {#1} { #2 \dim_zero:N \listparindent } }
\setlength \parindent { 2em }
\setlength \itemindent { 0pt }
\setlength \parskip { 0pt plus 3pt minus 0pt }
\tl_gset:Nn \partname {File}
\@addtoreset{section}{part}
-\cs_gset_nopar:Npn \l@section #1#2
+\cs_gset:Npn \l@section #1#2
{
\ifnum \c@tocdepth >\z@
\addpenalty\@secpenalty
@@ -296,7 +452,7 @@
\endgroup
\fi
}
-\cs_gset_nopar:Npn \l@subsection
+\cs_gset:Npn \l@subsection
{ \@dottedtocline{2}{2.5em}{2.3em} } % #2 = 1.5em
\AtBeginDocument
{
@@ -318,18 +474,31 @@
\providecommand*\upTeX{up\kern-.2em\hologo{TeX}}
\providecommand*\epTeX{$\varepsilon$-\pTeX}
\providecommand*\eupTeX{$\varepsilon$-\upTeX}
-\DeclareExpandableDocumentCommand \cmd { O{} m }
+\DeclareDocumentCommand \cmd { O{} m }
{ \__codedoc_cmd:no {#1} { \token_to_str:N #2 } }
-\DeclareExpandableDocumentCommand \cs { O{} m }
+\DeclareDocumentCommand \cs { O{} m }
{ \__codedoc_cmd:no {#1} { \c__codedoc_backslash_tl #2 } }
-\DeclareExpandableDocumentCommand \tn { O{} m }
+\DeclareDocumentCommand \tn { O{} m }
{
\__codedoc_cmd:no
- { index = TeX , replace = false , #1 }
+ { module = TeX , replace = false , #1 }
{ \c__codedoc_backslash_tl #2 }
}
-\DeclareExpandableDocumentCommand { \meta } { m }
+\DeclareDocumentCommand \meta { m }
{ \__codedoc_meta:n {#1} }
+\DeclareExpandableDocumentCommand
+ { \__codedoc_pdfstring_cmd:w } { o m } { \token_to_str:N #2 }
+\DeclareExpandableDocumentCommand
+ { \__codedoc_pdfstring_cs:w } { o m } { \textbackslash \tl_to_str:n {#2} }
+\cs_new:Npn \__codedoc_pdfstring_meta:w #1
+ { < \tl_to_str:n {#1} > }
+\pdfstringdefDisableCommands
+ {
+ \cs_set_eq:NN \cmd \__codedoc_pdfstring_cmd:w
+ \cs_set_eq:NN \cs \__codedoc_pdfstring_cs:w
+ \cs_set_eq:NN \tn \__codedoc_pdfstring_cs:w
+ \cs_set_eq:NN \meta \__codedoc_pdfstring_meta:w
+ }
\newcommand\Arg[1]
{ \texttt{\char`\{} \meta{#1} \texttt{\char`\}} }
\providecommand\marg[1]{ \Arg{#1} }
@@ -404,27 +573,47 @@
{
\endenumerate
}
+\NewDocumentCommand { \CodedocExplain } { }
+ { \CodedocExplainEXP \ \CodedocExplainREXP \ \CodedocExplainTF }
+\NewDocumentCommand { \CodedocExplainEXP } { }
+ {
+ \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{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~
+ \texttt{f}-type~argument.
+ }
+\NewDocumentCommand { \CodedocExplainREXP } { }
+ {
+ \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{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~
+ \texttt{f}-type~argument.
+ }
+\NewDocumentCommand { \CodedocExplainTF } { }
+ {
+ \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{explTF}{}}%
+ \__codedoc_typeset_TF:\ indicates~conditional~(\texttt{if})~functions~
+ whose~variants~with~\texttt{T},~\texttt{F}~and~\texttt{TF}~
+ argument~specifiers~expect~different~
+ \enquote{true}/\enquote{false}~branches.
+ }
\keys_define:nn { l3doc/cmd }
{
index .tl_set:N = \l__codedoc_cmd_index_tl ,
+ module .tl_set:N = \l__codedoc_cmd_module_tl ,
+ no-index .bool_set:N = \l__codedoc_cmd_noindex_bool ,
replace .bool_set:N = \l__codedoc_cmd_replace_bool ,
}
-\cs_new:Npn \__codedoc_cmd:nn #1#2
- {
- \texorpdfstring
- {
- \CodedocUnexpandedTokens
- { \CodedocUseCs { __codedoc_cmd_aux:nn } {#1} {#2} }
- }
- {#2}
- }
-\cs_generate_variant:Nn \__codedoc_cmd:nn { no }
-\cs_new_protected:Npn \__codedoc_cmd_aux:nn #1#2
+\cs_new_protected:Npn \__codedoc_cmd:nn #1#2
{
+ \bool_set_false:N \l__codedoc_cmd_noindex_bool
\bool_set_true:N \l__codedoc_cmd_replace_bool
\tl_set:Nn \l__codedoc_cmd_index_tl { \q_no_value }
+ \tl_set:Nn \l__codedoc_cmd_module_tl { \q_no_value }
\keys_set:nn { l3doc/cmd } {#1}
- \tl_set:No \l__codedoc_cmd_tl { \token_to_str:N #2 }
+ \tl_set:Nn \l__codedoc_cmd_tl {#2}
\bool_if:NT \l__codedoc_cmd_replace_bool
{
\tl_set_rescan:Nnn \l__codedoc_tmpb_tl { } { _ }
@@ -435,9 +624,7 @@
\mode_if_math:T { \mbox }
{
\verbatim@font
- \int_compare:nNnF
- { \tl_count:N \l__codedoc_cmd_tl }
- < { \tl_count:f { \tl_to_str:N \l__codedoc_cmd_tl } }
+ \__codedoc_if_almost_str:VT \l__codedoc_cmd_tl
{
\tl_set:Nx \l__codedoc_cmd_tl { \tl_to_str:N \l__codedoc_cmd_tl }
\tl_replace_all:Non \l__codedoc_cmd_tl
@@ -446,25 +633,26 @@
\tl_replace_all:Nnn \l__codedoc_cmd_tl { ~ } { \@xobeysp }
\l__codedoc_cmd_tl
}
- \exp_args:No \__codedoc_key_get:n { \l__codedoc_cmd_tl }
- \quark_if_no_value:NF \l__codedoc_cmd_index_tl
- { \tl_set_eq:NN \l__codedoc_index_module_tl \l__codedoc_cmd_index_tl }
- \__codedoc_special_index_module:ooon
- { \l__codedoc_index_key_tl }
- { \l__codedoc_index_macro_tl }
- { \l__codedoc_index_module_tl }
- { }
- }
-\cs_new:Npn \__codedoc_meta:n #1
- {
- \texorpdfstring
+ \bool_if:NF \l__codedoc_cmd_noindex_bool
{
- \CodedocUnexpandedTokens
- { \CodedocUseCs { __codedoc_meta_aux:n } {#1} }
+ \quark_if_no_value:NF \l__codedoc_cmd_index_tl
+ { \tl_set_eq:NN \l__codedoc_cmd_tl \l__codedoc_cmd_index_tl }
+ \exp_args:No \__codedoc_key_get:n { \l__codedoc_cmd_tl }
+ \quark_if_no_value:NF \l__codedoc_cmd_module_tl
+ {
+ \tl_set:Nx \l__codedoc_index_module_tl
+ { \tl_to_str:N \l__codedoc_cmd_module_tl }
+ }
+ \__codedoc_special_index_module:ooonN
+ { \l__codedoc_index_key_tl }
+ { \l__codedoc_index_macro_tl }
+ { \l__codedoc_index_module_tl }
+ { }
+ \l__codedoc_index_internal_bool
}
- { < #1 > }
}
-\cs_new_protected:Npn \__codedoc_meta_aux:n #1
+\cs_generate_variant:Nn \__codedoc_cmd:nn { no }
+\cs_new_protected:Npn \__codedoc_meta:n #1
{
\tl_set:Nn \l__codedoc_tmpa_tl {#1}
\tl_map_inline:nn
@@ -494,22 +682,161 @@
}
\ensuremath \rangle
}
+\cs_new_protected:Npn \__codedoc_typeset_exp:
+ { \hyperlink{expstar} {$\star$} }
+\cs_new_protected:Npn \__codedoc_typeset_rexp:
+ { \hyperlink{rexpstar} {\ding{73}} } % hollow star
+\cs_new_protected:Npn \__codedoc_typeset_TF:
+ {
+ \hyperlink{explTF}
+ {
+ \color{black}
+ \itshape TF
+ \makebox[0pt][r]
+ {
+ \color{red}
+ \underline { \phantom{\itshape TF} \kern-0.1em }
+ }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_typeset_aux:n #1
+ {
+ { \color[gray]{0.7} #1 }
+ }
+\cs_new_protected:Npn \__codedoc_get_hyper_target:nN #1#2
+ {
+ \tl_set:Nx #2 { \tl_to_str:n {#1} }
+ \tl_replace_all:Nxn #2 { \iow_char:N \_ } { / }
+ \tl_remove_all:Nx #2 { \iow_char:N \\ }
+ \tl_put_left:Nn #2 { doc/function// }
+ }
+\cs_generate_variant:Nn \__codedoc_get_hyper_target:nN { o , x }
+\cs_new_protected:Npn \__codedoc_names_get_seq:nN #1#2
+ {
+ \tl_set:Nx \l__codedoc_tmpa_tl { \tl_to_str:n {#1} }
+ \bool_if:NTF \l__codedoc_names_verb_bool
+ {
+ \seq_clear:N #2
+ \seq_put_right:NV #2 \l__codedoc_tmpa_tl
+ }
+ {
+ \tl_remove_all:Nx \l__codedoc_tmpa_tl
+ { \iow_char:N \^^M \iow_char:N \% }
+ \tl_remove_all:Nx \l__codedoc_tmpa_tl { \tl_to_str:n { ^ ^ A } }
+ \tl_remove_all:Nx \l__codedoc_tmpa_tl { \iow_char:N \^^I }
+ \tl_remove_all:Nx \l__codedoc_tmpa_tl { \iow_char:N \^^M }
+ \__codedoc_replace_at_at:N \l__codedoc_tmpa_tl
+ \exp_args:NNx \seq_set_from_clist:Nn #2
+ { \tl_to_str:N \l__codedoc_tmpa_tl }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_names_parse:
+ {
+ \tl_clear:N \l__codedoc_names_block_tl
+ \seq_map_function:NN
+ \l__codedoc_names_seq
+ \__codedoc_names_parse_one:n
+ }
+\cs_new_protected:Npn \__codedoc_names_parse_one:n #1
+ {
+ \__codedoc_split_function_do:nn {#1}
+ { \__codedoc_names_parse_one_aux:nnNn }
+ {#1}
+ }
+\cs_new_protected:Npn \__codedoc_names_parse_one_aux:nnNn #1#2#3#4
+ {
+ \bool_if:NTF #3
+ {
+ \tl_if_head_eq_charcode:nNTF {#2} :
+ { \__codedoc_names_parse_aux:nnn {#4} {#4} { \scan_stop: } }
+ {
+ \exp_args:Nx \__codedoc_names_parse_aux:nnn
+ { \__codedoc_base_form_aux:nnN {#1} {#2} #3 }
+ {#1} {#2}
+ }
+ }
+ {
+ \bool_if:NT \l__codedoc_macro_TF_bool
+ { \msg_error:nnx { l3doc } { no-signature-TF } {#4} }
+ \__codedoc_names_parse_aux:nnn {#4} {#4} { \scan_stop: }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_names_parse_aux:nnn #1
+ { \exp_args:Nc \__codedoc_names_parse_aux:Nnn { \__codedoc_lseq_name:n {#1} } }
+\cs_new_protected:Npn \__codedoc_names_parse_aux:Nnn #1#2#3
+ {
+ \tl_if_in:NnF \l__codedoc_names_block_tl {#1}
+ {
+ \tl_put_right:Nn \l__codedoc_names_block_tl {#1}
+ \seq_clear_new:N #1
+ \seq_put_right:Nn #1 {#2}
+ }
+ \seq_put_right:Nn #1 {#3}
+ }
+\cs_new_protected:Npn \__codedoc_names_typeset:
+ {
+ \tl_map_function:NN \l__codedoc_names_block_tl
+ \__codedoc_names_typeset_auxi:n
+ }
+\cs_new_protected:Npn \__codedoc_names_typeset_auxi:n #1
+ {
+ \seq_pop:NN #1 \l__codedoc_tmpa_tl
+ \tl_gset_eq:NN \g__codedoc_base_name_tl \l__codedoc_tmpa_tl
+ \tl_greplace_all:Nno \g__codedoc_base_name_tl
+ { ~ } { \c_catcode_other_space_tl }
+ \seq_get:NN #1 \l__codedoc_tmpa_tl
+ \str_if_eq_x:nnTF { \l__codedoc_tmpa_tl } { \scan_stop: }
+ {
+ \seq_gclear:N \g__codedoc_variants_seq
+ \__codedoc_names_typeset_auxii:x { \g__codedoc_base_name_tl }
+ }
+ {
+ \seq_gset_eq:NN \g__codedoc_variants_seq #1
+ \seq_gpop:NN \g__codedoc_variants_seq \l__codedoc_tmpb_tl
+ \__codedoc_names_typeset_auxii:x
+ { \g__codedoc_base_name_tl : \l__codedoc_tmpb_tl }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_names_typeset_auxii:n #1
+ {
+ \bool_if:NT \l__codedoc_macro_pTF_bool
+ {
+ \__codedoc_names_typeset_block:xN
+ { \__codedoc_predicate_from_base:n {#1} }
+ \c_false_bool
+ }
+ \bool_if:NT \l__codedoc_macro_noTF_bool
+ { \__codedoc_names_typeset_block:nN {#1} \c_false_bool }
+ \__codedoc_names_typeset_block:nN {#1} \l__codedoc_macro_TF_bool
+ }
+\cs_generate_variant:Nn \__codedoc_names_typeset_auxii:n { x }
+\cs_new_protected:Npn \__codedoc_names_typeset_block:nN
+ {
+ \int_compare:nNnTF \l__codedoc_nested_macro_int = 0
+ { \__codedoc_typeset_function_block:nN }
+ { \__codedoc_macro_typeset_block:nN }
+ }
+\cs_generate_variant:Nn \__codedoc_names_typeset_block:nN { x }
\keys_define:nn { l3doc/function }
{
+ TF .value_forbidden:n = true ,
TF .code:n =
{
\bool_set_true:N \l__codedoc_macro_TF_bool
} ,
+ EXP .value_forbidden:n = true ,
EXP .code:n =
{
\bool_set_true:N \l__codedoc_macro_EXP_bool
\bool_set_false:N \l__codedoc_macro_rEXP_bool
} ,
+ rEXP .value_forbidden:n = true ,
rEXP .code:n =
{
\bool_set_false:N \l__codedoc_macro_EXP_bool
\bool_set_true:N \l__codedoc_macro_rEXP_bool
} ,
+ pTF .value_forbidden:n = true ,
pTF .code:n =
{
\bool_set_true:N \l__codedoc_macro_pTF_bool
@@ -517,33 +844,57 @@
\bool_set_true:N \l__codedoc_macro_EXP_bool
\bool_set_false:N \l__codedoc_macro_rEXP_bool
} ,
+ noTF .value_forbidden:n = true ,
+ noTF .code:n =
+ {
+ \bool_set_true:N \l__codedoc_macro_noTF_bool
+ \bool_set_true:N \l__codedoc_macro_TF_bool
+ } ,
added .tl_set:N = \l__codedoc_date_added_tl ,
updated .tl_set:N = \l__codedoc_date_updated_tl ,
+ deprecated .code:n = { \__codedoc_deprecated_on:n {#1} } ,
tested .code:n = { } ,
- no-label .bool_set:N = \l__codedoc_no_label_bool ,
+ label .code:n =
+ {
+ \clist_set:Nn \l__codedoc_function_label_clist {#1}
+ \bool_set_true:N \l__codedoc_no_label_bool
+ } ,
+ verb .value_forbidden:n = true ,
+ verb .bool_set:N = \l__codedoc_names_verb_bool ,
+ module .tl_set:N = \l__codedoc_override_module_tl ,
+ }
+\cs_new_protected:Npn \__codedoc_deprecated_on:n #1
+ {
+ \__codedoc_date_compare:nNnT {#1} < { \tex_year:D / \tex_month:D / \tex_day:D }
+ {
+ \msg_error:nnxx { l3doc } { deprecated-function }
+ { \tl_to_str:N \l__codedoc_macro_argument_tl } {#1}
+ }
+ \bool_set_true:N \l__codedoc_macro_internal_bool
}
\cs_new_protected:Npn \__codedoc_function:nnw #1#2
{
\__codedoc_function_typeset_start:
\__codedoc_function_init:
+ \tl_set:Nn \l__codedoc_macro_argument_tl {#2}
\keys_set:nn { l3doc/function } {#1}
- \__codedoc_verb_get_seq:nN {#2} \l__codedoc_function_input_seq
- \__codedoc_function_parse:
+ \__codedoc_names_get_seq:nN {#2} \l__codedoc_names_seq
+ \__codedoc_names_parse:
\__codedoc_function_typeset:
+ \__codedoc_function_reset:
\__codedoc_function_descr_start:w
}
-\cs_new_protected_nopar:Npn \__codedoc_function_end:
+\cs_new_protected:Npn \__codedoc_function_end:
{
\__codedoc_function_descr_stop:
\__codedoc_function_assemble:
\__codedoc_function_typeset_stop:
}
-\cs_new_protected_nopar:Npn \__codedoc_function_typeset_start:
+\cs_new_protected:Npn \__codedoc_function_typeset_start:
{
\par \bigskip \noindent
- \phantomsection
}
-\cs_new_protected_nopar:Npn \__codedoc_function_typeset_stop:
+\cs_new_protected:Npn \__codedoc_function_typeset_stop:
{
\par
\allowbreak
@@ -555,70 +906,41 @@
\coffin_clear:N \l__codedoc_descr_coffin
\box_gclear:N \g__codedoc_syntax_box
\coffin_clear:N \l__codedoc_syntax_coffin
- \coffin_clear:N \l__codedoc_names_coffin
+ \coffin_clear:N \l__codedoc_functions_coffin
\bool_set_false:N \l__codedoc_macro_TF_bool
\bool_set_false:N \l__codedoc_macro_pTF_bool
+ \bool_set_false:N \l__codedoc_macro_noTF_bool
\bool_set_false:N \l__codedoc_macro_EXP_bool
\bool_set_false:N \l__codedoc_macro_rEXP_bool
\bool_set_false:N \l__codedoc_no_label_bool
+ \bool_set_false:N \l__codedoc_names_verb_bool
+ \clist_clear:N \l__codedoc_function_label_clist
+ \tl_set:Nn \l__codedoc_override_module_tl { \q_no_value }
\char_set_catcode_active:N \<
- \cs_set_protected_nopar:Npn < ##1 > { \meta {##1} }
+ \cs_set_protected:Npn < ##1 > { \meta {##1} }
}
\group_end:
-\cs_new_protected_nopar:Npn \__codedoc_function_parse:
+\cs_new_protected:Npn \__codedoc_function_reset:
{
- \seq_map_function:NN
- \l__codedoc_function_input_seq
- \__codedoc_function_parse_one:n
+ \tl_set:Nn \l__codedoc_override_module_tl { \q_no_value }
}
-\cs_new_protected:Npn \__codedoc_function_parse_one:n #1
- {
- \tl_if_head_eq_charcode:nNTF {#1} \c__codedoc_backslash_token
- {
- \tl_gset_eq:NN \g__codedoc_function_name_prefix_tl \c__codedoc_backslash_tl
- \exp_args:No \tl_if_head_eq_charcode:nNTF { \use_none:n #1 } :
- {
- \prop_put:Nxn \l__codedoc_functions_block_prop
- { \use_none:n #1 } { \scan_stop: }
- }
- {
- \exp_args:Nc \__cs_split_function:NN { \use_none:n #1 }
- \__codedoc_function_parse_cs_aux:nnN
- }
- }
- {
- \tl_gclear:N \g__codedoc_function_name_prefix_tl
- \prop_put:Nnn \l__codedoc_functions_block_prop {#1} { \scan_stop: }
- }
- }
-\cs_new_protected:Npn \__codedoc_function_parse_cs_aux:nnN #1#2#3
- {
- \prop_get:NnNF
- \l__codedoc_functions_block_prop {#1} \l__codedoc_tmpb_tl
- { \tl_clear:N \l__codedoc_tmpb_tl }
- \prop_put:Nnx \l__codedoc_functions_block_prop {#1}
- {
- \l__codedoc_tmpb_tl ,
- \bool_if:NTF #3 { {#2} } { \scan_stop: }
- }
- }
-\cs_new_protected_nopar:Npn \__codedoc_function_typeset:
+\cs_new_protected:Npn \__codedoc_function_typeset:
{
\dim_zero:N \l__codedoc_trial_width_dim
- \hcoffin_set:Nn \l__codedoc_names_coffin { \__codedoc_typeset_names: }
+ \hcoffin_set:Nn \l__codedoc_functions_coffin { \__codedoc_typeset_functions: }
\dim_set:Nn \l__codedoc_trial_width_dim
- { \box_wd:N \l__codedoc_names_coffin }
+ { \box_wd:N \l__codedoc_functions_coffin }
\bool_set:Nn \l__codedoc_long_name_bool
{ \dim_compare_p:nNn \l__codedoc_trial_width_dim > \marginparwidth }
}
-\cs_new_protected_nopar:Npn \__codedoc_function_descr_start:w
+\cs_new_protected:Npn \__codedoc_function_descr_start:w
{
\vcoffin_set:Nnw \l__codedoc_descr_coffin { \textwidth }
\noindent \ignorespaces
}
-\cs_new_protected_nopar:Npn \__codedoc_function_descr_stop:
+\cs_new_protected:Npn \__codedoc_function_descr_stop:
{ \vcoffin_set_end: }
-\cs_new_protected_nopar:Npn \__codedoc_function_assemble:
+\cs_new_protected:Npn \__codedoc_function_assemble:
{
\hcoffin_set:Nn \l__codedoc_syntax_coffin
{ \box_use:N \g__codedoc_syntax_box }
@@ -630,7 +952,7 @@
{0pt} {0pt}
\coffin_join:NnnNnnnn
\l__codedoc_output_coffin {l} {t}
- \l__codedoc_names_coffin {r} {t}
+ \l__codedoc_functions_coffin {r} {t}
{-\marginparsep} {0pt}
\coffin_join:NnnNnnnn
\l__codedoc_output_coffin {l} {b}
@@ -651,144 +973,95 @@
{0pt} {-\medskipamount}
\coffin_join:NnnNnnnn
\l__codedoc_output_coffin {l} {t}
- \l__codedoc_names_coffin {r} {t}
+ \l__codedoc_functions_coffin {r} {t}
{-\marginparsep} {0pt}
\coffin_typeset:Nnnnn \l__codedoc_output_coffin
{\l__codedoc_syntax_coffin-l} {\l__codedoc_syntax_coffin-T}
{0pt} {0pt}
}
}
-\cs_new_protected_nopar:Npn \__codedoc_typeset_names:
+\cs_new_protected:Npn \__codedoc_typeset_functions:
{
\small\ttfamily
- \begin{tabular} { @{} l @{} r @{} }
+ \HD@savedestfalse
+ \HD@target
+ \Hy@MakeCurrentHref { HD. \int_use:N \c@HD@hypercount }
+ \begin{tabular} [t] { @{} l @{} >{\hspace{\tabcolsep}} r @{} }
\toprule
- \__codedoc_typeset_functions:
+ \__codedoc_function_extra_labels:
+ \__codedoc_names_typeset:
\__codedoc_typeset_dates:
\bottomrule
\end{tabular}
\normalfont\normalsize
}
-\cs_new_protected_nopar:Npn \__codedoc_typeset_functions:
+\cs_new_protected:Npn \__codedoc_typeset_function_block:nN #1#2
{
- \prop_map_function:NN \l__codedoc_functions_block_prop
- \__codedoc_typeset_functions_auxi:nn
- }
-\cs_new_protected:Npn \__codedoc_typeset_functions_auxi:nn #1#2
- {
- \tl_gset:Nn \g__codedoc_base_name_tl {#1}
- \prop_clear:N \l__codedoc_variants_prop
- \clist_map_inline:nn {#2}
- {
- \tl_set:Nx \l__codedoc_tmpa_tl
- { \__codedoc_signature_base_form:n {##1} }
- \prop_get:NoNTF \l__codedoc_variants_prop
- \l__codedoc_tmpa_tl \l__codedoc_tmpb_tl
- { \tl_put_right:Nn \l__codedoc_tmpb_tl { , {##1} } }
- { \tl_set:Nn \l__codedoc_tmpb_tl { {##1} } }
- \prop_put:Noo \l__codedoc_variants_prop
- \l__codedoc_tmpa_tl \l__codedoc_tmpb_tl
- }
- \prop_map_function:NN \l__codedoc_variants_prop
- \__codedoc_typeset_functions_auxii:nn
- }
-\cs_new_protected:Npn \__codedoc_typeset_functions_auxii:nn #1#2
- {
- \clist_gset:Nn \g__codedoc_variants_clist {#2}
- \clist_gpop:NN \g__codedoc_variants_clist \l__codedoc_tmpb_tl
- \exp_args:Nc \__codedoc_typeset_functions_auxiii:N
- {
- \g__codedoc_base_name_tl
- \exp_last_unbraced:Nf \token_if_eq_meaning:NNF
- { \tl_head:f { \l__codedoc_tmpb_tl ? } }
- \scan_stop:
- { : \l__codedoc_tmpb_tl }
- }
- }
-\cs_new_protected:Npn \__codedoc_typeset_functions_auxiii:N #1
- {
- \bool_if:NT \l__codedoc_macro_pTF_bool
- {
- \tl_set:Nx \l__codedoc_pTF_name_tl
- { \__codedoc_predicate_from_base:N #1 }
- \__codedoc_function_index:x { \l__codedoc_pTF_name_tl }
- }
\__codedoc_function_index:x
- {
- \cs_to_str:N #1
- \bool_if:NT \l__codedoc_macro_TF_bool { \tl_to_str:n {TF} }
- }
- \bool_if:NT \l__codedoc_macro_pTF_bool
- {
- \exp_args:Nc \__codedoc_typeset_function_block:NN
- { \l__codedoc_pTF_name_tl } \c_false_bool
- }
- \__codedoc_typeset_function_block:NN #1 \l__codedoc_macro_TF_bool
- }
-\cs_new_protected:Npn \__codedoc_function_index:x #1
- {
- \tl_set:Nx \l__codedoc_tmpa_tl
- { \g__codedoc_function_name_prefix_tl #1 }
- \seq_gput_right:No \g_doc_functions_seq { \l__codedoc_tmpa_tl }
- \__codedoc_special_index:on { \l__codedoc_tmpa_tl } { usage }
- }
-\cs_new_protected:Npn \__codedoc_typeset_function_block:NN #1#2
- {
- \__codedoc_function_label:x
- { \g__codedoc_function_name_prefix_tl \cs_to_str:N #1 }
- \g__codedoc_function_name_prefix_tl \cs_to_str:N #1
+ { #1 \bool_if:NT #2 { \tl_to_str:n {TF} } }
+ \__codedoc_function_label:xN {#1} #2
+ #1
\bool_if:NT #2 { \__codedoc_typeset_TF: }
\__codedoc_typeset_expandability:
- \clist_if_empty:NF \g__codedoc_variants_clist
- { \__codedoc_typeset_variant_list:NN #1#2 }
+ \seq_if_empty:NF \g__codedoc_variants_seq
+ { \__codedoc_typeset_variant_list:nN {#1} #2 }
\\
}
-\cs_new_protected_nopar:Npn \__codedoc_typeset_expandability:
+\cs_generate_variant:Nn \__codedoc_typeset_function_block:nN { x }
+\cs_new_protected:Npn \__codedoc_function_index:n #1
+ {
+ \seq_gput_right:Nn \g_doc_functions_seq {#1}
+ \__codedoc_special_index:nn {#1} { usage }
+ }
+\cs_generate_variant:Nn \__codedoc_function_index:n { x }
+\cs_new_protected:Npn \__codedoc_typeset_expandability:
{
&
- \bool_if:NT \l__codedoc_macro_EXP_bool
- {
- \hspace{\tabcolsep}
- \hyperlink{expstar} {$\star$}
- }
- \bool_if:NT \l__codedoc_macro_rEXP_bool
- {
- \hspace{\tabcolsep}
- \hyperlink{rexpstar} {\ding{73}} % hollow star
- }
+ \bool_if:NT \l__codedoc_macro_EXP_bool { \__codedoc_typeset_exp: }
+ \bool_if:NT \l__codedoc_macro_rEXP_bool { \__codedoc_typeset_rexp: }
}
-\cs_new_protected:Npn \__codedoc_typeset_variant_list:NN #1#2
+\cs_new_protected:Npn \__codedoc_typeset_variant_list:nN #1#2
{
\\
- \__codedoc_typeset_aux:n
- {
- \g__codedoc_function_name_prefix_tl
- \__cs_get_function_name:N #1
- }
+ \__codedoc_typeset_aux:n { \__codedoc_get_function_name:n {#1} }
:
- \int_compare:nTF { \clist_count:N \g__codedoc_variants_clist == 1 }
- { \clist_use:Nn \g__codedoc_variants_clist { } }
+ \int_compare:nTF { \seq_count:N \g__codedoc_variants_seq == 1 }
+ { \seq_use:Nn \g__codedoc_variants_seq { } }
{
\textrm(
- \clist_use:Nn \g__codedoc_variants_clist { \textrm| }
+ \seq_use:Nn \g__codedoc_variants_seq { \textrm| }
\textrm)
}
\bool_if:NT #2 { \__codedoc_typeset_TF: }
\__codedoc_typeset_expandability:
}
-\cs_new_protected:Npn \__codedoc_function_label:n #1
+\cs_new_protected:Npn \__codedoc_function_extra_labels:
+ {
+ \bool_if:NT \l__codedoc_no_label_bool
+ {
+ \clist_map_inline:Nn \l__codedoc_function_label_clist
+ {
+ \__codedoc_get_hyper_target:oN { \token_to_str:N ##1 }
+ \l__codedoc_tmpa_tl
+ \exp_args:No \label { \l__codedoc_tmpa_tl }
+ }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_function_label:nN #1#2
{
- % \bool_if:NT \g__codedoc_typeset_implementation_bool
- % {
\bool_if:NF \l__codedoc_no_label_bool
{
- \__codedoc_get_hyper_target:nN {#1} \l__codedoc_tmpa_tl
+ \__codedoc_get_hyper_target:xN
+ {
+ \exp_not:n {#1}
+ \bool_if:NT #2 { \tl_to_str:n {TF} }
+ }
+ \l__codedoc_tmpa_tl
\exp_args:No \label { \l__codedoc_tmpa_tl }
}
- % }
}
-\cs_generate_variant:Nn \__codedoc_function_label:n { x }
-\cs_new_nopar:Npn \__codedoc_typeset_dates:
+\cs_generate_variant:Nn \__codedoc_function_label:nN { x }
+\cs_new:Npn \__codedoc_typeset_dates:
{
\bool_if:nF
{
@@ -822,7 +1095,7 @@
\arrayrulecolor{white}
\begin{tabular} { @{} l @{} }
\toprule
- \begin{minipage}{\l__codedoc_syntax_dim}
+ \begin{minipage}[t]{\l__codedoc_syntax_dim}
\raggedright
\obeyspaces
\obeylines
@@ -836,16 +1109,22 @@
}
\keys_define:nn { l3doc/macro }
{
+ aux .value_forbidden:n = true ,
aux .code:n =
{ \bool_set_true:N \l__codedoc_macro_aux_bool } ,
+ internal .value_forbidden:n = true ,
internal .code:n =
{ \bool_set_true:N \l__codedoc_macro_internal_bool } ,
+ int .value_forbidden:n = true ,
int .code:n =
{ \bool_set_true:N \l__codedoc_macro_internal_bool } ,
+ var .value_forbidden:n = true ,
var .code:n =
{ \bool_set_true:N \l__codedoc_macro_var_bool } ,
+ TF .value_forbidden:n = true ,
TF .code:n =
{ \bool_set_true:N \l__codedoc_macro_TF_bool } ,
+ pTF .value_forbidden:n = true ,
pTF .code:n =
{
\bool_set_true:N \l__codedoc_macro_TF_bool
@@ -853,11 +1132,19 @@
\bool_set_true:N \l__codedoc_macro_EXP_bool
\bool_set_false:N \l__codedoc_macro_rEXP_bool
} ,
+ noTF .value_forbidden:n = true ,
+ noTF .code:n =
+ {
+ \bool_set_true:N \l__codedoc_macro_TF_bool
+ \bool_set_true:N \l__codedoc_macro_noTF_bool
+ } ,
+ EXP .value_forbidden:n = true ,
EXP .code:n =
{
\bool_set_true:N \l__codedoc_macro_EXP_bool
\bool_set_false:N \l__codedoc_macro_rEXP_bool
} ,
+ rEXP .value_forbidden:n = true ,
rEXP .code:n =
{
\bool_set_false:N \l__codedoc_macro_EXP_bool
@@ -869,51 +1156,88 @@
} ,
added .code:n = {} , % TODO
updated .code:n = {} , % TODO
+ deprecated .code:n = { \__codedoc_deprecated_on:n {#1} } ,
+ verb .bool_set:N = \l__codedoc_names_verb_bool ,
+ module .tl_set:N = \l__codedoc_override_module_tl ,
+ documented-as .tl_set:N = \l__codedoc_macro_documented_tl ,
}
\cs_new_protected:Npn \__codedoc_macro:nnw #1#2
{
\__codedoc_macro_init:
+ \tl_set:Nn \l__codedoc_macro_argument_tl {#2}
\keys_set:nn { l3doc/macro } {#1}
- \__codedoc_verb_get_seq:nN {#2} \l__codedoc_macro_input_seq
- \__codedoc_macro_map:N \__codedoc_macro_single:n
- \__codedoc_macro_typeset:
+ \__codedoc_names_get_seq:nN {#2} \l__codedoc_names_seq
+ \__codedoc_names_parse:
+ \__codedoc_macro_adjust_internal:
+ \__codedoc_macro_save_names:
+ \__codedoc_names_typeset:
+ \__codedoc_macro_dump:
+ \__codedoc_macro_reset:
}
-\cs_new_protected_nopar:Npn \__codedoc_macro_init:
+\cs_new_protected:Npn \__codedoc_macro_init:
{
\int_incr:N \l__codedoc_nested_macro_int
\bool_set_false:N \l__codedoc_macro_aux_bool
\bool_set_false:N \l__codedoc_macro_internal_bool
\bool_set_false:N \l__codedoc_macro_TF_bool
\bool_set_false:N \l__codedoc_macro_pTF_bool
+ \bool_set_false:N \l__codedoc_macro_noTF_bool
\bool_set_false:N \l__codedoc_macro_EXP_bool
\bool_set_false:N \l__codedoc_macro_rEXP_bool
\bool_set_false:N \l__codedoc_macro_var_bool
\bool_set_false:N \l__codedoc_macro_tested_bool
+ \bool_set_false:N \l__codedoc_names_verb_bool
+ \tl_set:Nn \l__codedoc_override_module_tl { \q_no_value }
+ \tl_clear:N \l__codedoc_macro_documented_tl
\cs_set_eq:NN \testfile \__codedoc_print_testfile:n
\box_clear:N \l__codedoc_macro_index_box
\vbox_set:Nn \l__codedoc_macro_box
{
- \hbox:n { \strut }
+ \hbox:n
+ {
+ \strut
+ \int_compare:nNnT \l__codedoc_macro_int = \c_zero
+ { \HD@target }
+ }
\vskip \int_eval:n { \l__codedoc_macro_int - 1 } \baselineskip
}
}
-\cs_new_protected:Npn \__codedoc_macro_map:N #1
+\cs_new_protected:Npn \__codedoc_macro_reset:
{
- \bool_if:NT \l__codedoc_macro_pTF_bool
+ \tl_set:Nn \l__codedoc_override_module_tl { \q_no_value }
+ }
+\cs_new_protected:Npn \__codedoc_macro_adjust_internal:
+ {
+ \bool_if:NF \l__codedoc_macro_internal_bool
{
- \bool_set_false:N \l__codedoc_macro_TF_bool
- \seq_map_inline:Nn \l__codedoc_macro_input_seq
+ \bool_if:NF \l__codedoc_macro_aux_bool
{
- \tl_set:Nn \l__codedoc_tmpa_tl {##1}
- \tl_replace_once:Noo \l__codedoc_tmpa_tl
- { \tl_to_str:n { : } } { \tl_to_str:n { _p: } }
- \exp_args:No #1 \l__codedoc_tmpa_tl
+ \bool_set_true:N \l__codedoc_macro_internal_bool
+ \seq_map_inline:Nn \l__codedoc_names_seq
+ {
+ \tl_if_in:noF {##1} { \tl_to_str:n { __ } }
+ { \bool_set_false:N \l__codedoc_macro_internal_bool }
+ }
}
- \bool_set_true:N \l__codedoc_macro_TF_bool
}
- \seq_map_function:NN \l__codedoc_macro_input_seq #1
}
-\cs_new_protected_nopar:Npn \__codedoc_macro_typeset:
+\cs_new_protected:Npn \__codedoc_macro_save_names:
+ {
+ \tl_map_inline:Nn \l__codedoc_names_block_tl
+ {
+ \seq_set_eq:NN \l__codedoc_tmpa_seq ##1
+ \seq_pop:NN \l__codedoc_tmpa_seq \l__codedoc_tmpa_tl
+ \seq_get:NN \l__codedoc_tmpa_seq \l__codedoc_tmpb_tl
+ \seq_gput_right:Nx \g__codedoc_nested_names_seq
+ {
+ \l__codedoc_tmpa_tl
+ \str_if_eq_x:nnF { \l__codedoc_tmpb_tl } { \scan_stop: }
+ { : \l__codedoc_tmpb_tl }
+ \bool_if:NT \l__codedoc_macro_TF_bool { TF }
+ }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_macro_dump:
{
\topsep\MacroTopsep
\trivlist
@@ -931,56 +1255,76 @@
}
\item [ ]
}
-\cs_new_protected:Npn \__codedoc_macro_single:n #1
+\cs_new_protected:Npn \__codedoc_macro_typeset_block:nN #1#2
{
- \tl_set:Nn \saved@macroname {#1}
- \__codedoc_macro_typeset_one:n {#1}
- \exp_args:Nx \__codedoc_macro_index:n
+ \__codedoc_macro_single:nNN {#1} \c_true_bool #2
+ \seq_if_empty:NF \g__codedoc_variants_seq
{
- #1
- \bool_if:NT \l__codedoc_macro_TF_bool { \tl_to_str:n { TF } }
+ \__codedoc_macro_typeset_variant_list:xN
+ { \__codedoc_get_function_name:n {#1} } #2
}
}
-\cs_new_protected:Npn \__codedoc_macro_index:n #1
+\cs_generate_variant:Nn \__codedoc_macro_typeset_block:nN { x }
+\cs_new_protected:Npn \__codedoc_macro_typeset_variant_list:nN #1#2
+ {
+ \seq_map_inline:Nn \g__codedoc_variants_seq
+ { \__codedoc_macro_single:nNN { #1 : ##1 } \c_false_bool #2 }
+ }
+\cs_generate_variant:Nn \__codedoc_macro_typeset_variant_list:nN { x }
+\cs_new_protected:Npn \__codedoc_macro_single:nNN #1#2#3
{
- \bool_if:NF \l__codedoc_macro_aux_bool
- { \seq_gput_right:Nn \g_doc_macros_seq {#1} }
- \hbox_set:Nw \l__codedoc_macro_index_box
- % This box only contains targets... it seems inefficient.
- \hbox_unpack_clear:N \l__codedoc_macro_index_box
- \int_gincr:N \c@CodelineNo
- \__codedoc_special_index:nn {#1} { main }
- \DoNotIndex {#1}
- \int_gdecr:N \c@CodelineNo
- \exp_args:NNNo \hbox_set_end:
- \tl_set:Nn \saved@indexname { \l__codedoc_index_key_tl }
+ \tl_set:Nn \saved@macroname {#1}
+ \__codedoc_macro_typeset_one:nN {#1} #3
+ \bool_if:NT #3 { \DoNotIndex {#1} }
+ \exp_args:Nx \__codedoc_macro_index:nN
+ { #1 \bool_if:NT #3 { \tl_to_str:n { TF } } }
+ #2
+ }
+\cs_new_protected:Npn \__codedoc_macro_index:nN #1#2
+ {
+ \DoNotIndex {#1}
+ \bool_if:NT #2
+ {
+ \bool_if:NF \l__codedoc_macro_aux_bool
+ { \seq_gput_right:Nn \g_doc_macros_seq {#1} }
+ \hbox_set:Nw \l__codedoc_macro_index_box
+ \hbox_unpack_clear:N \l__codedoc_macro_index_box
+ \int_gincr:N \c@CodelineNo
+ \__codedoc_special_index:nn {#1} { main }
+ \int_gdecr:N \c@CodelineNo
+ \exp_args:NNNo \hbox_set_end:
+ \tl_set:Nn \saved@indexname { \l__codedoc_index_key_tl }
+ }
}
-\cs_new_protected:Npn \__codedoc_macro_typeset_one:n #1
+\cs_new_protected:Npn \__codedoc_macro_typeset_one:nN #1#2
{
\vbox_set:Nn \l__codedoc_macro_box
{
\vbox_unpack_clear:N \l__codedoc_macro_box
- \hbox { \llap { \__codedoc_print_macroname:n {#1} \ } }
+ \hbox { \llap { \__codedoc_print_macroname:nN {#1} #2 \ } }
}
\int_incr:N \l__codedoc_macro_int
}
-\cs_new_protected:Npn \__codedoc_print_macroname:n #1
+\cs_new_protected:Npn \__codedoc_print_macroname:nN #1#2
{
\strut
- \HD@target
-
- % TODO: INEFFICIENT(!)
- \exp_args:NNx \seq_if_in:NnTF \g_doc_functions_seq
- { #1 \bool_if:NT \l__codedoc_macro_TF_bool { \tl_to_str:n {TF} } }
+ \__codedoc_get_hyper_target:xN
{
- \__codedoc_get_hyper_target:nN {#1} \l__codedoc_tmpa_tl
- \exp_last_unbraced:NNo \hyperref [ \l__codedoc_tmpa_tl ]
+ \exp_not:n {#1}
+ \bool_if:NT #2 { \tl_to_str:n {TF} }
}
+ \l__codedoc_tmpa_tl
+ \cs_if_exist:cTF { r@ \l__codedoc_tmpa_tl }
+ { \exp_last_unbraced:NNo \hyperref [ \l__codedoc_tmpa_tl ] }
{ \use:n }
{
- \int_compare:nTF { \tl_count:n {#1} <= 28 }
+ \int_compare:nTF { \str_count:n {#1} <= 28 }
{ \MacroFont } { \MacroLongFont }
- \__codedoc_macroname_prefix:n {#1} \__codedoc_macroname_suffix:
+ \tl_set:Nn \l__codedoc_tmpa_tl {#1}
+ \tl_replace_all:Nno \l__codedoc_tmpa_tl
+ { ~ } { \c_catcode_other_space_tl }
+ \__codedoc_macroname_prefix:o \l__codedoc_tmpa_tl
+ \__codedoc_macroname_suffix:N #2
}
}
\cs_new_protected:Npn \__codedoc_macroname_prefix:n #1
@@ -988,8 +1332,9 @@
\bool_if:NTF \l__codedoc_macro_aux_bool
{ \__codedoc_typeset_aux:n {#1} } {#1}
}
-\cs_new_protected_nopar:Npn \__codedoc_macroname_suffix:
- { \bool_if:NTF \l__codedoc_macro_TF_bool { \__codedoc_typeset_TF: } { } }
+\cs_generate_variant:Nn \__codedoc_macroname_prefix:n { o }
+\cs_new_protected:Npn \__codedoc_macroname_suffix:N #1
+ { \bool_if:NTF #1 { \__codedoc_typeset_TF: } { } }
\providecommand \MacroLongFont
{
\fontfamily{lmtt}\fontseries{lc}\small
@@ -1033,32 +1378,30 @@
{ \__codedoc_test_missing:n {#1} }
\cs_new_protected:Npn \__codedoc_test_missing:n #1
{
- \tl_set:Nx \l__codedoc_tmpb_tl
- { \seq_use:Nn \l__codedoc_macro_input_seq { , } }
- \prop_if_in:NVTF \g__codedoc_missing_tests_prop \l__codedoc_tmpb_tl
- {
- \prop_get:NVN \g__codedoc_missing_tests_prop \l__codedoc_tmpb_tl
- \l__codedoc_tmpa_tl
- }
- { \tl_clear:N \l__codedoc_tmpa_tl }
- \clist_set:Nx \l__codedoc_tmpa_clist { \l__codedoc_tmpa_tl , #1 }
- \prop_gput:NVV \g__codedoc_missing_tests_prop \l__codedoc_tmpb_tl
- \l__codedoc_tmpa_clist
+ \__codedoc_test_missing_aux:Nxn
+ \g__codedoc_missing_tests_prop
+ { \seq_use:Nn \l__codedoc_names_seq { , } }
+ { { \g_file_current_name_tl \iow_char:N \ (#1) } }
+ }
+\cs_new_protected:Npn \__codedoc_test_missing_aux:Nnn #1#2#3
+ {
+ \prop_get:NnNTF #1 {#2} \l__codedoc_tmpa_tl
+ { \tl_put_right:Nn \l__codedoc_tmpa_tl { , #3 } }
+ { \tl_set:Nn \l__codedoc_tmpa_tl {#3} }
+ \prop_put:Nno #1 {#2} \l__codedoc_tmpa_tl
}
+\cs_generate_variant:Nn \__codedoc_test_missing_aux:Nnn { Nx }
\cs_new_protected:Npn \__codedoc_macro_end:
{
\endtrivlist
\__codedoc_macro_end_check_tested:
\int_compare:nNnT \l__codedoc_nested_macro_int = 1
{
- \__codedoc_macro_end_style:n
- {
- \__codedoc_print_end_definition:
- \__codedoc_print_documented:
- }
+ \__codedoc_macro_end_style:n { \__codedoc_print_end_definition: }
+ \seq_gclear:N \g__codedoc_nested_names_seq
}
}
-\cs_new_protected_nopar:Npn \__codedoc_macro_end_check_tested:
+\cs_new_protected:Npn \__codedoc_macro_end_check_tested:
{
\bool_if:nT
{
@@ -1070,7 +1413,7 @@
{
\seq_gput_right:Nx \g__codedoc_not_tested_seq
{
- \seq_use:Nn \l__codedoc_macro_input_seq { , }
+ \seq_use:Nn \l__codedoc_names_seq { , }
\bool_if:NTF \l__codedoc_macro_pTF_bool {~(pTF)}
{ \bool_if:NT \l__codedoc_macro_TF_bool {~(TF)} }
}
@@ -1081,36 +1424,29 @@
\nobreak \noindent
{ \footnotesize ( \emph{#1} ) \par }
}
-\cs_new_protected:Npn \__codedoc_macro_end_wrap_items:N #1
+\cs_new_protected:Npn \__codedoc_macro_end_wrap_item:n #1
{
- \bool_if:NT \l__codedoc_macro_TF_bool
- { \seq_set_map:NNn #1 #1 { ##1 TF } }
- \seq_set_map:NNn #1 #1
- {
- \exp_not:n
- {
- \tl_set:Nn \l__codedoc_tmpa_tl {##1}
- \tl_replace_all:Non \l__codedoc_tmpa_tl
- { \token_to_str:N _ } { \_ }
- \texttt { \l__codedoc_tmpa_tl }
- }
- }
+ \tl_set:Nn \l__codedoc_tmpa_tl {#1}
+ \tl_replace_all:Non \l__codedoc_tmpa_tl
+ { \token_to_str:N _ } { \_ }
+ \texttt { \l__codedoc_tmpa_tl }
}
-\cs_new_protected_nopar:Npn \__codedoc_print_end_definition:
+\cs_new_protected:Npn \__codedoc_print_end_definition:
{
- \group_begin:
- \__codedoc_macro_end_wrap_items:N \l__codedoc_macro_input_seq
+ \seq_set_map:NNn \l__codedoc_tmpa_seq
+ \g__codedoc_nested_names_seq
+ { \exp_not:n { \__codedoc_macro_end_wrap_item:n {##1} } }
End~ definition~ for~
- \int_compare:nTF { \seq_count:N \l__codedoc_macro_input_seq <= 3 }
+ \int_compare:nTF { \seq_count:N \l__codedoc_tmpa_seq <= 3 }
{
- \seq_use:Nnnn \l__codedoc_macro_input_seq
+ \seq_use:Nnnn \l__codedoc_tmpa_seq
{ \,~and~ } { \,,~ } { \,,~and~ }
- \@.
}
- { \seq_item:Nn \l__codedoc_macro_input_seq {1}\,~and~others. }
- \group_end:
+ { \seq_item:Nn \l__codedoc_tmpa_seq {1}\,~and~others }
+ \@.
+ \__codedoc_print_documented:
}
-\cs_new_protected_nopar:Npn \__codedoc_print_documented:
+\cs_new_protected:Npn \__codedoc_print_documented:
{
\bool_if:nT
{
@@ -1119,45 +1455,29 @@
}
{
\int_set:Nn \l__codedoc_tmpa_int
- { \seq_count:N \l__codedoc_macro_input_seq }
+ { \seq_count:N \g__codedoc_nested_names_seq }
+ \tl_if_empty:NTF \l__codedoc_macro_documented_tl
+ {
+ \tl_set:Nx \l__codedoc_macro_documented_tl
+ { \seq_item:Nn \g__codedoc_nested_names_seq { 1 } }
+ }
+ {
+ \tl_set:Nf \l__codedoc_macro_documented_tl
+ {
+ \exp_after:wN \token_to_str:N
+ \l__codedoc_macro_documented_tl
+ }
+ }
\int_compare:nNnTF \l__codedoc_tmpa_int = 1 {~This~} {~These~}
\bool_if:NTF \l__codedoc_macro_var_bool {variable} {function}
\int_compare:nNnTF \l__codedoc_tmpa_int = 1 {~is~} {s~are~}
documented~on~page~
- \exp_args:Nx \__codedoc_get_hyper_target:nN
- { \seq_item:Nn \l__codedoc_macro_input_seq { 1 } }
+ \__codedoc_get_hyper_target:oN
+ \l__codedoc_macro_documented_tl
\l__codedoc_tmpa_tl
\exp_args:Nx \pageref { \l__codedoc_tmpa_tl } .
}
}
-\cs_new_protected_nopar:Npn \__codedoc_typeset_TF:
- {
- \hyperlink{explTF}
- {
- \color{black}
- \itshape TF
- \makebox[0pt][r]
- {
- \color{red}
- \underline { \phantom{\itshape TF} \kern-0.1em }
- }
- }
- }
-\cs_new_protected:Npn \__codedoc_typeset_aux:n #1
- {
- { \color[gray]{0.7} #1 }
- }
-\cs_new_protected:Npn \__codedoc_get_hyper_target:nN #1#2
- {
- \tl_set:Nx #2
- {
- \tl_to_str:n {#1}
- \bool_if:NT \l__codedoc_macro_TF_bool { \tl_to_str:n {TF} }
- }
- \tl_replace_all:Nxn #2 { \iow_char:N \_ } { / }
- \tl_remove_all:Nx #2 { \iow_char:N \\ }
- \tl_put_left:Nn #2 { doc/function// }
- }
\newcommand*{\DescribeOption}
{
\leavevmode
@@ -1201,12 +1521,12 @@
\@esphack
}
\font \manual = manfnt \scan_stop:
-\cs_gset_nopar:Npn \dbend { {\manual\char127} }
+\cs_gset:Npn \dbend { {\manual\char127} }
\newenvironment {danger}
{
\begin{trivlist}\item[]\noindent
\begingroup\hangindent=2pc\hangafter=-2
- \cs_set_nopar:Npn \par{\endgraf\endgroup}
+ \cs_set:Npn \par{\endgraf\endgroup}
\hbox to0pt{\hskip-\hangindent\dbend\hfill}\ignorespaces
}
{
@@ -1216,7 +1536,7 @@
{
\begin{trivlist}\item[]\noindent
\begingroup\hangindent=3.5pc\hangafter=-2
- \cs_set_nopar:Npn \par{\endgraf\endgroup}
+ \cs_set:Npn \par{\endgraf\endgroup}
\hbox to0pt{\hskip-\hangindent\dbend\kern2pt\dbend\hfill}\ignorespaces
}{
\par\end{trivlist}
@@ -1314,8 +1634,8 @@
\relax\clearpage
\docincludeaux
\IfFileExists{#1.fdd}
- { \cs_set_nopar:Npn \currentfile{#1.fdd} }
- { \cs_set_nopar:Npn \currentfile{#1.dtx} }
+ { \cs_set:Npn \currentfile{#1.fdd} }
+ { \cs_set:Npn \currentfile{#1.dtx} }
\int_compare:nNnTF \@auxout = \@partaux
{ \@latexerr{\string\include\space cannot~be~nested}\@eha }
{ \@docinclude #1 }
@@ -1327,7 +1647,7 @@
\@tempswatrue
\if@partsw
\@tempswafalse
- \cs_set_nopar:Npx \@tempb{#1}
+ \cs_set:Npx \@tempb{#1}
\@for\@tempa:=\@partlist\do
{
\ifx\@tempa\@tempb\@tempswatrue\fi
@@ -1346,7 +1666,7 @@
\part{\currentfile}
{
\cs_set_eq:NN \ttfamily\relax
- \cs_gset_nopar:Npx \filekey
+ \cs_gset:Npx \filekey
{ \filekey, \thepart = { \ttfamily \currentfile } }
}
\DocInput{\currentfile}
@@ -1371,14 +1691,14 @@
}
}
\tl_gclear:N \filesep
-\cs_gset_nopar:Npn \docincludeaux
+\cs_gset:Npn \docincludeaux
{
\tl_set:Nn \thepart { \alphalph { part } }
\tl_set:Nn \filesep { \thepart - }
\cs_set_eq:NN \filekey \use_none:n
\tl_gput_right:Nn \index@prologue
{
- \cs_gset_nopar:Npn \@oddfoot
+ \cs_gset:Npn \@oddfoot
{
\parbox { \textwidth }
{
@@ -1389,7 +1709,7 @@
\cs_set_eq:NN \@evenfoot \@oddfoot
}
\cs_gset_eq:NN \docincludeaux \relax
- \cs_gset_nopar:Npn \@oddfoot
+ \cs_gset:Npn \@oddfoot
{
\cs_if_exist:cTF { ver @ \currentfile }
{ File~\thepart :~{\ttfamily\currentfile}~ }
@@ -1453,7 +1773,7 @@
\tl_new:N \l__codedoc_doc_def_tl
\tl_new:N \l__codedoc_doc_undef_tl
\tl_new:N \l__codedoc_undoc_def_tl
-\cs_new_protected_nopar:Npn \__codedoc_show_functions_defined:
+\cs_new_protected:Npn \__codedoc_show_functions_defined:
{
\bool_if:nT
{ \g__codedoc_typeset_implementation_bool && \g__codedoc_checkfunc_bool }
@@ -1519,7 +1839,7 @@
\tl_clear:N #2
}
}
-\cs_new_protected_nopar:Npn \__codedoc_show_not_tested:
+\cs_new_protected:Npn \__codedoc_show_not_tested:
{
\bool_if:NT \g__codedoc_checktest_bool
{
@@ -1606,51 +1926,67 @@
{
\use:x
{
- \__codedoc_special_index_module:nnnn
+ \__codedoc_special_index_module:nnnnN
{ \quotechar #1 }
{ \quotechar \bslash \quotechar #1 }
{ }
{ }
+ \c_false_bool
}
}
\cs_new_protected:Npn \__codedoc_special_index:nn #1#2
{
\__codedoc_key_get:n {#1}
- \__codedoc_special_index_module:ooon
+ \quark_if_no_value:NF \l__codedoc_override_module_tl
+ { \tl_set_eq:NN \l__codedoc_index_module_tl \l__codedoc_override_module_tl }
+ \__codedoc_special_index_module:ooonN
{ \l__codedoc_index_key_tl }
{ \l__codedoc_index_macro_tl }
{ \l__codedoc_index_module_tl }
{#2}
+ \l__codedoc_index_internal_bool
}
\cs_generate_variant:Nn \__codedoc_special_index:nn { o }
\tl_new:N \l__codedoc_index_escaped_macro_tl
-\cs_new_protected:Npn \__codedoc_special_index_module:nnnn #1#2#3#4
+\cs_new_protected:Npn \__codedoc_special_index_module:nnnnN #1#2#3#4#5
{
\use:x
{
- \exp_not:n { \__codedoc_special_index_aux:nnnnn {#1} {#2} }
- \str_case_x:nnF {#3}
+ \exp_not:n { \__codedoc_special_index_aux:nnnnnn {#1} {#2} }
+ \tl_if_empty:nTF {#3}
+ { { } { } { } }
{
- { } { { } { } }
- { TeX }
+ \str_if_eq_x:nnTF {#3} { TeX }
+ {
+ { TeX~and~LaTeX2e }
+ { \string\TeX{}~and~\string\LaTeXe{} }
+ }
{
- { TeX~and~LaTeX2e~commands }
- { \string\TeX{}~and~\string\LaTeXe{}~commands: }
+ {#3}
+ { \string\pkg{#3} }
}
+ { \bool_if:NT #5 { ~internal } ~commands: }
}
- { { #3~commands } { \string\pkg{#3}~commands: } }
}
{#4}
}
-\cs_generate_variant:Nn \__codedoc_special_index_module:nnnn { ooo }
-\cs_new_protected:Npn \__codedoc_special_index_aux:nnnnn #1#2#3#4#5
+\cs_generate_variant:Nn \__codedoc_special_index_module:nnnnN { ooo }
+\cs_new_protected:Npn \__codedoc_special_index_aux:nnnnnn #1#2#3#4#5#6
{
- \HD@target
\__codedoc_special_index_set:Nn \l__codedoc_index_escaped_macro_tl {#2}
- \index
+ \str_if_eq:onTF { \@currenvir } { macrocode }
+ { \codeline@wrindex }
{
- \tl_if_empty:nF { #3 #4 }
- { #3 \actualchar #4 \levelchar }
+ \str_case:nnF {#6}
+ {
+ { main } { \codeline@wrindex }
+ { usage } { \index }
+ }
+ { \HD@target \index }
+ }
+ {
+ \tl_if_empty:nF { #3 #4 #5 }
+ { #3 #5 \actualchar #4 #5 \levelchar }
#1
\actualchar
{
@@ -1658,20 +1994,13 @@
\l__codedoc_index_escaped_macro_tl
}
\encapchar
- hdclindex{\the\c@HD@hypercount}{#5}
+ hdclindex{\the\c@HD@hypercount}{#6}
}
}
-\cs_generate_variant:Nn \__codedoc_special_index_aux:nnnnn { o }
\cs_new_protected:Npn \__codedoc_special_index_set:Nn #1#2
{
\tl_set:Nx #1 { \tl_to_str:n {#2} }
- \int_compare:nNnTF { \tl_count:n {#2} } < { \tl_count:N #1 }
- {
- \tl_set:Nn #1 {#2}
- \tl_replace_all:Non #1
- { \c__codedoc_backslash_tl }
- { \token_to_str:N \bslash \c_space_tl }
- }
+ \__codedoc_if_almost_str:nTF {#2}
{
\exp_args:Nx \tl_map_inline:nn
{ \tl_to_str:N \verbatimchar \token_to_str:N _ }
@@ -1693,65 +2022,95 @@
#1 \verbatimchar
}
}
+ {
+ \tl_set:Nn #1 {#2}
+ \tl_replace_all:Non #1
+ { \c__codedoc_backslash_tl }
+ { \token_to_str:N \bslash \c_space_tl }
+ }
}
\cs_new_protected:Npn \__codedoc_key_get:n #1
{
- \tl_set:Nn \l__codedoc_index_macro_tl {#1}
- \tl_set:Nx \l__codedoc_index_key_tl { \tl_to_str:n {#1} }
+ \__codedoc_key_get_base:nN {#1} \l__codedoc_index_macro_tl
+ \tl_set:Nx \l__codedoc_index_key_tl
+ { \tl_to_str:N \l__codedoc_index_macro_tl }
\tl_clear:N \l__codedoc_index_module_tl
+ \tl_if_in:NoTF \l__codedoc_index_key_tl { \tl_to_str:n { __ } }
+ { \bool_set_true:N \l__codedoc_index_internal_bool }
+ { \bool_set_false:N \l__codedoc_index_internal_bool }
\tl_if_head_eq_charcode:oNT
{ \l__codedoc_index_key_tl } \c__codedoc_backslash_token
{ \__codedoc_key_pop: }
\tl_if_in:NoTF \l__codedoc_index_key_tl { \token_to_str:N : }
- { \__codedoc_key_expl: }
+ { \__codedoc_key_func: }
{
\tl_if_in:NoTF \l__codedoc_index_key_tl { \token_to_str:N _ }
- { \__codedoc_key_expl: }
+ { \__codedoc_key_var: }
{
\tl_if_in:NoT \l__codedoc_index_key_tl { \token_to_str:N @ }
{ \tl_set:Nn \l__codedoc_index_module_tl { TeX } }
}
}
}
-\cs_new_protected_nopar:Npn \__codedoc_key_pop:
+\cs_new_protected:Npn \__codedoc_key_pop:
{
\tl_set:Nx \l__codedoc_index_key_tl
{ \tl_tail:N \l__codedoc_index_key_tl }
}
-\cs_new_protected_nopar:Npn \__codedoc_key_expl:
+\cs_set:Npn \__codedoc_key_trim_module:n #1
+ {
+ \cs_set:Npn \__codedoc_tmpa:w ##1 #1 ##2 \q_stop
+ { \exp_not:n {##1} }
+ \tl_set:Nx \l__codedoc_index_module_tl
+ { \exp_after:wN \__codedoc_tmpa:w \l__codedoc_index_module_tl #1 \q_stop }
+ }
+\cs_new_protected:Npn \__codedoc_key_drop_underscores:
{
- \tl_if_head_eq_charcode:oNTF { \l__codedoc_index_key_tl } .
+ \tl_if_head_eq_charcode:oNT { \l__codedoc_index_key_tl } _
+ { \__codedoc_key_pop: \__codedoc_key_drop_underscores: }
+ }
+\cs_new_protected:Npn \__codedoc_key_func:
+ {
+ \tl_if_head_eq_charcode:oNT { \l__codedoc_index_key_tl } .
{ \__codedoc_key_pop: }
+ \__codedoc_key_drop_underscores:
+ \tl_set_eq:NN \l__codedoc_index_module_tl \l__codedoc_index_key_tl
+ \exp_args:No \__codedoc_key_trim_module:n { \token_to_str:N : }
+ \exp_args:No \__codedoc_key_trim_module:n { \token_to_str:N _ }
+ }
+\cs_new_protected:Npn \__codedoc_key_var:
+ {
+ \exp_args:Nx \tl_if_head_eq_charcode:nNTF
+ { \exp_args:No \str_tail:n \l__codedoc_index_key_tl } _
{
- \exp_args:Nx \tl_if_head_eq_charcode:nNT
- { \exp_args:No \str_tail:n \l__codedoc_index_key_tl } _
+ \str_case:fn { \str_head:N \l__codedoc_index_key_tl }
{
- \tl_if_head_eq_charcode:oNTF { \l__codedoc_index_key_tl } _
- {
- \__codedoc_key_pop:
- \__codedoc_key_pop:
- }
+ { q } { \tl_set:Nn \l__codedoc_index_module_tl { quark } }
+ { s } { \tl_set:Nn \l__codedoc_index_module_tl { quark } }
+ }
+ \__codedoc_key_pop:
+ \__codedoc_key_pop:
+ \__codedoc_key_drop_underscores:
+ \tl_if_empty:NT \l__codedoc_index_module_tl
+ {
+ \seq_set_split:NoV \l__codedoc_tmpa_seq
+ { \token_to_str:N _ } \l__codedoc_index_key_tl
+ \tl_set:Nx \l__codedoc_index_module_tl
{
- \__codedoc_key_pop:
- \__codedoc_key_pop:
- \tl_if_head_eq_charcode:oNT { \l__codedoc_index_key_tl } _
- { \__codedoc_key_pop: }
+ \int_case:nnF { \seq_count:N \l__codedoc_tmpa_seq }
+ {
+ { 0 } { }
+ { 1 } { int }
+ { 2 } { \seq_item:Nn \l__codedoc_tmpa_seq { 2 } }
+ }
+ { \seq_item:Nn \l__codedoc_tmpa_seq { 1 } }
}
}
}
- \__codedoc_key_get_module:
- }
-\cs_new_protected_nopar:Npn \__codedoc_key_get_module:
- {
- \tl_set_eq:NN \l__codedoc_index_module_tl \l__codedoc_index_key_tl
- \exp_args:No \__codedoc_key_get_module_aux:n { \token_to_str:N : }
- \exp_args:No \__codedoc_key_get_module_aux:n { \token_to_str:N _ }
- }
-\cs_new_protected:Npn \__codedoc_key_get_module_aux:n #1
- {
- \cs_set:Npn \__codedoc_tmpa:w ##1 #1 ##2 \q_stop { \exp_not:n {##1} }
- \tl_set:Nx \l__codedoc_index_module_tl
- { \exp_after:wN \__codedoc_tmpa:w \l__codedoc_index_module_tl #1 \q_stop }
+ {
+ \tl_set_eq:NN \l__codedoc_index_module_tl \l__codedoc_index_key_tl
+ \exp_args:No \__codedoc_key_trim_module:n { \token_to_str:N _ }
+ }
}
\GlossaryPrologue
{