[latex3-commits] [git/LaTeX3-latex3-latex2e] prototype: Add some basic template "show" code (b5d8262d)

Joseph Wright joseph.wright at morningstar2.co.uk
Tue Mar 8 23:09:53 CET 2022


Repository : https://github.com/latex3/latex2e
On branch  : prototype
Link       : https://github.com/latex3/latex2e/commit/b5d8262de5bcba524da7515c0e55a0ab59d05c8c

>---------------------------------------------------------------

commit b5d8262de5bcba524da7515c0e55a0ab59d05c8c
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Tue Mar 8 22:09:53 2022 +0000

    Add some basic template "show" code


>---------------------------------------------------------------

b5d8262de5bcba524da7515c0e55a0ab59d05c8c
 required/latex-lab/latex-lab-prototype.dtx | 50 ++++++++++++++++++++++++++----
 1 file changed, 44 insertions(+), 6 deletions(-)

diff --git a/required/latex-lab/latex-lab-prototype.dtx b/required/latex-lab/latex-lab-prototype.dtx
index 2a4efbdb..eebd4666 100644
--- a/required/latex-lab/latex-lab-prototype.dtx
+++ b/required/latex-lab/latex-lab-prototype.dtx
@@ -300,12 +300,20 @@
 %   be used once.
 % \end{function}
 %
-% \section{Per-use overriding of template settings}
-%
-% The key settings for a template or instance can be overridden using
-% \cs{keys_set:nn} with the key path
-% \texttt{prototype/\meta{object}/\meta{template}}. This will likely occur
-% immediately after the start of the template code.
+% \section{Showing template information}
+%
+% \begin{function}
+%   {
+%     \prototype_show_template_code:nn     ,
+%     \prototype_show_template_defaults:nn ,
+%     \prototype_show_instance_values:nn
+%   }
+%   \begin{syntax}
+%     \cs{prototype_show_template_code:nn} \Arg{object type} \Arg{template}
+%     \cs{prototype_show_template_defaults:nn} \Arg{object type} \Arg{template}
+%     \cs{prototype_show_instance_values:nn} \Arg{object type} \Arg{instance}
+%   \end{syntax}
+% \end{function}
 %
 % \end{documentation}
 %
@@ -500,6 +508,36 @@
 % \end{macro}
 % \end{macro}
 %
+% \subsection{Showing information}
+%
+% \begin{macro}
+%   {
+%     \prototype_show_template_code:nn     ,
+%     \prototype_show_template_defaults:nn ,
+%     \prototype_show_instance_values:nn
+%   }
+%    \begin{macrocode}
+\cs_new_protected:Npn \prototype_show_template_code:nn #1#2
+  {
+    \prop_if_in:NnTF \l_@@_object_prop {#1}
+      { \cs_show:c { @@_template_ #1 _ #2 :w } }
+      { \msg_error:nnn { prototype } { unknown-object-type } {#1} }
+  }
+\cs_new_protected:Npn \prototype_show_template_defaults:nn #1#2
+  {
+    \cs_if_exist:cTF { @@_template_ #1 _ #2 :w }
+      { \tl_show:c { l_@@_defaults_ #1 _ #2 _tl } }
+      { \msg_error:nnn { prototype } { unknown-template } {#1} {#2} }
+  }
+\cs_new_protected:Npn \prototype_show_instance_values:nn #1#2
+  {
+    \tl_if_exist:cTF { l_@@_instance_ #1 _ #2 _template_tl }
+      { \tl_show:c { l_@@_instance_ #1 _ #2 _pars_tl } }
+      { \msg_error:nnn { prototype } { unknown-instance } {#1} {#2} }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 % \subsection{Messages}
 %
 %    \begin{macrocode}





More information about the latex3-commits mailing list.