diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx | 90 |
1 files changed, 40 insertions, 50 deletions
diff --git a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx index 656cb20727a..afa30c7500b 100644 --- a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx @@ -40,7 +40,7 @@ % %<*driver|package> \RequirePackage{expl3} -\GetIdInfo$Id: xtemplate.dtx 2966 2011-11-19 15:58:47Z joseph $ +\GetIdInfo$Id: xtemplate.dtx 3036 2011-12-07 19:29:18Z joseph $ {L3 Experimental prototype document functions} %</driver|package> %<*driver> @@ -661,7 +661,7 @@ % % A check to make sure that \pkg{expl3} is not too old % \begin{macrocode} -\@ifpackagelater { expl3 } { 2011/11/19 } +\@ifpackagelater { expl3 } { 2011/12/07 } { } { \PackageError { xtemplate } { Support~package~l3kernel~too~old. } @@ -2424,7 +2424,6 @@ % \xtemplate_show_vars:nn % } % \begin{macro}[int]{\xtemplate_show:Nnnn} -% \begin{macro}[aux]{\xtemplate_show_aux:nn} % A modified version of the property-list printing code, such that % the output refers to templates and instances rather than to the % underlying structures. @@ -2448,7 +2447,7 @@ } } \cs_new_protected_nopar:Npn \xtemplate_show_vars:nn #1#2 - { + { \xtemplate_execute_if_code_exist:nnT {#1} {#2} { \xtemplate_recover_vars:n { #1 / #2 } @@ -2458,31 +2457,16 @@ } \cs_new_protected_nopar:Npn \xtemplate_show:Nnnn #1#2#3#4 { - \prop_if_empty:NTF #1 - { - \iow_term:x { Template~'#3'~of~object~type~'#2'~has~no~#4 . } - \tl_show:n { } - } - { - \iow_term:x { Template~'#3'~of~object~type~'#2'~has~ #4 : } - \tl_set:Nx \l_prop_show_tl - { \prop_map_function:NN #1 \xtemplate_show_aux:nn } - \etex_showtokens:D \exp_after:wN \exp_after:wN \exp_after:wN - { \exp_after:wN \prop_show_aux:w \l_prop_show_tl } - } -} -\cs_new:Npn \xtemplate_show_aux:nn #1#2 - { - \iow_newline: > \c_space_tl \c_space_tl - #1 - \c_space_tl \c_space_tl => \c_space_tl \c_space_tl - \exp_not:n {#2} + \msg_aux_use:nnxxxx { xtemplate } + { \prop_if_empty:NTF #1 { show-no-attribute } { show-attribute } } + {#2} {#3} {#4} { } + \msg_aux_show:x + { \prop_map_function:NN #1 \msg_aux_show_unbraced:nn } } % \end{macrocode} % \end{macro} % \end{macro} -% \end{macro} -% +% % \begin{macro}{\template_show_values:nnn} % Instance values are a little more complex, as there are the collection % and template to consider. @@ -2494,35 +2478,20 @@ \xtemplate_recover_values:n { #1 / #2 / #3 } \prop_if_empty:NTF \l_xtemplate_values_prop { - \iow_term:x - { - \tl_if_empty:nTF {#2} - { Instance~'#3'~ } - { Collection instance~'#3'~(from~collection~'#2')~ } - of~object~type~'#1'~has~no~values. - } - \tl_show:n { } + \msg_aux_use:nnxxxx { xtemplate } { show-no-values } + {#1} {#2} {#3} { } + \msg_aux_show:x { } } { \prop_pop:NnN \l_xtemplate_values_prop { from~template } \l_xtemplate_tmp_tl - \iow_term:x - { - \tl_if_empty:nTF {#2} - { Instance~'#3'~ } - { Collection instance~'#3'~(from~collection~'#2')~ } - of~object~type~'#1' - \quark_if_no_value:NF \l_xtemplate_tmp_tl - { ~(from~template~' \l_xtemplate_tmp_tl ')~ } - has~values: - } - \tl_set:Nx \l_prop_show_tl + \msg_aux_use:nnxxxx { xtemplate } { show-values } + {#1} {#2} {#3} { \l_xtemplate_tmp_tl } + \msg_aux_show:x { \prop_map_function:NN \l_xtemplate_values_prop - \xtemplate_show_aux:nn + \msg_aux_show_unbraced:nn } - \etex_showtokens:D \exp_after:wN \exp_after:wN \exp_after:wN - { \exp_after:wN \prop_show_aux:w \l_prop_show_tl } } } } @@ -2707,7 +2676,7 @@ '#2'~of~object~type~'#1'. } % \end{macrocode} -% +% % Information messages only have text: more text should not be needed. % \begin{macrocode} \msg_new:nnn { xtemplate } { declare-object-type } @@ -2719,14 +2688,35 @@ Declaring~interface~for~template~'#2'~of~object~type~'#1'~ \msg_line_context:. } +\msg_new:nnn { xtemplate } { show-no-attribute } + { Template~'#2'~of~object~type~'#1'~has~no~#3 . } +\msg_new:nnn { xtemplate } { show-attribute } + { Template~'#2'~of~object~type~'#1'~has~#3 : } +\msg_new:nnn { xtemplate } { show-no-values } + { + \tl_if_empty:nTF {#2} + { Instance~'#3'~ } + { Collection instance~'#3'~(from~collection~'#2')~ } + of~object~type~'#1'~has~no~values. + } +\msg_new:nnn { xtemplate } { show-values } + { + \tl_if_empty:nTF {#2} + { Instance~'#3'~ } + { Collection instance~'#3'~(from~collection~'#2')~ } + of~object~type~'#1' + \quark_if_no_value:NF #4 + { ~(from~template~'#4')~ } + has~values: + } % \end{macrocode} -% +% % \subsection{User functions} % % The user functions provided by \pkg{xtemplate} are pretty much direct % copies of internal ones. However, by sticking to the \pkg{xparse} % approach only the appropriate arguments are long. -% +% % \begin{macro}{\DeclareObjectType} % \begin{macro}{\DeclareTemplateInterface} % \begin{macro}{\DeclareTemplateCode} |