Debian Codegraph @

texmf-dist/doc/latex/fewerfloatpages/l3doc-TUB.cls

raw
1 %%
2 %% This is file `l3doc-TUB.cls'
3 %%
4 %% The original source files were:
5 %%
6 %% l3doc.dtx (with options: `class') + several manual changes!
7 %%
8 %% Copyright (C) 1990-2018 The LaTeX3 Project
9 %%
10 %% It may be distributed and/or modified under the conditions of
11 %% the LaTeX Project Public License (LPPL), either version 1.3c of
12 %% this license or (at your option) any later version. The latest
13 %% version of this license is in the file:
14 %%
15 %% https://www.latex-project.org/lppl.txt
16 %%
17 %% File: l3doc.dtx Copyright (C) 1990-2018 The LaTeX3 project
18 %%
19 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20 %%
21 %% This is really a temporary file intended for a single article
22 %% written for TugBoat It is a copy of l3doc.cls with a couple of
23 %% changes, nothing more. Eventually this will get replaced by a real
24 %% class once l3doc.cls gets properly split into a class part and a
25 %% support part.
26 %%
27 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
28 %%
29 %% If you use this for anything other than processing the documents it
30 %% was meant for (which so far is 2) you are on your own :-)
31 %%
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
33
34 \RequirePackage{expl3,xparse,calc}
35 \ProvidesExplClass{l3doc-TUB}{2021/03/02}{}
36 {L3 Experimental documentation class (special version for TUGboat with fixes)}
37 \clist_new:N \g_docinput_clist
38 \seq_new:N \g_doc_functions_seq
39 \seq_new:N \g_doc_macros_seq
40 \bool_new:N \l__codedoc_detect_internals_bool
41 \bool_set_true:N \l__codedoc_detect_internals_bool
42 \tl_new:N \l__codedoc_detect_internals_tl
43 \tl_new:N \l__codedoc_detect_internals_cs_tl
44 \coffin_new:N \l__codedoc_output_coffin
45 \coffin_new:N \l__codedoc_functions_coffin
46 \coffin_new:N \l__codedoc_descr_coffin
47 \coffin_new:N \l__codedoc_syntax_coffin
48 \box_new:N \g__codedoc_syntax_box
49 \bool_new:N \l__codedoc_in_function_bool
50 \bool_new:N \l__codedoc_long_name_bool
51 \dim_new:N \l__codedoc_trial_width_dim
52 \int_new:N \l__codedoc_nested_macro_int
53 \bool_new:N \l__codedoc_macro_tested_bool
54 \prop_new:N \g__codedoc_missing_tests_prop
55 \seq_new:N \g__codedoc_not_tested_seq
56 \seq_new:N \g__codedoc_testfiles_seq
57 \bool_new:N \l__codedoc_macro_internal_set_bool
58 \bool_new:N \l__codedoc_macro_internal_bool
59 \bool_new:N \l__codedoc_macro_TF_bool
60 \bool_new:N \l__codedoc_macro_pTF_bool
61 \bool_new:N \l__codedoc_macro_noTF_bool
62 \bool_new:N \l__codedoc_macro_EXP_bool
63 \bool_new:N \l__codedoc_macro_rEXP_bool
64 \bool_new:N \l__codedoc_macro_var_bool
65 \tl_new:N \l__codedoc_override_module_tl
66 \tl_set:Nn \l__codedoc_override_module_tl { \q_no_value }
67 \tl_new:N \l__codedoc_macro_documented_tl
68 \bool_new:N \g__codedoc_lmodern_bool
69 \bool_new:N \g__codedoc_checkfunc_bool
70 \bool_new:N \g__codedoc_checktest_bool
71 \bool_new:N \g__codedoc_kernel_bool
72 \tl_new:N \l__codedoc_tmpa_tl
73 \tl_new:N \l__codedoc_tmpb_tl
74 \int_new:N \l__codedoc_tmpa_int
75 \int_new:N \l__codedoc_tmpa_seq
76 \tl_new:N \l__codedoc_names_block_tl
77 \seq_new:N \g__codedoc_variants_seq
78 \bool_new:N \l__codedoc_names_verb_bool
79 \seq_new:N \l__codedoc_names_seq
80 \seq_new:N \g__codedoc_nested_names_seq
81 \tl_const:Nx \c__codedoc_backslash_tl { \iow_char:N \\ }
82 \exp_last_unbraced:NNo
83 \cs_new_eq:NN \c__codedoc_backslash_token { \c__codedoc_backslash_tl }
84 \tl_new:N \l__codedoc_index_macro_tl
85 \tl_new:N \l__codedoc_index_key_tl
86 \tl_new:N \l__codedoc_index_module_tl
87 \bool_new:N \l__codedoc_index_internal_bool
88 \tl_new:N \g__codedoc_module_name_tl
89 \tl_const:Nn \c__codedoc_iow_rule_tl
90 { ======================================== }
91 \tl_const:Nn \c__codedoc_iow_mid_rule_tl
92 { -------------------------------------- }
93 \box_new:N \l__codedoc_macro_box
94 \box_new:N \l__codedoc_macro_index_box
95 \int_new:N \l__codedoc_macro_int
96 \tl_new:N \l__codedoc_cmd_tl
97 \tl_new:N \l__codedoc_cmd_index_tl
98 \tl_new:N \l__codedoc_cmd_module_tl
99 \bool_new:N \l__codedoc_cmd_noindex_bool
100 \bool_new:N \l__codedoc_cmd_replace_bool
101 \bool_new:N \l__codedoc_in_implementation_bool
102 \bool_new:N \g__codedoc_typeset_documentation_bool
103 \bool_new:N \g__codedoc_typeset_implementation_bool
104 \bool_set_true:N \g__codedoc_typeset_documentation_bool
105 \bool_set_true:N \g__codedoc_typeset_implementation_bool
106 \tl_new:N \g__codedoc_base_name_tl
107 \prop_new:N \l__codedoc_variants_prop
108 \clist_new:N \l__codedoc_function_label_clist
109 \bool_new:N \l__codedoc_no_label_bool
110 \tl_new:N \l__codedoc_date_added_tl
111 \tl_new:N \l__codedoc_date_updated_tl
112 \tl_new:N \l__codedoc_macro_argument_tl
113 \cs_new_eq:NN \__codedoc_tmpa:w ?
114 \cs_new_eq:NN \__codedoc_tmpb:w ?
115 \cs_generate_variant:Nn \seq_set_split:Nnn { NoV }
116 \cs_generate_variant:Nn \seq_gput_right:Nn { Nf }
117 \cs_generate_variant:Nn \str_case:nn { fn }
118 \cs_generate_variant:Nn \tl_count:n { f }
119 \cs_generate_variant:Nn \tl_greplace_all:Nnn { Nx , Nno }
120 \cs_generate_variant:Nn \tl_if_empty:nTF { f }
121 \cs_generate_variant:Nn \tl_if_head_eq_charcode:nNTF { o }
122 \cs_generate_variant:Nn \tl_if_head_eq_charcode:nNT { o }
123 \cs_generate_variant:Nn \tl_if_head_eq_charcode:nNF { o }
124 \cs_generate_variant:Nn \tl_if_head_eq_meaning:nNF { V }
125 \cs_generate_variant:Nn \tl_if_in:nnTF { no , oo }
126 \cs_generate_variant:Nn \tl_if_in:NnTF { No }
127 \cs_generate_variant:Nn \tl_if_in:NnT { No }
128 \cs_generate_variant:Nn \tl_if_in:NnF { No }
129 \cs_generate_variant:Nn \tl_remove_all:Nn { Nx }
130 \cs_generate_variant:Nn \tl_replace_all:Nnn { Nx , Nnx, No , Nno }
131 \cs_generate_variant:Nn \tl_replace_once:Nnn { Noo }
132 \cs_generate_variant:Nn \tl_to_str:n { f , o }
133 \cs_generate_variant:Nn \prop_get:NnNTF { Nx }
134 \cs_generate_variant:Nn \prop_put:Nnn { Nx }
135 \cs_generate_variant:Nn \prop_gput:Nnn { NVx }
136 \prg_new_protected_conditional:Npnn \__codedoc_if_almost_str:n #1 { TF , T , F }
137 {
138 \int_compare:nNnTF
139 { \tl_count:n {#1} }
140 < { \tl_count:f { \tl_to_str:f {#1} } }
141 { \prg_return_false: }
142 { \prg_return_true: }
143 }
144 \cs_generate_variant:Nn \__codedoc_if_almost_str:nT { V }
145 \cs_new_protected:Npn \__codedoc_trim_right:Nn #1#2
146 {
147 \cs_set:Npn \__codedoc_tmp:w ##1 #2 ##2 \q_stop { \exp_not:n {##1} }
148 \tl_set:Nx #1 { \exp_after:wN \__codedoc_tmp:w #1 #2 \q_stop }
149 }
150 \cs_generate_variant:Nn \__codedoc_trim_right:Nn { No }
151 \prg_new_protected_conditional:Npnn \__codedoc_str_if_begin:nn #1#2 { TF , T , F }
152 {
153 \tl_if_in:ooTF
154 { \exp_after:wN \scan_stop: \tl_to_str:n {#1} }
155 { \exp_after:wN \scan_stop: \tl_to_str:n {#2} }
156 { \prg_return_true: }
157 { \prg_return_false: }
158 }
159 \prg_generate_conditional_variant:Nnn \__codedoc_str_if_begin:nn
160 { oo } { TF , T , F }
161 \cs_new_protected:Npn \__codedoc_replace_at_at:N #1
162 {
163 \bool_if:NT \l__codedoc_in_implementation_bool
164 {
165 \bool_if:NT \l__codedoc_detect_internals_bool
166 { \__codedoc_detect_internals:N #1 }
167 }
168 \tl_if_empty:NF \g__codedoc_module_name_tl
169 {
170 \exp_args:NNo \__codedoc_replace_at_at_aux:Nn
171 #1 \g__codedoc_module_name_tl
172 }
173 }
174 \cs_new_protected:Npx \__codedoc_replace_at_at_aux:Nn #1#2
175 {
176 \tl_replace_all:Nnn #1 { \token_to_str:N @ } { @ }
177 \tl_replace_all:Nnn #1 { \token_to_str:N _ } { _ }
178 \tl_replace_all:Nnn #1 { @ @ @ @ } { \token_to_str:N a a }
179 \tl_replace_all:Nnn #1 { _ _ @ @ } { _ _ #2 }
180 \tl_replace_all:Nnn #1 { _ @ @ } { _ _ #2 }
181 \tl_replace_all:Nnn #1 { @ @ } { _ _ #2 }
182 \tl_replace_all:Nnn #1 { \token_to_str:N a a } { @ @ }
183 }
184 \group_begin:
185 \char_set_catcode_active:N \^^M
186 \cs_new_protected:Npn \__codedoc_detect_internals:N #1
187 {
188 \tl_set_eq:NN \l__codedoc_detect_internals_tl #1
189 \tl_replace_all:Non \l__codedoc_detect_internals_tl { \token_to_str:N _ } { _ }
190 \seq_set_split:NnV \l__codedoc_tmpa_seq { _ _ } \l__codedoc_detect_internals_tl
191 \seq_pop_left:NN \l__codedoc_tmpa_seq \l__codedoc_detect_internals_tl
192 \seq_map_variable:NNn \l__codedoc_tmpa_seq \l__codedoc_detect_internals_tl
193 {
194 \__codedoc_trim_right:No \l__codedoc_detect_internals_tl
195 \c_catcode_active_space_tl
196 \__codedoc_trim_right:Nn \l__codedoc_detect_internals_tl ^^M
197 \__codedoc_if_detect_internals_ok:NF \l__codedoc_detect_internals_tl
198 {
199 \tl_set_eq:NN \l__codedoc_detect_internals_cs_tl \l__codedoc_detect_internals_tl
200 \__codedoc_trim_right:Nn \l__codedoc_detect_internals_tl _
201 \__codedoc_trim_right:Nn \l__codedoc_detect_internals_tl :
202 \__codedoc_trim_right:No \l__codedoc_detect_internals_tl { \token_to_str:N : }
203 \msg_warning:nnxxx { l3doc-TUB } { foreign-internal }
204 { \tl_to_str:N \l__codedoc_detect_internals_cs_tl }
205 { \tl_to_str:N \l__codedoc_detect_internals_tl }
206 { \tl_to_str:N \g__codedoc_module_name_tl }
207 }
208 }
209 }
210 \group_end:
211 \prg_new_protected_conditional:Npnn \__codedoc_if_detect_internals_ok:N #1 { F }
212 {
213 \__codedoc_str_if_begin:ooTF {#1} { \g__codedoc_module_name_tl _ }
214 { \prg_return_true: }
215 {
216 \__codedoc_str_if_begin:ooTF {#1} { \g__codedoc_module_name_tl : }
217 { \prg_return_true: }
218 {
219 \bool_if:NTF \g__codedoc_kernel_bool
220 {
221 \__codedoc_str_if_begin:ooTF {#1} { kernel _ }
222 { \prg_return_true: }
223 { \prg_return_false: }
224 }
225 { \prg_return_false: }
226 }
227 }
228 }
229 \cs_new:Npn \__codedoc_signature_base_form:n #1
230 { \__codedoc_signature_base_form_aux:n #1 \q_stop }
231 \cs_new:Npn \__codedoc_signature_base_form_aux:n #1
232 {
233 \str_case:nnTF {#1}
234 {
235 { N } { N }
236 { c } { N }
237 { n } { n }
238 { o } { n }
239 { f } { n }
240 { x } { n }
241 { V } { n }
242 { v } { n }
243 }
244 { \__codedoc_signature_base_form_aux:n }
245 { \__codedoc_signature_base_form_aux:w #1 }
246 }
247 \cs_new:Npn \__codedoc_signature_base_form_aux:w #1 \q_stop
248 { \exp_not:n {#1} }
249 \cs_new:Npn \__codedoc_predicate_from_base:n #1
250 {
251 \__codedoc_get_function_name:n {#1}
252 \tl_to_str:n { _p: }
253 \__codedoc_get_function_signature:n {#1}
254 }
255 \cs_new:Npn \__codedoc_get_function_name:n #1
256 { \__codedoc_split_function_do:nn {#1} { \use_i:nnn } }
257 \cs_new:Npn \__codedoc_get_function_signature:n #1
258 { \__codedoc_split_function_do:nn {#1} { \use_ii:nnn } }
259 \cs_set_protected:Npn \__codedoc_tmpa:w #1
260 {
261 \cs_new:Npn \__codedoc_split_function_do:nn ##1
262 {
263 \exp_after:wN \__codedoc_split_function_auxi:w
264 \tl_to_str:n {##1} \q_mark \c_true_bool
265 #1 \q_mark \c_false_bool
266 \q_stop
267 }
268 \cs_new:Npn \__codedoc_split_function_auxi:w
269 ##1 #1 ##2 \q_mark ##3##4 \q_stop ##5
270 { \__codedoc_split_function_auxii:w {##5} ##1 \q_mark \q_stop {##2} ##3 }
271 \cs_new:Npn \__codedoc_split_function_auxii:w
272 ##1##2 \q_mark ##3 \q_stop
273 { ##1 {##2} }
274 }
275 \exp_args:No \__codedoc_tmpa:w { \token_to_str:N : }
276 \cs_generate_variant:Nn \__codedoc_split_function_do:nn { o }
277 \cs_new_protected:Npn \__codedoc_key_get_base:nN #1#2
278 {
279 \__codedoc_if_almost_str:nTF {#1}
280 {
281 \__codedoc_key_get_base_TF:nN {#1} \l__codedoc_tmpa_tl
282 \tl_set:Nx #2
283 { \__codedoc_split_function_do:on \l__codedoc_tmpa_tl { \__codedoc_base_form_aux:nnN } }
284 }
285 { \tl_set:Nn #2 {#1} }
286 }
287 \cs_new:Npx \__codedoc_key_get_base_TF:nN #1#2
288 {
289 \tl_set:Nx #2 { \exp_not:N \tl_to_str:n {#1} \scan_stop: }
290 \tl_if_in:NnTF #2 { \tl_to_str:n { F } \scan_stop: }
291 {
292 \tl_if_in:NnF #2 { \tl_to_str:n { TF } \scan_stop: }
293 {
294 \tl_replace_once:Nnn #2
295 { \tl_to_str:n { F } \scan_stop: }
296 { \tl_to_str:n { TF } \scan_stop: }
297 }
298 }
299 {
300 \tl_replace_once:Nnn #2
301 { \tl_to_str:n { T } \scan_stop: }
302 { \tl_to_str:n { TF } \scan_stop: }
303 }
304 \tl_remove_once:Nn #2 { \scan_stop: }
305 }
306 \cs_new:Npn \__codedoc_base_form_aux:nnN #1#2#3
307 {
308 \exp_not:n {#1}
309 \bool_if:NT #3
310 {
311 \token_to_str:N :
312 \str_if_eq:nnTF { #1 ~ } { \exp_args }
313 { \exp_not:n {#2} }
314 { \__codedoc_signature_base_form:n {#2} }
315 }
316 }
317 \cs_new_protected:Npn \__codedoc_base_form_signature_do:nnn #1#2#3
318 {
319 \__codedoc_split_function_do:nn {#1}
320 { \__codedoc_base_form_aux:nnnnnN {#1} {#2} {#3} }
321 }
322 \cs_new_protected:Npn \__codedoc_base_form_aux:nnnnnN #1#2#3#4#5#6
323 {
324 \bool_if:NTF #6
325 {
326 \tl_if_head_eq_charcode:nNTF {#4} :
327 { #2 {#1} }
328 {
329 \use:x
330 {
331 \exp_not:n {#3}
332 { \__codedoc_base_form_aux:nnN {#4} {#5} #6 }
333 }
334 {#4} {#5}
335 }
336 }
337 { #2 {#1} }
338 }
339 \prg_new_conditional:Npnn \__codedoc_date_compare:nNn #1#2#3 { TF , T , F , p }
340 { \__codedoc_date_compare_aux:w #1--- \q_mark #2 #3--- \q_stop }
341 \cs_new:Npn \__codedoc_date_compare_aux:w
342 #1 - #2 - #3 - #4 \q_mark #5 #6 - #7 - #8 - #9 \q_stop
343 {
344 \__codedoc_date_compare_aux:nnnNnnn
345 { \tl_if_empty:nTF {#1} { 0 } {#1} }
346 { \tl_if_empty:nTF {#2} { 0 } {#2} }
347 { \tl_if_empty:nTF {#3} { 0 } {#3} }
348 #5
349 { \tl_if_empty:nTF {#6} { 0 } {#6} }
350 { \tl_if_empty:nTF {#7} { 0 } {#7} }
351 { \tl_if_empty:nTF {#8} { 0 } {#8} }
352 }
353 \cs_new:Npn \__codedoc_date_compare_aux:nnnNnnn #1#2#3#4#5#6#7
354 {
355 \int_compare:nNnTF {#1} = {#5}
356 {
357 \int_compare:nNnTF {#2} = {#6}
358 {
359 \int_compare:nNnTF {#3} #4 {#7}
360 { \prg_return_true: } { \prg_return_false: }
361 }
362 {
363 \int_compare:nNnTF {#2} #4 {#6}
364 { \prg_return_true: } { \prg_return_false: }
365 }
366 }
367 {
368 \int_compare:nNnTF {#1} #4 {#5}
369 { \prg_return_true: } { \prg_return_false: }
370 }
371 \use_none:n
372 \q_stop
373 }
374 \cs_new:Npn \__codedoc_gprop_name:n #1 { g__codedoc ~ \tl_to_str:n {#1} }
375 \cs_new:Npn \__codedoc_lseq_name:n #1 { l__codedoc ~ \tl_to_str:n {#1} }
376 \msg_new:nnnn { l3doc-TUB } { no-signature-TF }
377 { Function/macro~'#1'~cannot~be~turned~into~a~conditional. }
378 {
379 A~function~or~macro~environment~with~option~pTF,~TF~or~noTF~
380 received~the~argument~'#1'.~This~function's~name~has~no~
381 ':'~hence~it~is~not~clear~where~to~add~'_p'~or~'TF'.~
382 Please~follow~expl3~naming~conventions.
383 }
384 \msg_new:nnn { l3doc-TUB } { deprecated-function }
385 { The~deprecated~function(s)~'#1'~should~have~been~removed~on~#2. }
386 \msg_new:nnn { l3doc-TUB } { date-format }
387 { The~date~'#1'~should~be~given~in~YYYY-MM-DD~format. }
388 \msg_new:nnn { l3doc-TUB } { syntax-nested-function }
389 {
390 The~'syntax'~environment~should~be~used~in~the~
391 innermost~'function'~environment.
392 }
393 \msg_new:nnn { l3doc-TUB } { multiple-syntax }
394 {
395 The~'syntax'~environment~should~only~be~used~once~in~
396 a~'function'~environment.
397 }
398 \msg_new:nnn { l3doc-TUB } { deprecated-option }
399 { The~option~'#1'~has~been~deprecated~for~'#2'. }
400 \msg_new:nnn { l3doc-TUB } { foreign-internal }
401 {
402 A~control~sequence~of~the~form~'...__#1'~was~used.~
403 It~should~only~be~used~in~the~module~'#2'
404 \tl_if_empty:nF {#3} { ,~not~in~'#3' } .
405 }
406 \DeclareOption { a5paper } { \@latexerr { Option~not~supported } { } }
407 \DeclareOption { full }
408 {
409 \bool_gset_true:N \g__codedoc_typeset_documentation_bool
410 \bool_gset_true:N \g__codedoc_typeset_implementation_bool
411 }
412 \DeclareOption { onlydoc }
413 {
414 \bool_gset_true:N \g__codedoc_typeset_documentation_bool
415 \bool_gset_false:N \g__codedoc_typeset_implementation_bool
416 }
417 \DeclareOption { check }
418 { \bool_gset_true:N \g__codedoc_checkfunc_bool }
419 \DeclareOption { nocheck }
420 { \bool_gset_false:N \g__codedoc_checkfunc_bool }
421 \DeclareOption { checktest }
422 { \bool_gset_true:N \g__codedoc_checktest_bool }
423 \DeclareOption { nochecktest }
424 { \bool_gset_false:N \g__codedoc_checktest_bool }
425 \DeclareOption { kernel }
426 { \bool_gset_true:N \g__codedoc_kernel_bool }
427 \DeclareOption { stdmodule }
428 { \bool_gset_false:N \g__codedoc_kernel_bool }
429 \DeclareOption { cm-default }
430 { \bool_gset_false:N \g__codedoc_lmodern_bool }
431 \DeclareOption { lm-default }
432 { \bool_gset_true:N \g__codedoc_lmodern_bool }
433 \DeclareOption* { \PassOptionsToClass { \CurrentOption } { ltugboat } }
434 \ExecuteOptions { full, kernel, nocheck, nochecktest, lm-default }
435 %%FMi \PassOptionsToClass { a4paper } { article }
436 \msg_new:nnn { l3doc-TUB } { input-cfg }
437 { Local~config~file~l3doc-TUB.cfg~loaded. }
438 \file_if_exist:nT { l3doc-TUB.cfg }
439 {
440 \file_input:nT { l3doc-TUB.cfg }
441 {
442 \cs_if_exist:cF { ExplMakeTitle }
443 { \msg_info:nn { l3doc-TUB } { input-cfg } }
444 }
445 }
446 \ProcessOptions
447 \LoadClass[final]{ltugboat}
448 \RequirePackage{doc}
449
450 \newcommand\bibname{References} % otherwise \bibname is undefined at \Finale
451 \TBtocsectionspace=0pt plus 1pt
452
453 \IndexPrologue
454 {\section*{Index}
455 \markboth{Index}{Index}
456 \addcontentsline{toc}{section}{Index}
457 \noindent
458 Underlined numbers point to the definition,
459 italicized numbers denote the pages where the
460 corresponding entry is described,
461 all others indicate the places where it is used.}
462 %\EnableCrossrefs
463 %\CodelineIndex
464
465 \RequirePackage
466 {
467 microtype,
468 array,
469 alphalph,
470 amsmath,
471 amssymb,
472 booktabs,
473 color,
474 colortbl,
475 hologo,
476 enumitem,
477 pifont,
478 textcomp,
479 trace,
480 underscore,
481 csquotes,
482 fancyvrb,
483 verbatim
484 }
485 \raggedbottom
486 \bool_if:NT \g__codedoc_lmodern_bool
487 {
488 \RequirePackage[T1]{fontenc}
489 \RequirePackage{lmodern}
490 \group_begin:
491 \ttfamily
492 \DeclareFontShape{T1}{lmtt}{m}{it}{<->ec-lmtto10}{}
493 \group_end:
494 }
495
496 \RequirePackage{hypdoc}
497
498 %%FMi:
499 \hypersetup{allcolors=black}
500
501 \cs_gset:Npn \MakePrivateLetters
502 {
503 \char_set_catcode_letter:N \@
504 \char_set_catcode_letter:N \_
505 \char_set_catcode_letter:N \:
506 }
507 \setcounter{StandardModuleDepth}{1}
508 \@addtoreset{CodelineNo}{part}
509 \tl_replace_once:Nnn \theCodelineNo
510 { \HDorg@theCodelineNo }
511 { \textcolor[gray]{0.5} { \sffamily\tiny\arabic{CodelineNo} } }
512 \fvset{gobble=2}
513 \cs_gset_eq:NN \verbatim \Verbatim
514 \cs_gset_eq:NN \endverbatim \endVerbatim
515 \cs_set_protected:Npn \ifnot@excluded
516 {
517 \exp_args:Nxx \expanded@notin
518 { \c__codedoc_backslash_tl \tl_to_str:N \macro@namepart , }
519 { \exp_args:NV \tl_to_str:n \index@excludelist }
520 }
521 \cs_new:Npn \pdfstringnewline { : ~ }
522 \DeclareExpandableDocumentCommand
523 { \__codedoc_pdfstring_newline:w } { s o m } { \pdfstringnewline #3 }
524 \pdfstringdefDisableCommands
525 { \cs_set_eq:NN \\ \__codedoc_pdfstring_newline:w }
526 \setlength \textwidth { 385pt }
527 \addtolength \marginparwidth { 30pt }
528 \addtolength \oddsidemargin { 20pt }
529 \addtolength \evensidemargin { 20pt }
530 \cs_new_eq:NN \__codedoc_oldlist:nn \list
531 \cs_gset:Npn \list #1 #2
532 { \__codedoc_oldlist:nn {#1} { #2 \dim_zero:N \listparindent } }
533 \setlength \parindent { 2em }
534 \setlength \itemindent { 0pt }
535 \setlength \parskip { 1pt plus 3pt minus 0pt }
536 \tl_gset:Nn \partname {File}
537 \@addtoreset{section}{part}
538 \cs_gset:Npn \l@section #1#2
539 {
540 \ifnum \c@tocdepth >\z@
541 \addpenalty\@secpenalty
542 \addvspace{\TBtocsectionspace}%
543 \setlength\@tempdima{2.5em} % was 1.5em
544 \begingroup
545 \parindent \z@ \rightskip \@pnumwidth
546 \parfillskip -\@pnumwidth
547 \leavevmode \TBtocsectionfont
548 \advance\leftskip\@tempdima
549 \hskip -\leftskip
550 #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
551 \endgroup
552 \fi
553 }
554 \cs_gset:Npn \l@subsection
555 { \@dottedtocline{2}{2.5em}{2.3em} } % #2 = 1.5em
556 \AtBeginDocument
557 {
558 \MakeShortVerb \"
559 \MakeShortVerb \|
560 \onecolumn
561 \SelfDocumenting
562 }
563 \AtEndDocument
564 {
565 \DeleteShortVerb \"
566 \DeleteShortVerb \|
567 }
568 \providecommand*\eTeX{\hologo{eTeX}}
569 \providecommand*\IniTeX{\hologo{iniTeX}}
570 \providecommand*\Lua{Lua}
571 \providecommand*\LuaTeX{\hologo{LuaTeX}}
572 \providecommand*\pdfTeX{\hologo{pdfTeX}}
573 \providecommand*\XeTeX{\hologo{XeTeX}}
574 \providecommand*\pTeX{p\kern-.2em\hologo{TeX}}
575 \providecommand*\upTeX{up\kern-.2em\hologo{TeX}}
576 \providecommand*\epTeX{$\varepsilon$-\pTeX}
577 \providecommand*\eupTeX{$\varepsilon$-\upTeX}
578 \DeclareDocumentCommand \cmd { O{} m }
579 { \__codedoc_cmd:no {#1} { \token_to_str:N #2 } }
580 \DeclareDocumentCommand \cs { O{} m }
581 { \__codedoc_cmd:no {#1} { \c__codedoc_backslash_tl #2 } }
582 \DeclareDocumentCommand \tn { O{} m }
583 {
584 \__codedoc_cmd:no
585 { module = TeX , replace = false , #1 }
586 { \c__codedoc_backslash_tl #2 }
587 }
588 \DeclareDocumentCommand \meta { m }
589 { \__codedoc_meta:n {#1} }
590 \DeclareExpandableDocumentCommand
591 { \__codedoc_pdfstring_cmd:w } { o m } { \token_to_str:N #2 }
592 \DeclareExpandableDocumentCommand
593 { \__codedoc_pdfstring_cs:w } { o m } { \textbackslash \tl_to_str:n {#2} }
594 \cs_new:Npn \__codedoc_pdfstring_meta:w #1
595 { < \tl_to_str:n {#1} > }
596 \pdfstringdefDisableCommands
597 {
598 \cs_set_eq:NN \cmd \__codedoc_pdfstring_cmd:w
599 \cs_set_eq:NN \cs \__codedoc_pdfstring_cs:w
600 \cs_set_eq:NN \tn \__codedoc_pdfstring_cs:w
601 \cs_set_eq:NN \meta \__codedoc_pdfstring_meta:w
602 }
603 \newcommand\Arg[1]
604 { \texttt{\char`\{} \meta{#1} \texttt{\char`\}} }
605 \providecommand\marg[1]{ \Arg{#1} }
606 \providecommand\oarg[1]{ \texttt[ \meta{#1} \texttt] }
607 \providecommand\parg[1]{ \texttt( \meta{#1} \texttt) }
608 \DeclareRobustCommand \file {\nolinkurl}
609 \DeclareRobustCommand \env {\texttt}
610 \DeclareRobustCommand \pkg {\textsf}
611 \DeclareRobustCommand \cls {\textsf}
612 \NewDocumentCommand \EnableDocumentation { }
613 { \bool_gset_true:N \g__codedoc_typeset_documentation_bool }
614 \NewDocumentCommand \EnableImplementation { }
615 { \bool_gset_true:N \g__codedoc_typeset_implementation_bool }
616 \NewDocumentCommand \DisableDocumentation { }
617 { \bool_gset_false:N \g__codedoc_typeset_documentation_bool }
618 \NewDocumentCommand \DisableImplementation { }
619 { \bool_gset_false:N \g__codedoc_typeset_implementation_bool }
620 \NewDocumentEnvironment { documentation } { }
621 {
622 \bool_if:NTF \g__codedoc_typeset_documentation_bool
623 { \bool_set_false:N \l__codedoc_in_implementation_bool }
624 { \comment }
625 }
626 { \bool_if:NF \g__codedoc_typeset_documentation_bool { \endcomment } }
627 \NewDocumentEnvironment { implementation } { }
628 {
629 \bool_if:NTF \g__codedoc_typeset_implementation_bool
630 { \bool_set_true:N \l__codedoc_in_implementation_bool }
631 { \comment }
632 }
633 { \bool_if:NF \g__codedoc_typeset_implementation_bool { \endcomment } }
634 \DeclareDocumentEnvironment { variable } { O{} +v }
635 {
636 \bool_if:NTF \l__codedoc_in_implementation_bool
637 { \__codedoc_macro:nnw { var , #1 } {#2} }
638 { \__codedoc_function:nnw {#1} {#2} }
639 }
640 {
641 \bool_if:NTF \l__codedoc_in_implementation_bool
642 { \__codedoc_macro_end: }
643 { \__codedoc_function_end: }
644 }
645 \DeclareDocumentEnvironment { function } { O{} +v }
646 { \__codedoc_function:nnw {#1} {#2} }
647 { \__codedoc_function_end: }
648 \DeclareDocumentEnvironment { macro } { O{} +v }
649 { \__codedoc_macro:nnw {#1} {#2} }
650 { \__codedoc_macro_end: }
651 \NewDocumentEnvironment { syntax } { }
652 { \__codedoc_syntax:w }
653 {
654 \__codedoc_syntax_end:
655 \ignorespacesafterend
656 }
657 \NewDocumentEnvironment { texnote } { }
658 {
659 \endgraf
660 \vspace{3mm}
661 \small\textbf{\TeX~hackers~note:}
662 }
663 {
664 \vspace{3mm}
665 }
666 \NewDocumentEnvironment { arguments } { }
667 {
668 \enumerate [
669 nolistsep ,
670 label = \texttt{\#\arabic*} ~ : ,
671 labelsep = * ,
672 ]
673 }
674 {
675 \endenumerate
676 }
677 \NewDocumentCommand { \CodedocExplain } { }
678 { \CodedocExplainEXP \ \CodedocExplainREXP \ \CodedocExplainTF }
679 \NewDocumentCommand { \CodedocExplainEXP } { }
680 {
681 \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{expstar}{}}%
682 \__codedoc_typeset_exp:\ indicates~fully~expandable~functions,~which~
683 can~be~used~within~an~\texttt{x}-type~argument~(in~plain~
684 \TeX{}~terms,~inside~an~\cs{edef}),~as~well~as~within~an~
685 \texttt{f}-type~argument.
686 }
687 \NewDocumentCommand { \CodedocExplainREXP } { }
688 {
689 \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{rexpstar}{}}%
690 \__codedoc_typeset_rexp:\ indicates~
691 restricted~expandable~functions,~which~can~be~used~within~an~
692 \texttt{x}-type~argument~but~cannot~be~fully~expanded~within~an~
693 \texttt{f}-type~argument.
694 }
695 \NewDocumentCommand { \CodedocExplainTF } { }
696 {
697 \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{explTF}{}}%
698 \__codedoc_typeset_TF:\ indicates~conditional~(\texttt{if})~functions~
699 whose~variants~with~\texttt{T},~\texttt{F}~and~\texttt{TF}~
700 argument~specifiers~expect~different~
701 \enquote{true}/\enquote{false}~branches.
702 }
703 \keys_define:nn { l3doc-TUB/cmd }
704 {
705 index .tl_set:N = \l__codedoc_cmd_index_tl ,
706 module .tl_set:N = \l__codedoc_cmd_module_tl ,
707 no-index .bool_set:N = \l__codedoc_cmd_noindex_bool ,
708 replace .bool_set:N = \l__codedoc_cmd_replace_bool ,
709 }
710 \cs_new_protected:Npn \__codedoc_cmd:nn #1#2
711 {
712 \bool_set_false:N \l__codedoc_cmd_noindex_bool
713 \bool_set_true:N \l__codedoc_cmd_replace_bool
714 \tl_set:Nn \l__codedoc_cmd_index_tl { \q_no_value }
715 \tl_set:Nn \l__codedoc_cmd_module_tl { \q_no_value }
716 \keys_set:nn { l3doc-TUB/cmd } {#1}
717 \tl_set:Nn \l__codedoc_cmd_tl {#2}
718 \bool_if:NT \l__codedoc_cmd_replace_bool
719 {
720 \tl_set_rescan:Nnn \l__codedoc_tmpb_tl { } { _ }
721 \tl_replace_all:Non \l__codedoc_cmd_tl \l__codedoc_tmpb_tl { _ }
722 \__codedoc_replace_at_at:N \l__codedoc_cmd_tl
723 \tl_replace_all:Nno \l__codedoc_cmd_tl { _ } \l__codedoc_tmpb_tl
724 }
725 \mode_if_math:T { \mbox }
726 {
727 \verbatim@font
728 \__codedoc_if_almost_str:VT \l__codedoc_cmd_tl
729 {
730 \tl_set:Nx \l__codedoc_cmd_tl { \tl_to_str:N \l__codedoc_cmd_tl }
731 \tl_replace_all:Non \l__codedoc_cmd_tl
732 { \token_to_str:N _ } { \_ }
733 }
734 \tl_replace_all:Nnn \l__codedoc_cmd_tl { ~ } { \@xobeysp }
735 \l__codedoc_cmd_tl
736 \@
737 }
738 \bool_if:NF \l__codedoc_cmd_noindex_bool
739 {
740 \quark_if_no_value:NF \l__codedoc_cmd_index_tl
741 {
742 \tl_set:Nx \l__codedoc_cmd_tl
743 { \c_backslash_str \exp_not:o { \l__codedoc_cmd_index_tl } }
744 }
745
746 \exp_args:No \__codedoc_key_get:n { \l__codedoc_cmd_tl }
747 \quark_if_no_value:NF \l__codedoc_cmd_module_tl
748 {
749 \tl_set:Nx \l__codedoc_index_module_tl
750 { \tl_to_str:N \l__codedoc_cmd_module_tl }
751 }
752 \__codedoc_special_index_module:ooonN
753 { \l__codedoc_index_key_tl }
754 { \l__codedoc_index_macro_tl }
755 { \l__codedoc_index_module_tl }
756 { usage }
757 \l__codedoc_index_internal_bool
758 }
759 }
760 \cs_generate_variant:Nn \__codedoc_cmd:nn { no }
761 \cs_new_protected:Npn \__codedoc_meta:n #1
762 {
763 \tl_set:Nn \l__codedoc_tmpa_tl {#1}
764 \tl_map_inline:nn
765 { { 3 } { 4 } { 7 } { 8 } { 11 } { 12 } { 13 } }
766 {
767 \tl_set_rescan:Nnn \l__codedoc_tmpb_tl
768 { \char_set_catcode:nn { `_ } {##1} } { _ }
769 \tl_replace_all:Non \l__codedoc_tmpa_tl \l__codedoc_tmpb_tl
770 { \__codedoc_ensuremath_sb:n }
771 }
772 \exp_args:NV \__codedoc_meta_original:n \l__codedoc_tmpa_tl
773 }
774 \cs_new_protected:Npn \__codedoc_ensuremath_sb:n #1
775 { \ensuremath { \sb {#1} } }
776 \cs_new_protected:Npn \__codedoc_meta_original:n #1
777 {
778 \ensuremath \langle
779 \mode_if_math:T { \nfss@text }
780 {
781 \meta@font@select
782 \edef \meta@hyphen@restore
783 { \hyphenchar \the \font \the \hyphenchar \font }
784 \hyphenchar \font \m@ne
785 \language \l@nohyphenation
786 #1 \/
787 \meta@hyphen@restore
788 }
789 \ensuremath \rangle
790 }
791 \cs_new_protected:Npn \__codedoc_typeset_exp:
792 { \hyperlink{expstar} {$\star$} }
793 \cs_new_protected:Npn \__codedoc_typeset_rexp:
794 { \hyperlink{rexpstar} {\ding{73}} } % hollow star
795 \cs_new_protected:Npn \__codedoc_typeset_TF:
796 {
797 \hyperlink{explTF}
798 {
799 \color{black}
800 \itshape TF
801 \makebox[0pt][r]
802 {
803 \color{red}
804 \underline { \phantom{\itshape TF} \kern-0.1em }
805 }
806 }
807 }
808 \cs_new_protected:Npn \__codedoc_typeset_aux:n #1
809 {
810 { \color[gray]{0.5} #1 }
811 }
812 \cs_new_protected:Npn \__codedoc_get_hyper_target:nN #1#2
813 {
814 \tl_set:Nx #2 { \tl_to_str:n {#1} }
815 \tl_replace_all:Nxn #2 { \iow_char:N \_ } { / }
816 \tl_remove_all:Nx #2 { \iow_char:N \\ }
817 \tl_put_left:Nn #2 { doc/function// }
818 }
819 \cs_generate_variant:Nn \__codedoc_get_hyper_target:nN { o , x }
820 \cs_new_protected:Npn \__codedoc_names_get_seq:nN #1#2
821 {
822 \tl_set:Nx \l__codedoc_tmpa_tl { \tl_to_str:n {#1} }
823 \bool_if:NTF \l__codedoc_names_verb_bool
824 {
825 \seq_clear:N #2
826 \seq_put_right:NV #2 \l__codedoc_tmpa_tl
827 }
828 {
829 \tl_remove_all:Nx \l__codedoc_tmpa_tl
830 { \iow_char:N \^^M \iow_char:N \% }
831 \tl_remove_all:Nx \l__codedoc_tmpa_tl { \tl_to_str:n { ^ ^ A } }
832 \tl_remove_all:Nx \l__codedoc_tmpa_tl { \iow_char:N \^^I }
833 \tl_remove_all:Nx \l__codedoc_tmpa_tl { \iow_char:N \^^M }
834 \__codedoc_replace_at_at:N \l__codedoc_tmpa_tl
835 \exp_args:NNx \seq_set_from_clist:Nn #2
836 { \tl_to_str:N \l__codedoc_tmpa_tl }
837 }
838 }
839 \cs_new_protected:Npn \__codedoc_names_parse:
840 {
841 \tl_clear:N \l__codedoc_names_block_tl
842 \seq_map_function:NN
843 \l__codedoc_names_seq
844 \__codedoc_names_parse_one:n
845 }
846 \cs_new_protected:Npn \__codedoc_names_parse_one:n #1
847 {
848 \__codedoc_split_function_do:nn {#1}
849 { \__codedoc_names_parse_one_aux:nnNn }
850 {#1}
851 }
852 \cs_new_protected:Npn \__codedoc_names_parse_one_aux:nnNn #1#2#3#4
853 {
854 \bool_if:NTF #3
855 {
856 \tl_if_head_eq_charcode:nNTF {#2} :
857 { \__codedoc_names_parse_aux:nnn {#4} {#4} { \scan_stop: } }
858 {
859 \exp_args:Nx \__codedoc_names_parse_aux:nnn
860 { \__codedoc_base_form_aux:nnN {#1} {#2} #3 }
861 {#1} {#2}
862 }
863 }
864 {
865 \bool_if:NT \l__codedoc_macro_TF_bool
866 { \msg_error:nnx { l3doc-TUB } { no-signature-TF } {#4} }
867 \__codedoc_names_parse_aux:nnn {#4} {#4} { \scan_stop: }
868 }
869 }
870 \cs_new_protected:Npn \__codedoc_names_parse_aux:nnn #1
871 { \exp_args:Nc \__codedoc_names_parse_aux:Nnn { \__codedoc_lseq_name:n {#1} } }
872 \cs_new_protected:Npn \__codedoc_names_parse_aux:Nnn #1#2#3
873 {
874 \tl_if_in:NnF \l__codedoc_names_block_tl {#1}
875 {
876 \tl_put_right:Nn \l__codedoc_names_block_tl {#1}
877 \seq_clear_new:N #1
878 \seq_put_right:Nn #1 {#2}
879 }
880 \seq_put_right:Nn #1 {#3}
881 }
882 \cs_new_protected:Npn \__codedoc_names_typeset:
883 {
884 \tl_map_function:NN \l__codedoc_names_block_tl
885 \__codedoc_names_typeset_auxi:n
886 }
887 \cs_new_protected:Npn \__codedoc_names_typeset_auxi:n #1
888 {
889 \seq_pop:NN #1 \l__codedoc_tmpa_tl
890 \tl_gset_eq:NN \g__codedoc_base_name_tl \l__codedoc_tmpa_tl
891 \tl_greplace_all:Nno \g__codedoc_base_name_tl
892 { ~ } { \c_catcode_other_space_tl }
893 \seq_get:NN #1 \l__codedoc_tmpa_tl
894 \str_if_eq:eeTF { \l__codedoc_tmpa_tl } { \scan_stop: }
895 {
896 \seq_gclear:N \g__codedoc_variants_seq
897 \__codedoc_names_typeset_auxii:x { \g__codedoc_base_name_tl }
898 }
899 {
900 \seq_gset_eq:NN \g__codedoc_variants_seq #1
901 \seq_gpop:NN \g__codedoc_variants_seq \l__codedoc_tmpb_tl
902 \__codedoc_names_typeset_auxii:x
903 { \g__codedoc_base_name_tl : \l__codedoc_tmpb_tl }
904 }
905 }
906 \cs_new_protected:Npn \__codedoc_names_typeset_auxii:n #1
907 {
908 \bool_if:NT \l__codedoc_macro_pTF_bool
909 {
910 \__codedoc_names_typeset_block:xN
911 { \__codedoc_predicate_from_base:n {#1} }
912 \c_false_bool
913 }
914 \bool_if:NT \l__codedoc_macro_noTF_bool
915 { \__codedoc_names_typeset_block:nN {#1} \c_false_bool }
916 \__codedoc_names_typeset_block:nN {#1} \l__codedoc_macro_TF_bool
917 }
918 \cs_generate_variant:Nn \__codedoc_names_typeset_auxii:n { x }
919 \cs_new_protected:Npn \__codedoc_names_typeset_block:nN
920 {
921 \int_compare:nNnTF \l__codedoc_nested_macro_int = 0
922 { \__codedoc_typeset_function_block:nN }
923 { \__codedoc_macro_typeset_block:nN }
924 }
925 \cs_generate_variant:Nn \__codedoc_names_typeset_block:nN { x }
926 \prg_new_conditional:Npnn \__codedoc_if_macro_internal:n #1 { p , T , F , TF }
927 {
928 \bool_if:NTF \l__codedoc_macro_internal_set_bool
929 {
930 \bool_if:NTF \l__codedoc_macro_internal_bool
931 { \prg_return_true: } { \prg_return_false: }
932 }
933 {
934 \tl_if_empty:fTF
935 {
936 \exp_after:wN \__codedoc_if_macro_internal_aux:w
937 \tl_to_str:n { #1 ~ __ }
938 }
939 { \prg_return_false: } { \prg_return_true: }
940 }
941 }
942 \exp_last_unbraced:NNNNo
943 \cs_new:Npn \__codedoc_if_macro_internal_aux:w #1 { \tl_to_str:n { __ } } { }
944 \cs_new_protected:Npn \__codedoc_names_block_base_map:N #1
945 {
946 \tl_map_inline:Nn \l__codedoc_names_block_tl
947 {
948 \group_begin:
949 \seq_set_eq:NN \l__codedoc_tmpa_seq ##1
950 \seq_pop:NN \l__codedoc_tmpa_seq \l__codedoc_tmpa_tl
951 \seq_get:NN \l__codedoc_tmpa_seq \l__codedoc_tmpb_tl
952 \exp_args:NNx
953 \group_end:
954 #1
955 {
956 \l__codedoc_tmpa_tl
957 \str_if_eq:eeF { \l__codedoc_tmpb_tl } { \scan_stop: }
958 { : \l__codedoc_tmpb_tl }
959 \bool_if:NT \l__codedoc_macro_TF_bool { TF }
960 }
961 }
962 }
963 \keys_define:nn { l3doc-TUB/function }
964 {
965 TF .value_forbidden:n = true ,
966 TF .code:n =
967 {
968 \bool_set_true:N \l__codedoc_macro_TF_bool
969 } ,
970 EXP .value_forbidden:n = true ,
971 EXP .code:n =
972 {
973 \bool_set_true:N \l__codedoc_macro_EXP_bool
974 \bool_set_false:N \l__codedoc_macro_rEXP_bool
975 } ,
976 rEXP .value_forbidden:n = true ,
977 rEXP .code:n =
978 {
979 \bool_set_false:N \l__codedoc_macro_EXP_bool
980 \bool_set_true:N \l__codedoc_macro_rEXP_bool
981 } ,
982 pTF .value_forbidden:n = true ,
983 pTF .code:n =
984 {
985 \bool_set_true:N \l__codedoc_macro_pTF_bool
986 \bool_set_true:N \l__codedoc_macro_TF_bool
987 \bool_set_true:N \l__codedoc_macro_EXP_bool
988 \bool_set_false:N \l__codedoc_macro_rEXP_bool
989 } ,
990 noTF .value_forbidden:n = true ,
991 noTF .code:n =
992 {
993 \bool_set_true:N \l__codedoc_macro_noTF_bool
994 \bool_set_true:N \l__codedoc_macro_TF_bool
995 } ,
996 added .code:n = { \__codedoc_date_set:Nn \l__codedoc_date_added_tl {#1} },
997 updated .code:n = { \__codedoc_date_set:Nn \l__codedoc_date_updated_tl {#1} } ,
998 deprecated .code:n = { \__codedoc_deprecated_on:n {#1} } ,
999 tested .code:n = { } ,
1000 label .code:n =
1001 {
1002 \clist_set:Nn \l__codedoc_function_label_clist {#1}
1003 \bool_set_true:N \l__codedoc_no_label_bool
1004 } ,
1005 verb .value_forbidden:n = true ,
1006 verb .bool_set:N = \l__codedoc_names_verb_bool ,
1007 module .tl_set:N = \l__codedoc_override_module_tl ,
1008 }
1009 \cs_new_protected:Npn \__codedoc_date_set:Nn #1#2
1010 {
1011 \tl_set:Nn #1 {#2}
1012 \regex_replace_once:nnNF
1013 { \A(\d\d\d\d)[-/](\d\d?)[-/](\d\d?)\Z } { \1-\2-\3 } #1
1014 {
1015 \msg_error:nnn { l3doc-TUB } { date-format } {#2}
1016 \tl_set:Nn #1 { 1970-01-01 }
1017 }
1018 }
1019 \cs_new_protected:Npn \__codedoc_deprecated_on:n #1
1020 {
1021 \__codedoc_date_set:Nn \l__codedoc_tmpa_tl {#1}
1022 \exp_args:No \__codedoc_date_compare:nNnT
1023 { \l__codedoc_tmpa_tl } < { \tex_year:D - \tex_month:D - \tex_day:D }
1024 {
1025 \msg_error:nnxx { l3doc-TUB } { deprecated-function }
1026 { \tl_to_str:N \l__codedoc_macro_argument_tl }
1027 { \l__codedoc_tmpa_tl }
1028 }
1029 \bool_set_true:N \l__codedoc_macro_internal_bool
1030 \bool_set_true:N \l__codedoc_macro_internal_set_bool
1031 }
1032 \cs_new_protected:Npn \__codedoc_function:nnw #1#2
1033 {
1034 \__codedoc_function_typeset_start:
1035 \__codedoc_function_init:
1036 \tl_set:Nn \l__codedoc_macro_argument_tl {#2}
1037 \keys_set:nn { l3doc-TUB/function } {#1}
1038 \__codedoc_names_get_seq:nN {#2} \l__codedoc_names_seq
1039 \__codedoc_names_parse:
1040 \__codedoc_function_typeset:
1041 \__codedoc_function_reset:
1042 \__codedoc_function_descr_start:w
1043 }
1044 \cs_new_protected:Npn \__codedoc_function_end:
1045 {
1046 \__codedoc_function_descr_stop:
1047 \__codedoc_function_assemble:
1048 \__codedoc_function_typeset_stop:
1049 }
1050 \cs_new_protected:Npn \__codedoc_function_typeset_start:
1051 {
1052 \par \bigskip \noindent
1053 }
1054 \cs_new_protected:Npn \__codedoc_function_typeset_stop:
1055 {
1056 \par
1057 \allowbreak
1058 }
1059 \cs_new_protected:Npn \__codedoc_function_init:
1060 {
1061 \box_if_empty:NF \g__codedoc_syntax_box
1062 { \msg_error:nn { l3doc-TUB } { syntax-nested-function } }
1063 \coffin_clear:N \l__codedoc_descr_coffin
1064 \box_gclear:N \g__codedoc_syntax_box
1065 \coffin_clear:N \l__codedoc_syntax_coffin
1066 \coffin_clear:N \l__codedoc_functions_coffin
1067 \bool_set_false:N \l__codedoc_macro_TF_bool
1068 \bool_set_false:N \l__codedoc_macro_pTF_bool
1069 \bool_set_false:N \l__codedoc_macro_noTF_bool
1070 \bool_set_false:N \l__codedoc_macro_EXP_bool
1071 \bool_set_false:N \l__codedoc_macro_rEXP_bool
1072 \bool_set_false:N \l__codedoc_no_label_bool
1073 \bool_set_false:N \l__codedoc_names_verb_bool
1074 \bool_set_true:N \l__codedoc_in_function_bool
1075 \clist_clear:N \l__codedoc_function_label_clist
1076 \tl_set:Nn \l__codedoc_override_module_tl { \q_no_value }
1077 \char_set_active_eq:NN \< \__codedoc_shorthand_meta:
1078 \char_set_catcode_active:N \<
1079 }
1080 \cs_new_protected:Npn \__codedoc_shorthand_meta:
1081 { \mode_if_math:TF { < } { \__codedoc_shorthand_meta:w } }
1082 \cs_new_protected_nopar:Npn \__codedoc_shorthand_meta:w #1 > { \meta {#1} }
1083 \cs_new_protected:Npn \__codedoc_function_reset:
1084 {
1085 \tl_set:Nn \l__codedoc_override_module_tl { \q_no_value }
1086 }
1087 \cs_new_protected:Npn \__codedoc_function_typeset:
1088 {
1089 \dim_zero:N \l__codedoc_trial_width_dim
1090 \hcoffin_set:Nn \l__codedoc_functions_coffin { \__codedoc_typeset_functions: }
1091 \dim_set:Nn \l__codedoc_trial_width_dim
1092 { \box_wd:N \l__codedoc_functions_coffin }
1093 \bool_set:Nn \l__codedoc_long_name_bool
1094 { \dim_compare_p:nNn \l__codedoc_trial_width_dim > {\marginparwidth + 1cm} } % FMi crude fix
1095 }
1096 \cs_new_protected:Npn \__codedoc_function_descr_start:w
1097 {
1098 \vcoffin_set:Nnw \l__codedoc_descr_coffin { \textwidth }
1099 \noindent \ignorespaces
1100 }
1101 \cs_new_protected:Npn \__codedoc_function_descr_stop:
1102 { \vcoffin_set_end: }
1103 \cs_new_protected:Npn \__codedoc_function_assemble:
1104 {
1105 \hcoffin_set:Nn \l__codedoc_syntax_coffin
1106 { \box_use_drop:N \g__codedoc_syntax_box }
1107 \bool_if:NTF \l__codedoc_long_name_bool
1108 {
1109 \coffin_join:NnnNnnnn
1110 \l__codedoc_output_coffin {hc} {vc}
1111 \l__codedoc_syntax_coffin {l} {T}
1112 {0pt} {0pt}
1113 \coffin_join:NnnNnnnn
1114 \l__codedoc_output_coffin {l} {t}
1115 \l__codedoc_functions_coffin {r} {t}
1116 {-\marginparsep} {0pt}
1117 \coffin_join:NnnNnnnn
1118 \l__codedoc_output_coffin {l} {b}
1119 \l__codedoc_descr_coffin {l} {t}
1120 {0.75\marginparwidth + \marginparsep} {-\medskipamount}
1121 \coffin_typeset:Nnnnn \l__codedoc_output_coffin
1122 {\l__codedoc_descr_coffin-l} {\l__codedoc_descr_coffin-t}
1123 {0pt} {0pt}
1124 }
1125 {
1126 \coffin_join:NnnNnnnn
1127 \l__codedoc_output_coffin {hc} {vc}
1128 \l__codedoc_syntax_coffin {l} {t}
1129 {0pt} {0pt}
1130 \coffin_join:NnnNnnnn
1131 \l__codedoc_output_coffin {l} {b}
1132 \l__codedoc_descr_coffin {l} {t}
1133 {0pt} {-\medskipamount}
1134 \coffin_join:NnnNnnnn
1135 \l__codedoc_output_coffin {l} {t}
1136 \l__codedoc_functions_coffin {r} {t}
1137 {-\marginparsep} {0pt}
1138 \coffin_typeset:Nnnnn \l__codedoc_output_coffin
1139 {\l__codedoc_syntax_coffin-l} {\l__codedoc_syntax_coffin-T}
1140 {0pt} {0pt}
1141 }
1142 }
1143 \cs_new_protected:Npn \__codedoc_typeset_functions:
1144 {
1145 \small\ttfamily
1146 \HD@savedestfalse
1147 \HD@target
1148 \Hy@MakeCurrentHref { HD. \int_use:N \c@HD@hypercount }
1149 \begin{tabular} [t] { @{} l @{} >{\hspace{\tabcolsep}} r @{} }
1150 \toprule
1151 \__codedoc_function_extra_labels:
1152 \__codedoc_names_typeset:
1153 \__codedoc_typeset_dates:
1154 \bottomrule
1155 \end{tabular}
1156 \normalfont\normalsize
1157 }
1158 \cs_new_protected:Npn \__codedoc_typeset_function_block:nN #1#2
1159 {
1160 \__codedoc_function_index:x
1161 { #1 \bool_if:NT #2 { \tl_to_str:n {TF} } }
1162 \__codedoc_function_label:xN {#1} #2
1163 #1
1164 \bool_if:NT #2 { \__codedoc_typeset_TF: }
1165 \__codedoc_typeset_expandability:
1166 \seq_if_empty:NF \g__codedoc_variants_seq
1167 { \__codedoc_typeset_variant_list:nN {#1} #2 }
1168 \\
1169 }
1170 \cs_generate_variant:Nn \__codedoc_typeset_function_block:nN { x }
1171 \cs_new_protected:Npn \__codedoc_function_index:n #1
1172 {
1173 \seq_gput_right:Nn \g_doc_functions_seq {#1}
1174 \__codedoc_special_index:nn {#1} { usage }
1175 }
1176 \cs_generate_variant:Nn \__codedoc_function_index:n { x }
1177 \cs_new_protected:Npn \__codedoc_typeset_expandability:
1178 {
1179 &
1180 \bool_if:NT \l__codedoc_macro_EXP_bool { \__codedoc_typeset_exp: }
1181 \bool_if:NT \l__codedoc_macro_rEXP_bool { \__codedoc_typeset_rexp: }
1182 }
1183 \cs_new_protected:Npn \__codedoc_typeset_variant_list:nN #1#2
1184 {
1185 \\
1186 \__codedoc_typeset_aux:n { \__codedoc_get_function_name:n {#1} }
1187 :
1188 \int_compare:nTF { \seq_count:N \g__codedoc_variants_seq == 1 }
1189 { \seq_use:Nn \g__codedoc_variants_seq { } }
1190 {
1191 \textrm(
1192 \seq_use:Nn \g__codedoc_variants_seq { \textrm| }
1193 \textrm)
1194 }
1195 \bool_if:NT #2 { \__codedoc_typeset_TF: }
1196 \__codedoc_typeset_expandability:
1197 }
1198 \cs_new_protected:Npn \__codedoc_function_extra_labels:
1199 {
1200 \bool_if:NT \l__codedoc_no_label_bool
1201 {
1202 \clist_map_inline:Nn \l__codedoc_function_label_clist
1203 {
1204 \__codedoc_get_hyper_target:oN { \token_to_str:N ##1 }
1205 \l__codedoc_tmpa_tl
1206 \exp_args:No \label { \l__codedoc_tmpa_tl }
1207 }
1208 }
1209 }
1210 \cs_new_protected:Npn \__codedoc_function_label:nN #1#2
1211 {
1212 \bool_if:NF \l__codedoc_no_label_bool
1213 {
1214 \__codedoc_get_hyper_target:xN
1215 {
1216 \exp_not:n {#1}
1217 \bool_if:NT #2 { \tl_to_str:n {TF} }
1218 }
1219 \l__codedoc_tmpa_tl
1220 \exp_args:No \label { \l__codedoc_tmpa_tl }
1221 }
1222 }
1223 \cs_generate_variant:Nn \__codedoc_function_label:nN { x }
1224 \cs_new:Npn \__codedoc_typeset_dates:
1225 {
1226 \bool_lazy_and:nnF
1227 { \tl_if_empty_p:N \l__codedoc_date_added_tl }
1228 { \tl_if_empty_p:N \l__codedoc_date_updated_tl }
1229 { \midrule }
1230 \tl_if_empty:NF \l__codedoc_date_added_tl
1231 {
1232 \multicolumn { 2 } { @{} r @{} }
1233 { \scriptsize New: \, \l__codedoc_date_added_tl } \\
1234 }
1235
1236 \tl_if_empty:NF \l__codedoc_date_updated_tl
1237 {
1238 \multicolumn { 2 } { @{} r @{} }
1239 { \scriptsize Updated: \, \l__codedoc_date_updated_tl } \\
1240 }
1241 }
1242 \dim_new:N \l__codedoc_syntax_dim
1243 \cs_new_protected:Npn \__codedoc_syntax:w
1244 {
1245 \box_if_empty:NF \g__codedoc_syntax_box
1246 { \msg_error:nn { l3doc-TUB } { multiple-syntax } }
1247 \dim_set:Nn \l__codedoc_syntax_dim
1248 {
1249 \textwidth
1250 \bool_if:NT \l__codedoc_long_name_bool
1251 { + 0.75 \marginparwidth - \l__codedoc_trial_width_dim }
1252 }
1253 \hbox_gset:Nw \g__codedoc_syntax_box
1254 \small \ttfamily
1255 \arrayrulecolor{white}
1256 \begin{tabular} { @{} l @{} }
1257 \toprule
1258 \begin{minipage}[t]{\l__codedoc_syntax_dim}
1259 \raggedright
1260 \obeyspaces
1261 \obeylines
1262 }
1263 \cs_new_protected:Npn \__codedoc_syntax_end:
1264 {
1265 \end{minipage}
1266 \end{tabular}
1267 \arrayrulecolor{black}
1268 \hbox_gset_end:
1269 \bool_if:NF \l__codedoc_in_function_bool
1270 {
1271 \begin{quote}
1272 \mode_leave_vertical:
1273 \box_use_drop:N \g__codedoc_syntax_box
1274 \end{quote}
1275 }
1276 }
1277 \keys_define:nn { l3doc-TUB/macro }
1278 {
1279 aux .value_forbidden:n = true ,
1280 aux .code:n =
1281 {
1282 \msg_warning:nnnn { l3doc-TUB } { deprecated-option }
1283 { aux } { function/macro }
1284 } ,
1285 internal .value_forbidden:n = true ,
1286 internal .code:n =
1287 {
1288 \bool_set_true:N \l__codedoc_macro_internal_bool
1289 \bool_set_true:N \l__codedoc_macro_internal_set_bool
1290 } ,
1291 int .value_forbidden:n = true ,
1292 int .code:n =
1293 {
1294 \bool_set_true:N \l__codedoc_macro_internal_bool
1295 \bool_set_true:N \l__codedoc_macro_internal_set_bool
1296 } ,
1297 var .value_forbidden:n = true ,
1298 var .code:n =
1299 { \bool_set_true:N \l__codedoc_macro_var_bool } ,
1300 TF .value_forbidden:n = true ,
1301 TF .code:n =
1302 { \bool_set_true:N \l__codedoc_macro_TF_bool } ,
1303 pTF .value_forbidden:n = true ,
1304 pTF .code:n =
1305 {
1306 \bool_set_true:N \l__codedoc_macro_TF_bool
1307 \bool_set_true:N \l__codedoc_macro_pTF_bool
1308 \bool_set_true:N \l__codedoc_macro_EXP_bool
1309 \bool_set_false:N \l__codedoc_macro_rEXP_bool
1310 } ,
1311 noTF .value_forbidden:n = true ,
1312 noTF .code:n =
1313 {
1314 \bool_set_true:N \l__codedoc_macro_TF_bool
1315 \bool_set_true:N \l__codedoc_macro_noTF_bool
1316 } ,
1317 EXP .value_forbidden:n = true ,
1318 EXP .code:n =
1319 {
1320 \bool_set_true:N \l__codedoc_macro_EXP_bool
1321 \bool_set_false:N \l__codedoc_macro_rEXP_bool
1322 } ,
1323 rEXP .value_forbidden:n = true ,
1324 rEXP .code:n =
1325 {
1326 \bool_set_false:N \l__codedoc_macro_EXP_bool
1327 \bool_set_true:N \l__codedoc_macro_rEXP_bool
1328 } ,
1329 tested .code:n =
1330 {
1331 \bool_set_true:N \l__codedoc_macro_tested_bool
1332 } ,
1333 added .code:n = {} , % TODO
1334 updated .code:n = {} , % TODO
1335 deprecated .code:n = { \__codedoc_deprecated_on:n {#1} } ,
1336 verb .bool_set:N = \l__codedoc_names_verb_bool ,
1337 module .tl_set:N = \l__codedoc_override_module_tl ,
1338 documented-as .tl_set:N = \l__codedoc_macro_documented_tl ,
1339 }
1340 \cs_new_protected:Npn \__codedoc_macro:nnw #1#2
1341 {
1342 \__codedoc_macro_init:
1343 \tl_set:Nn \l__codedoc_macro_argument_tl {#2}
1344 \keys_set:nn { l3doc-TUB/macro } {#1}
1345 \__codedoc_names_get_seq:nN {#2} \l__codedoc_names_seq
1346 \__codedoc_names_parse:
1347 \__codedoc_macro_save_names:
1348 \__codedoc_names_typeset:
1349 \__codedoc_macro_dump:
1350 \__codedoc_macro_reset:
1351 }
1352 \cs_new_protected:Npn \__codedoc_macro_init:
1353 {
1354 \int_incr:N \l__codedoc_nested_macro_int
1355 \bool_set_false:N \l__codedoc_macro_internal_bool
1356 \bool_set_false:N \l__codedoc_macro_internal_set_bool
1357 \bool_set_false:N \l__codedoc_macro_TF_bool
1358 \bool_set_false:N \l__codedoc_macro_pTF_bool
1359 \bool_set_false:N \l__codedoc_macro_noTF_bool
1360 \bool_set_false:N \l__codedoc_macro_EXP_bool
1361 \bool_set_false:N \l__codedoc_macro_rEXP_bool
1362 \bool_set_false:N \l__codedoc_macro_var_bool
1363 \bool_set_false:N \l__codedoc_macro_tested_bool
1364 \bool_set_false:N \l__codedoc_names_verb_bool
1365 \tl_set:Nn \l__codedoc_override_module_tl { \q_no_value }
1366 \tl_clear:N \l__codedoc_macro_documented_tl
1367 \cs_set_eq:NN \testfile \__codedoc_print_testfile:n
1368 \box_clear:N \l__codedoc_macro_index_box
1369 \vbox_set:Nn \l__codedoc_macro_box
1370 {
1371 \hbox:n
1372 {
1373 \strut
1374 \int_compare:nNnT \l__codedoc_macro_int = 0
1375 { \HD@target }
1376 }
1377 \vskip \int_eval:n { \l__codedoc_macro_int - 1 } \baselineskip
1378 }
1379 }
1380 \cs_new_protected:Npn \__codedoc_macro_reset:
1381 {
1382 \tl_set:Nn \l__codedoc_override_module_tl { \q_no_value }
1383 }
1384 \cs_new_protected:Npn \__codedoc_macro_save_names:
1385 {
1386 \tl_if_empty:NTF \l__codedoc_macro_documented_tl
1387 { \__codedoc_names_block_base_map:N \__codedoc_macro_save_names_aux:n }
1388 {
1389 \seq_gput_right:Nf \g__codedoc_nested_names_seq
1390 { \exp_after:wN \token_to_str:N \l__codedoc_macro_documented_tl }
1391 }
1392 }
1393 \cs_new_protected:Npn \__codedoc_macro_save_names_aux:n #1
1394 { \seq_gput_right:Nn \g__codedoc_nested_names_seq {#1} }
1395 \cs_new_protected:Npn \__codedoc_macro_dump:
1396 {
1397 \topsep\MacroTopsep
1398 \trivlist
1399 \cs_set:Npn \makelabel ##1
1400 {
1401 \llap
1402 {
1403 \hbox_unpack_drop:N \l__codedoc_macro_index_box
1404 \vtop to \baselineskip
1405 {
1406 \vbox_unpack_drop:N \l__codedoc_macro_box
1407 \vss
1408 }
1409 }
1410 }
1411 \item [ ]
1412 }
1413 \cs_new_protected:Npn \__codedoc_macro_typeset_block:nN #1#2
1414 {
1415 \__codedoc_macro_single:nNN {#1} \c_true_bool #2
1416 \seq_if_empty:NF \g__codedoc_variants_seq
1417 {
1418 \__codedoc_macro_typeset_variant_list:xN
1419 { \__codedoc_get_function_name:n {#1} } #2
1420 }
1421 }
1422 \cs_generate_variant:Nn \__codedoc_macro_typeset_block:nN { x }
1423 \cs_new_protected:Npn \__codedoc_macro_typeset_variant_list:nN #1#2
1424 {
1425 \seq_map_inline:Nn \g__codedoc_variants_seq
1426 { \__codedoc_macro_single:nNN { #1 : ##1 } \c_false_bool #2 }
1427 }
1428 \cs_generate_variant:Nn \__codedoc_macro_typeset_variant_list:nN { x }
1429 \cs_new_protected:Npn \__codedoc_macro_single:nNN #1#2#3
1430 {
1431 \tl_set:Nn \saved@macroname {#1}
1432 \__codedoc_macro_typeset_one:nN {#1} #3
1433 \bool_if:NT #3 { \DoNotIndex {#1} }
1434 \exp_args:Nx \__codedoc_macro_index:nN
1435 { #1 \bool_if:NT #3 { \tl_to_str:n { TF } } }
1436 #2
1437 }
1438 \cs_new_protected:Npn \__codedoc_macro_index:nN #1#2
1439 {
1440 \DoNotIndex {#1}
1441 \bool_if:NT #2
1442 {
1443 \__codedoc_if_macro_internal:nF {#1}
1444 { \seq_gput_right:Nn \g_doc_macros_seq {#1} }
1445 \hbox_set:Nw \l__codedoc_macro_index_box
1446 \hbox_unpack_drop:N \l__codedoc_macro_index_box
1447 \int_gincr:N \c@CodelineNo
1448 \__codedoc_special_index:nn {#1} { main }
1449 \int_gdecr:N \c@CodelineNo
1450 \exp_args:NNNo \hbox_set_end:
1451 \tl_set:Nn \saved@indexname { \l__codedoc_index_key_tl }
1452 }
1453 }
1454 \cs_new_protected:Npn \__codedoc_macro_typeset_one:nN #1#2
1455 {
1456 \vbox_set:Nn \l__codedoc_macro_box
1457 {
1458 \vbox_unpack_drop:N \l__codedoc_macro_box
1459 \hbox { \llap { \__codedoc_print_macroname:nN {#1} #2 \ } }
1460 }
1461 \int_incr:N \l__codedoc_macro_int
1462 }
1463 \cs_new_protected:Npn \__codedoc_print_macroname:nN #1#2
1464 {
1465 \strut
1466 \__codedoc_get_hyper_target:xN
1467 {
1468 \exp_not:n {#1}
1469 \bool_if:NT #2 { \tl_to_str:n {TF} }
1470 }
1471 \l__codedoc_tmpa_tl
1472 \cs_if_exist:cTF { r@ \l__codedoc_tmpa_tl }
1473 { \exp_last_unbraced:NNo \hyperref [ \l__codedoc_tmpa_tl ] }
1474 { \use:n }
1475 {
1476 \int_compare:nTF { \str_count:n {#1} <= 28 }
1477 { \MacroFont } { \MacroLongFont }
1478 \tl_set:Nn \l__codedoc_tmpa_tl {#1}
1479 \tl_replace_all:Nno \l__codedoc_tmpa_tl
1480 { ~ } { \c_catcode_other_space_tl }
1481 \__codedoc_macroname_prefix:o \l__codedoc_tmpa_tl
1482 \__codedoc_macroname_suffix:N #2
1483 }
1484 }
1485 \cs_new_protected:Npn \__codedoc_macroname_prefix:n #1
1486 {
1487 \__codedoc_if_macro_internal:nTF {#1}
1488 { \__codedoc_typeset_aux:n {#1} } {#1}
1489 }
1490 \cs_generate_variant:Nn \__codedoc_macroname_prefix:n { o }
1491 \cs_new_protected:Npn \__codedoc_macroname_suffix:N #1
1492 { \bool_if:NTF #1 { \__codedoc_typeset_TF: } { } }
1493 \providecommand \MacroLongFont
1494 {
1495 \fontfamily{lmtt}\fontseries{lc}\small
1496 }
1497 \cs_new_protected:Npn \__codedoc_print_testfile:n #1
1498 {
1499 \bool_set_true:N \l__codedoc_macro_tested_bool
1500 \tl_if_eq:nnF {#1} {*}
1501 {
1502 \seq_if_in:NnF \g__codedoc_testfiles_seq {#1}
1503 {
1504 \seq_gput_right:Nn \g__codedoc_testfiles_seq {#1}
1505 \par
1506 \__codedoc_print_testfile_aux:n {#1}
1507 }
1508 }
1509 }
1510 \cs_new_protected:Npn \__codedoc_print_testfile_aux:n #1
1511 {
1512 \footnotesize
1513 (
1514 \textit
1515 {
1516 The~ test~ suite~ for~ this~ command,~
1517 and~ others~ in~ this~ file,~ is~ \textsf{#1}
1518 }.
1519 )\par
1520 }
1521 \DeclareDocumentCommand \TestFiles {m}
1522 {
1523 \par
1524 \textit
1525 {
1526 The~ following~ test~ files~ are~
1527 used~ for~ this~ code:~ \textsf{#1}.
1528 }
1529 \par \ignorespaces
1530 }
1531 \DeclareDocumentCommand \UnitTested { } { \testfile* }
1532 \DeclareDocumentCommand \TestMissing { m }
1533 { \__codedoc_test_missing:n {#1} }
1534 \cs_new_protected:Npn \__codedoc_test_missing:n #1
1535 {
1536 \__codedoc_test_missing_aux:Nxn
1537 \g__codedoc_missing_tests_prop
1538 { \seq_use:Nn \l__codedoc_names_seq { , } }
1539 { { \g_file_curr_name_str \iow_char:N \ (#1) } }
1540 }
1541 \cs_new_protected:Npn \__codedoc_test_missing_aux:Nnn #1#2#3
1542 {
1543 \prop_get:NnNTF #1 {#2} \l__codedoc_tmpa_tl
1544 { \tl_put_right:Nn \l__codedoc_tmpa_tl { , #3 } }
1545 { \tl_set:Nn \l__codedoc_tmpa_tl {#3} }
1546 \prop_put:Nno #1 {#2} \l__codedoc_tmpa_tl
1547 }
1548 \cs_generate_variant:Nn \__codedoc_test_missing_aux:Nnn { Nx }
1549 \cs_new_protected:Npn \__codedoc_macro_end:
1550 {
1551 \endtrivlist
1552 \__codedoc_macro_end_check_tested:
1553 \int_compare:nNnT \l__codedoc_nested_macro_int = 1
1554 { \__codedoc_macro_end_style:n { \__codedoc_print_end_definition: } }
1555 }
1556 \cs_new_protected:Npn \__codedoc_macro_end_check_tested:
1557 {
1558 \bool_lazy_all:nT
1559 {
1560 { \g__codedoc_checktest_bool }
1561 { ! \l__codedoc_macro_var_bool }
1562 { ! \l__codedoc_macro_tested_bool }
1563 }
1564 {
1565 \seq_set_filter:NNn \l__codedoc_tmpa_seq \l__codedoc_names_seq
1566 { ! \__codedoc_if_macro_internal_p:n {##1} }
1567 \seq_gput_right:Nx \g__codedoc_not_tested_seq
1568 {
1569 \seq_use:Nn \l__codedoc_tmpa_seq { , }
1570 \bool_if:NTF \l__codedoc_macro_pTF_bool {~(pTF)}
1571 { \bool_if:NT \l__codedoc_macro_TF_bool {~(TF)} }
1572 }
1573 }
1574 }
1575 \cs_new_protected:Npn \__codedoc_macro_end_style:n #1
1576 {
1577 \nobreak \noindent
1578 { \footnotesize ( \emph{#1} ) \par }
1579 }
1580 \cs_new_protected:Npn \__codedoc_macro_end_wrap_item:n #1
1581 {
1582 \tl_set:Nn \l__codedoc_tmpa_tl {#1}
1583 \tl_replace_all:Non \l__codedoc_tmpa_tl
1584 { \token_to_str:N _ } { \_ }
1585 \texttt { \l__codedoc_tmpa_tl }
1586 }
1587 \cs_new_protected:Npn \__codedoc_print_end_definition:
1588 {
1589 \seq_set_map:NNn \l__codedoc_tmpa_seq
1590 \g__codedoc_nested_names_seq
1591 { \exp_not:n { \__codedoc_macro_end_wrap_item:n {##1} } }
1592 End~ definition~ for~
1593 \int_compare:nTF { \seq_count:N \l__codedoc_tmpa_seq <= 3 }
1594 {
1595 \seq_use:Nnnn \l__codedoc_tmpa_seq
1596 { \,~and~ } { \,,~ } { \,,~and~ }
1597 }
1598 { \seq_item:Nn \l__codedoc_tmpa_seq {1}\,~and~others }
1599 \@.
1600 \__codedoc_print_documented:
1601 }
1602 \cs_new_protected:Npn \__codedoc_print_documented:
1603 {
1604 \seq_gset_filter:NNn \g__codedoc_nested_names_seq
1605 \g__codedoc_nested_names_seq
1606 { ! \__codedoc_if_macro_internal_p:n {##1} }
1607 \seq_if_empty:NF \g__codedoc_nested_names_seq
1608 {
1609 \int_set:Nn \l__codedoc_tmpa_int
1610 { \seq_count:N \g__codedoc_nested_names_seq }
1611 \int_compare:nNnTF \l__codedoc_tmpa_int = 1 {~This~} {~These~}
1612 \bool_if:NTF \l__codedoc_macro_var_bool {variable} {function}
1613 \int_compare:nNnTF \l__codedoc_tmpa_int = 1 {~is~} {s~are~}
1614 documented~on~page~
1615 \__codedoc_get_hyper_target:xN
1616 { \seq_item:Nn \g__codedoc_nested_names_seq { 1 } }
1617 \l__codedoc_tmpa_tl
1618 \exp_args:Nx \pageref { \l__codedoc_tmpa_tl } .
1619 }
1620 \seq_gclear:N \g__codedoc_nested_names_seq
1621 }
1622 \newcommand*{\DescribeOption}
1623 {
1624 \leavevmode
1625 \@bsphack
1626 \begingroup
1627 \MakePrivateLetters
1628 \Describe@Option
1629 }
1630 \newcommand*{\Describe@Option}[1]
1631 {
1632 \endgroup
1633 \marginpar{
1634 \raggedleft
1635 \PrintDescribeEnv{#1}
1636 }
1637 \SpecialOptionIndex{#1}
1638 \@esphack
1639 \ignorespaces
1640 }
1641 \newcommand*{\SpecialOptionIndex}[1]
1642 {
1643 \@bsphack
1644 \begingroup
1645 \HD@target
1646 \let\HDorg@encapchar\encapchar
1647 \edef\encapchar usage
1648 {
1649 \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage}
1650 }
1651 \index
1652 {
1653 #1\actualchar{\protect\ttfamily#1}~(option)
1654 \encapchar usage
1655 }
1656 \index
1657 {
1658 options:\levelchar#1\actualchar{\protect\ttfamily#1}
1659 \encapchar usage
1660 }
1661 \endgroup
1662 \@esphack
1663 }
1664 \font \manual = manfnt \scan_stop:
1665 \cs_gset:Npn \dbend { {\manual\char127} }
1666 \newenvironment {danger}
1667 {
1668 \begin{trivlist}\item[]\noindent
1669 \begingroup\hangindent=2pc\hangafter=-2
1670 \cs_set:Npn \par{\endgraf\endgroup}
1671 \hbox to0pt{\hskip-\hangindent\dbend\hfill}\ignorespaces
1672 }
1673 {
1674 \par\end{trivlist}
1675 }
1676 \newenvironment {ddanger}
1677 {
1678 \begin{trivlist}\item[]\noindent
1679 \begingroup\hangindent=3.5pc\hangafter=-2
1680 \cs_set:Npn \par{\endgraf\endgroup}
1681 \hbox to0pt{\hskip-\hangindent\dbend\kern2pt\dbend\hfill}\ignorespaces
1682 }{
1683 \par\end{trivlist}
1684 }
1685 \newenvironment{TemplateInterfaceDescription}[1]
1686 {
1687 \subsection{The~object~type~`#1'}
1688 \begingroup
1689 \@beginparpenalty\@M
1690 \description
1691 \def\TemplateArgument##1##2{\item[Arg:~##1]##2\par}
1692 \def\TemplateSemantics
1693 {
1694 \enddescription\endgroup
1695 \subsubsection*{Semantics:}
1696 }
1697 }
1698 {
1699 \par\bigskip
1700 }
1701 \newenvironment{TemplateDescription}[2]
1702 {
1703 \subsection{The~template~`#2'~(object~type~#1)}
1704 \subsubsection*{Attributes:}
1705 \begingroup
1706 \@beginparpenalty\@M
1707 \description
1708 \def\TemplateKey##1##2##3##4
1709 {
1710 \item[##1~(##2)]##3%
1711 \ifx\TemplateKey##4\TemplateKey\else
1712 \hfill\penalty500\hbox{}\hfill Default:~##4%
1713 \nobreak\hskip-\parfillskip\hskip0pt\relax
1714 \fi
1715 \par
1716 }
1717 \def\TemplateSemantics
1718 {
1719 \enddescription\endgroup
1720 \subsubsection*{Semantics~\&~Comments:}
1721 }
1722 }
1723 { \par \bigskip }
1724 \newenvironment{InstanceDescription}[4][xxxxxxxxxxxxxxx]
1725 {
1726 \subsubsection{The~instance~`#3'~(template~#2/#4)}
1727 \subsubsection*{Attribute~values:}
1728 \begingroup
1729 \@beginparpenalty\@M
1730 \def\InstanceKey##1##2{\>\textbf{##1}\>##2\\}
1731 \def\InstanceSemantics{\endtabbing\endgroup
1732 \vskip-30pt\vskip0pt
1733 \subsubsection*{Layout~description~\&~Comments:}}
1734 \tabbing
1735 xxxx\=#1\=\kill
1736 }
1737 { \par \bigskip }
1738 \DeclareDocumentCommand \OnlyDescription { }
1739 { \bool_gset_false:N \g__codedoc_typeset_implementation_bool }
1740 \DeclareDocumentCommand \AlsoImplementation { }
1741 { \bool_gset_true:N \g__codedoc_typeset_implementation_bool }
1742 \DeclareDocumentCommand \StopEventually { m }
1743 {
1744 \bool_if:NTF \g__codedoc_typeset_implementation_bool
1745 {
1746 \@bsphack
1747 \tl_gset:Nn \g__codedoc_finale_tl { #1 \check@checksum }
1748 \init@checksum
1749 \@esphack
1750 }
1751 { #1 \endinput }
1752 }
1753 \DeclareDocumentCommand \Finale { }
1754 { \tl_use:N \g__codedoc_finale_tl }
1755 \tl_new:N \g__codedoc_finale_tl
1756 \cs_new_protected:Npn \__codedoc_input:n #1
1757 {
1758 \tl_gclear:N \g__codedoc_module_name_tl
1759 \MakePercentIgnore
1760 \input{#1}
1761 \MakePercentComment
1762 }
1763 \DeclareDocumentCommand \DocInput { m }
1764 {
1765 \clist_map_inline:nn {#1}
1766 {
1767 \clist_put_right:Nn \g_docinput_clist {##1}
1768 \__codedoc_input:n {##1}
1769 }
1770 }
1771 \DeclareDocumentCommand \DocInputAgain { }
1772 { \clist_map_function:NN \g_docinput_clist \__codedoc_input:n }
1773 \NewDocumentCommand \DocInclude { m }
1774 {
1775 \relax\clearpage
1776 \docincludeaux
1777 \IfFileExists{#1.fdd}
1778 { \cs_set:Npn \currentfile{#1.fdd} }
1779 { \cs_set:Npn \currentfile{#1.dtx} }
1780 \int_compare:nNnTF \@auxout = \@partaux
1781 { \@latexerr{\string\include\space cannot~be~nested}\@eha }
1782 { \@docinclude #1 }
1783 }
1784 \cs_gset:Npn \@docinclude #1
1785 {
1786 \clearpage
1787 \immediate\write\@mainaux{\string\@input{#1.aux}}
1788 \@tempswatrue
1789 \if@partsw
1790 \@tempswafalse
1791 \cs_set:Npx \@tempb{#1}
1792 \@for\@tempa:=\@partlist\do
1793 {
1794 \ifx\@tempa\@tempb\@tempswatrue\fi
1795 }
1796 \fi
1797 \if@tempswa
1798 \cs_set_eq:NN \@auxout \@partaux
1799 \immediate\openout\@partaux #1.aux
1800 \immediate\write\@partaux{\relax}
1801 \cs_set_eq:NN \@ltxdoc@PrintIndex \PrintIndex
1802 \cs_set_eq:NN \PrintIndex \relax
1803 \cs_set_eq:NN \@ltxdoc@PrintChanges \PrintChanges
1804 \cs_set_eq:NN \PrintChanges \relax
1805 \cs_set_eq:NN \@ltxdoc@theglossary \theglossary
1806 \cs_set_eq:NN \@ltxdoc@endtheglossary \endtheglossary
1807 \part{\currentfile}
1808 {
1809 \cs_set_eq:NN \ttfamily\relax
1810 \cs_gset:Npx \filekey
1811 { \filekey, \thepart = { \ttfamily \currentfile } }
1812 }
1813 \DocInput{\currentfile}
1814 \cs_set_eq:NN \PrintIndex \@ltxdoc@PrintIndex
1815 \cs_set_eq:NN \PrintChanges \@ltxdoc@PrintChanges
1816 \cs_set_eq:NN \theglossary \@ltxdoc@theglossary
1817 \cs_set_eq:NN \endtheglossary \@ltxdoc@endtheglossary
1818 \clearpage
1819 \@writeckpt{#1}
1820 \immediate \closeout \@partaux
1821 \else
1822 \@nameuse{cp@#1}
1823 \fi
1824 \cs_set_eq:NN \@auxout \@mainaux
1825 }
1826 \cs_gset:Npn \codeline@wrindex #1
1827 {
1828 \immediate\write\@indexfile
1829 {
1830 \string\indexentry{#1}
1831 { \filesep \int_use:N \c@CodelineNo }
1832 }
1833 }
1834 \tl_gclear:N \filesep
1835 \cs_gset:Npn \docincludeaux
1836 {
1837 \tl_set:Nn \thepart { \alphalph { part } }
1838 \tl_set:Nn \filesep { \thepart - }
1839 \cs_set_eq:NN \filekey \use_none:n
1840 \tl_gput_right:Nn \index@prologue
1841 {
1842 \cs_gset:Npn \@oddfoot
1843 {
1844 \parbox { \textwidth }
1845 {
1846 \strut \footnotesize
1847 \raggedright { \bfseries File~Key: } ~ \filekey
1848 }
1849 }
1850 \cs_set_eq:NN \@evenfoot \@oddfoot
1851 }
1852 \cs_gset_eq:NN \docincludeaux \relax
1853 \cs_gset:Npn \@oddfoot
1854 {
1855 \cs_if_exist:cTF { ver @ \currentfile }
1856 { File~\thepart :~{\ttfamily\currentfile}~ }
1857 {
1858 \GetFileInfo{\currentfile}
1859 File~\thepart :~{\ttfamily\filename}~
1860 Date:~\ExplFileDate\ % space
1861 Version~\ExplFileVersion
1862 }
1863 \hfill \thepage
1864 }
1865 \cs_set_eq:NN \@evenfoot \@oddfoot
1866 }
1867 \group_begin:
1868 \char_set_catcode_other:N \^^A
1869 \char_set_catcode_active:N \^^S
1870 \char_set_catcode_active:N \^^B
1871 \char_set_catcode_other:N \^^L
1872 \char_set_catcode_other:N \^^R
1873 \char_set_lccode:nn { `\^^A } { `\% }
1874 \char_set_lccode:nn { `\^^S } { `\ }
1875 \char_set_lccode:nn { `\^^B } { `\\ }
1876 \char_set_lccode:nn { `\^^L } { `\{ }
1877 \char_set_lccode:nn { `\^^R } { `\} }
1878 \tex_lowercase:D
1879 {
1880 \group_end:
1881 \cs_set_protected:Npn \xmacro@code
1882 #1 ^^A ^^S^^S^^S^^S ^^Bend ^^Lmacrocode^^R
1883 { \__codedoc_xmacro_code:n {#1} \end{macrocode} }
1884 }
1885 \group_begin:
1886 \char_set_catcode_active:N \<
1887 \char_set_catcode_active:N \>
1888 \cs_new_protected:Npn \__codedoc_xmacro_code:n #1
1889 {
1890 \tl_if_in:nnTF {#1} { < @ @ = }
1891 { \__codedoc_xmacro_code:w #1 \q_stop }
1892 {
1893 \tl_set:Nn \l__codedoc_tmpa_tl {#1}
1894 \__codedoc_replace_at_at:N \l__codedoc_tmpa_tl
1895 \tl_use:N \l__codedoc_tmpa_tl
1896 }
1897 }
1898 \cs_new_protected:Npn \__codedoc_xmacro_code:w #1 < @ @ = #2 > #3 \q_stop
1899 {
1900 \tl_set:Nn \l__codedoc_tmpa_tl {#1}
1901 \__codedoc_replace_at_at:N \l__codedoc_tmpa_tl
1902
1903 \tl_gset:Nn \g__codedoc_module_name_tl {#2}
1904 \tl_put_right:Nn \l__codedoc_tmpa_tl { < @ @ = #2 > }
1905
1906 \tl_set:Nn \l__codedoc_tmpb_tl {#3}
1907 \__codedoc_replace_at_at:N \l__codedoc_tmpb_tl
1908 \tl_put_right:No \l__codedoc_tmpa_tl { \l__codedoc_tmpb_tl }
1909
1910 \tl_use:N \l__codedoc_tmpa_tl
1911 }
1912 \group_end:
1913 \iow_new:N \g__codedoc_func_iow
1914 \tl_new:N \l__codedoc_doc_def_tl
1915 \tl_new:N \l__codedoc_doc_undef_tl
1916 \tl_new:N \l__codedoc_undoc_def_tl
1917 \cs_new_protected:Npn \__codedoc_show_functions_defined:
1918 {
1919 \bool_lazy_and:nnT
1920 { \g__codedoc_typeset_implementation_bool } { \g__codedoc_checkfunc_bool }
1921 {
1922 \iow_term:x { \c__codedoc_iow_separator_tl \iow_newline: }
1923 \iow_open:Nn \g__codedoc_func_iow { \c_sys_jobname_str .cmds }
1924
1925 \tl_clear:N \l__codedoc_doc_def_tl
1926 \tl_clear:N \l__codedoc_doc_undef_tl
1927 \tl_clear:N \l__codedoc_undoc_def_tl
1928 \seq_map_inline:Nn \g_doc_functions_seq
1929 {
1930 \seq_if_in:NnTF \g_doc_macros_seq {##1}
1931 {
1932 \tl_put_right:Nx \l__codedoc_doc_def_tl
1933 { ##1 \iow_newline: }
1934 \iow_now:Nn \g__codedoc_func_iow { > ~ ##1 }
1935 }
1936 {
1937 \tl_put_right:Nx \l__codedoc_doc_undef_tl
1938 { ##1 \iow_newline: }
1939 \iow_now:Nn \g__codedoc_func_iow { ! ~ ##1 }
1940 }
1941 }
1942 \seq_map_inline:Nn \g_doc_macros_seq
1943 {
1944 \seq_if_in:NnF \g_doc_functions_seq {##1}
1945 {
1946 \tl_put_right:Nx \l__codedoc_undoc_def_tl
1947 { ##1 \iow_newline: }
1948 \iow_now:Nn \g__codedoc_func_iow { ? ~ ##1 }
1949 }
1950 }
1951 \__codedoc_functions_typeout:nN
1952 {
1953 Functions~both~documented~and~defined: \iow_newline:
1954 (In~order~of~being~documented)
1955 }
1956 \l__codedoc_doc_def_tl
1957 \__codedoc_functions_typeout:nN
1958 { Functions~documented~but~not~defined: }
1959 \l__codedoc_doc_undef_tl
1960 \__codedoc_functions_typeout:nN
1961 { Functions~defined~but~not~documented: }
1962 \l__codedoc_undoc_def_tl
1963
1964 \iow_close:N \g__codedoc_func_iow
1965 \iow_term:x { \c__codedoc_iow_separator_tl }
1966 }
1967 }
1968 \AtEndDocument { \__codedoc_show_functions_defined: }
1969 \cs_new_protected:Npn \__codedoc_functions_typeout:nN #1#2
1970 {
1971 \tl_if_empty:NF #2
1972 {
1973 \typeout
1974 {
1975 \c__codedoc_iow_midrule_tl \iow_newline:
1976 #1 \iow_newline:
1977 \c__codedoc_iow_midrule_tl \iow_newline:
1978 #2
1979 }
1980 \tl_clear:N #2
1981 }
1982 }
1983 \cs_new_protected:Npn \__codedoc_show_not_tested:
1984 {
1985 \bool_if:NT \g__codedoc_checktest_bool
1986 {
1987 \tl_clear:N \l__codedoc_tmpa_tl
1988 \prop_if_empty:NF \g__codedoc_missing_tests_prop
1989 {
1990 \cs_set:Npn \__codedoc_tmpa:w ##1##2
1991 {
1992 \iow_newline:
1993 \space\space\space\space \exp_not:n {##1}
1994 \clist_map_function:nN {##2} \__codedoc_tmpb:w
1995 }
1996 \cs_set:Npn \__codedoc_tmpb:w ##1
1997 {
1998 \iow_newline:
1999 \space\space\space\space\space\space * ~ ##1
2000 }
2001 \tl_put_right:Nx \l__codedoc_tmpa_tl
2002 {
2003 \iow_newline: \iow_newline:
2004 The~ following~ macro(s)~ have~ incomplete~ tests:
2005 \iow_newline:
2006 \prop_map_function:NN
2007 \g__codedoc_missing_tests_prop \__codedoc_tmpa:w
2008 }
2009 }
2010 \seq_if_empty:NF \g__codedoc_not_tested_seq
2011 {
2012 \cs_set:Npn \__codedoc_tmpa:w ##1
2013 { \clist_map_function:nN {##1} \__codedoc_tmpb:w }
2014 \cs_set:Npn \__codedoc_tmpb:w ##1
2015 {
2016 \iow_newline:
2017 \space\space\space\space ##1
2018 }
2019 \tl_put_right:Nx \l__codedoc_tmpa_tl
2020 {
2021 \iow_newline:
2022 \iow_newline:
2023 The~ following~ macro(s)~ do~ not~ have~ any~ tests:
2024 \iow_newline:
2025 \seq_map_function:NN
2026 \g__codedoc_not_tested_seq \__codedoc_tmpa:w
2027 }
2028 }
2029 \tl_if_empty:NF \l__codedoc_tmpa_tl
2030 {
2031 \int_set:Nn \l__codedoc_tmpa_int { \etex_interactionmode:D }
2032 \errorstopmode
2033 \ClassError { l3doc-TUB } { \l__codedoc_tmpa_tl } { }
2034 \int_set:Nn \etex_interactionmode:D { \l__codedoc_tmpa_int }
2035 }
2036 }
2037 }
2038 \AtEndDocument { \__codedoc_show_not_tested: }
2039 \g@addto@macro \theindex { \MakePrivateLetters }
2040 \cs_gset:Npn \verbatimchar {&}
2041 \setcounter { IndexColumns } { 2 }
2042 \IndexPrologue
2043 {
2044 \section*{Index}
2045 \markboth{Index}{Index}
2046 \addcontentsline{toc}{section}{Index}
2047 The~italic~numbers~denote~the~pages~where~the~
2048 corresponding~entry~is~described,~
2049 numbers~underlined~point~to~the~definition,~
2050 all~others~indicate~the~places~where~it~is~used.
2051 }
2052 \cs_gset_protected:Npn \SpecialIndex #1
2053 {
2054 \@bsphack
2055 \__codedoc_special_index:nn {#1} { }
2056 \@esphack
2057 }
2058 \msg_new:nnn { l3doc-TUB } { print-index-howto }
2059 {
2060 Generate~the~index~by~executing\\
2061 \iow_indent:n
2062 { makeindex~-s~gind.ist~-o~\c_sys_jobname_str.ind~\c_sys_jobname_str.idx }
2063 }
2064 \tl_gput_right:Nn \PrintIndex
2065 { \AtEndDocument { \msg_info:nn { l3doc-TUB } { print-index-howto } } }
2066 \cs_gset_protected:Npn \it@is@a #1
2067 {
2068 \use:x
2069 {
2070 \__codedoc_special_index_module:nnnnN
2071 {#1}
2072 { \bslash #1 }
2073 { }
2074 { }
2075 \c_false_bool
2076 }
2077 }
2078 \cs_new_protected:Npn \__codedoc_special_index:nn #1#2
2079 {
2080 \__codedoc_key_get:n {#1}
2081 \quark_if_no_value:NF \l__codedoc_override_module_tl
2082 { \tl_set_eq:NN \l__codedoc_index_module_tl \l__codedoc_override_module_tl }
2083 \__codedoc_special_index_module:ooonN
2084 { \l__codedoc_index_key_tl }
2085 { \l__codedoc_index_macro_tl }
2086 { \l__codedoc_index_module_tl }
2087 {#2}
2088 \l__codedoc_index_internal_bool
2089 }
2090 \cs_generate_variant:Nn \__codedoc_special_index:nn { o }
2091 \tl_new:N \l__codedoc_index_escaped_macro_tl
2092 \tl_new:N \l__codedoc_index_escaped_key_tl
2093 \cs_new_protected:Npn \__codedoc_special_index_module:nnnnN #1#2#3#4#5
2094 {
2095 \use:x
2096 {
2097 \exp_not:n { \__codedoc_special_index_aux:nnnnnn {#1} {#2} }
2098 \tl_if_empty:nTF {#3}
2099 { { } { } { } }
2100 {
2101 \str_if_eq:eeTF {#3} { TeX }
2102 {
2103 { TeX~and~LaTeX2e }
2104 { \string\TeX{}~and~\string\LaTeXe{} }
2105 }
2106 {
2107 {#3}
2108 { \string\pkg{#3} }
2109 }
2110 { \bool_if:NT #5 { ~internal } ~commands: }
2111 }
2112 }
2113 {#4}
2114 }
2115 \cs_generate_variant:Nn \__codedoc_special_index_module:nnnnN { ooo }
2116 \cs_new_protected:Npn \__codedoc_special_index_aux:nnnnnn #1#2#3#4#5#6
2117 {
2118 \tl_set:Nn \l__codedoc_index_escaped_key_tl {#1}
2119 \__codedoc_quote_special_char:N \l__codedoc_index_escaped_key_tl
2120 \__codedoc_special_index_set:Nn \l__codedoc_index_escaped_macro_tl {#2}
2121 \str_if_eq:onTF { \@currenvir } { macrocode }
2122 { \codeline@wrindex }
2123 {
2124 \str_case:nnF {#6}
2125 {
2126 { main } { \codeline@wrindex }
2127 { usage } { \index }
2128 }
2129 { \HD@target \index }
2130 }
2131 {
2132 \tl_if_empty:nF { #3 #4 #5 }
2133 { #3 #5 \actualchar #4 #5 \levelchar }
2134 \l__codedoc_index_escaped_key_tl
2135 \actualchar
2136 {
2137 \token_to_str:N \verbatim@font \c_space_tl
2138 \l__codedoc_index_escaped_macro_tl
2139 }
2140 \encapchar
2141 hdclindex{\the\c@HD@hypercount}{#6}
2142 }
2143 }
2144 \cs_new_protected:Npn \__codedoc_special_index_set:Nn #1#2
2145 {
2146 \tl_set:Nx #1 { \tl_to_str:n {#2} }
2147 \__codedoc_if_almost_str:nTF {#2}
2148 {
2149 \tl_replace_all:Non #1 { \tl_to_str:n { __ } }
2150 {
2151 \verbatimchar
2152 \token_to_str:N \_ \token_to_str:N \_
2153 \token_to_str:N \verb * \verbatimchar
2154 }
2155 \exp_args:Nx \tl_map_inline:nn
2156 { \tl_to_str:N \verbatimchar \token_to_str:N _ }
2157 {
2158 \tl_replace_all:Nnn #1 {##1}
2159 {
2160 \verbatimchar \c__codedoc_backslash_tl ##1
2161 \token_to_str:N \verb * \verbatimchar
2162 }
2163 }
2164 \tl_set:Nx #1
2165 {
2166 \token_to_str:N \verb * \verbatimchar
2167 #1 \verbatimchar
2168 }
2169 }
2170 {
2171 \tl_set:Nn #1 {#2}
2172 \tl_replace_all:Non #1
2173 { \c__codedoc_backslash_tl }
2174 { \token_to_str:N \bslash \c_space_tl }
2175 }
2176 \__codedoc_quote_special_char:N #1
2177 }
2178 \cs_new_protected:Npn \__codedoc_quote_special_char:N #1
2179 {
2180 \tl_map_inline:nn { \quotechar \actualchar \encapchar \levelchar }
2181 {
2182 \tl_replace_all:Nxn #1
2183 { \tl_to_str:N ##1 } { \quotechar \tl_to_str:N ##1 }
2184 }
2185 }
2186 \cs_new_protected:Npn \__codedoc_key_get:n #1
2187 {
2188 \__codedoc_key_get_base:nN {#1} \l__codedoc_index_macro_tl
2189 \tl_set:Nx \l__codedoc_index_key_tl
2190 { \tl_to_str:N \l__codedoc_index_macro_tl }
2191 \tl_clear:N \l__codedoc_index_module_tl
2192 \tl_if_in:NoTF \l__codedoc_index_key_tl { \tl_to_str:n { __ } }
2193 { \bool_set_true:N \l__codedoc_index_internal_bool }
2194 { \bool_set_false:N \l__codedoc_index_internal_bool }
2195 \tl_if_head_eq_charcode:oNT
2196 { \l__codedoc_index_key_tl } \c__codedoc_backslash_token
2197 { \__codedoc_key_pop: }
2198 \tl_if_in:NoTF \l__codedoc_index_key_tl { \token_to_str:N : }
2199 { \__codedoc_key_func: }
2200 {
2201 \tl_if_in:NoTF \l__codedoc_index_key_tl { \token_to_str:N _ }
2202 { \__codedoc_key_var: }
2203 {
2204 \tl_if_in:NoT \l__codedoc_index_key_tl { \token_to_str:N @ }
2205 { \tl_set:Nn \l__codedoc_index_module_tl { TeX } }
2206 }
2207 }
2208 }
2209 \cs_new_protected:Npn \__codedoc_key_pop:
2210 {
2211 \tl_set:Nx \l__codedoc_index_key_tl
2212 { \tl_tail:N \l__codedoc_index_key_tl }
2213 }
2214 \cs_new_protected:Npn \__codedoc_key_trim_module:n #1
2215 {
2216 \cs_set:Npn \__codedoc_tmpa:w ##1 #1 ##2 \q_stop
2217 { \exp_not:n {##1} }
2218 \tl_set:Nx \l__codedoc_index_module_tl
2219 { \exp_after:wN \__codedoc_tmpa:w \l__codedoc_index_module_tl #1 \q_stop }
2220 }
2221 \cs_new_protected:Npn \__codedoc_key_drop_underscores:
2222 {
2223 \tl_if_head_eq_charcode:oNT { \l__codedoc_index_key_tl } _
2224 { \__codedoc_key_pop: \__codedoc_key_drop_underscores: }
2225 }
2226 \cs_new_protected:Npn \__codedoc_key_func:
2227 {
2228 \tl_if_head_eq_charcode:oNT { \l__codedoc_index_key_tl } .
2229 { \__codedoc_key_pop: }
2230 \__codedoc_key_drop_underscores:
2231 \tl_set_eq:NN \l__codedoc_index_module_tl \l__codedoc_index_key_tl
2232 \exp_args:No \__codedoc_key_trim_module:n { \token_to_str:N : }
2233 \exp_args:No \__codedoc_key_trim_module:n { \token_to_str:N _ }
2234 }
2235 \cs_new_protected:Npn \__codedoc_key_var:
2236 {
2237 \exp_args:Nx \tl_if_head_eq_charcode:nNTF
2238 { \exp_args:No \str_tail:n \l__codedoc_index_key_tl } _
2239 {
2240 \str_case:fn { \str_head:N \l__codedoc_index_key_tl }
2241 {
2242 { q } { \tl_set:Nn \l__codedoc_index_module_tl { quark } }
2243 { s } { \tl_set:Nn \l__codedoc_index_module_tl { quark } }
2244 }
2245 \__codedoc_key_pop:
2246 \__codedoc_key_pop:
2247 \__codedoc_key_drop_underscores:
2248 \tl_if_empty:NT \l__codedoc_index_module_tl
2249 {
2250 \seq_set_split:NoV \l__codedoc_tmpa_seq
2251 { \token_to_str:N _ } \l__codedoc_index_key_tl
2252 \tl_set:Nx \l__codedoc_index_module_tl
2253 {
2254 \int_case:nnF { \seq_count:N \l__codedoc_tmpa_seq }
2255 {
2256 { 0 } { }
2257 { 1 } { int }
2258 { 2 } { \seq_item:Nn \l__codedoc_tmpa_seq { 2 } }
2259 }
2260 { \seq_item:Nn \l__codedoc_tmpa_seq { 1 } }
2261 }
2262 }
2263 }
2264 {
2265 \tl_set_eq:NN \l__codedoc_index_module_tl \l__codedoc_index_key_tl
2266 \exp_args:No \__codedoc_key_trim_module:n { \token_to_str:N _ }
2267 }
2268 }
2269 \GlossaryPrologue
2270 {
2271 \part*{Change~History}
2272 {\GlossaryParms\ttfamily\hyphenchar\font=`\-}
2273 \markboth{Change~History}{Change~History}
2274 \addcontentsline{toc}{part}{Change~History}
2275 }
2276 \msg_new:nnn { l3doc-TUB } { print-changes-howto }
2277 {
2278 Generate~the~change~list~by~executing\\
2279 \iow_indent:n
2280 { makeindex~-s~gglo.ist~-o~\c_sys_jobname_str.gls~\c_sys_jobname_str.glo }
2281 }
2282 \tl_gput_right:Nn \PrintChanges
2283 { \AtEndDocument { \msg_info:nn { l3doc-TUB } { print-changes-howto } } }
2284 \bool_if:NTF \g__codedoc_typeset_implementation_bool
2285 {
2286 \RecordChanges
2287 \CodelineIndex
2288 \EnableCrossrefs
2289 \AlsoImplementation
2290 }
2291 {
2292 \CodelineNumbered
2293 \DisableCrossrefs
2294 \OnlyDescription
2295 }
2296
2297 %%FMi
2298
2299 \def\maketitle{\@ifstar
2300 {\@articletitlefalse\@r@maketitle}%
2301 {\@articletitletrue\@r@maketitle}%
2302 }
2303
2304 %%
2305 %%
2306 %% End of file `l3doc-TUB.cls'.