[latex3-commits] [latex3/latex2e] l3sys-query: add examples section (f2522e6f)

github at latex-project.org github at latex-project.org
Thu Mar 14 01:29:05 CET 2024


Repository : https://github.com/latex3/latex2e
On branch  : l3sys-query
Link       : https://github.com/latex3/latex2e/commit/f2522e6f6fe92607ae28d1abd97a44f74974f478

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

commit f2522e6f6fe92607ae28d1abd97a44f74974f478
Author: David Carlisle <d.p.carlisle at gmail.com>
Date:   Thu Mar 14 00:29:05 2024 +0000

    add examples section


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

f2522e6f6fe92607ae28d1abd97a44f74974f478
 required/tools/l3sys-query.dtx | 33 ++++++++++++++++++++++++++-------
 1 file changed, 26 insertions(+), 7 deletions(-)

diff --git a/required/tools/l3sys-query.dtx b/required/tools/l3sys-query.dtx
index ac20e2c6..d2e07716 100644
--- a/required/tools/l3sys-query.dtx
+++ b/required/tools/l3sys-query.dtx
@@ -83,11 +83,15 @@
 %
 % A document level interface is provided by this \pkg{l3sys-query} package.
 % This provides an interface based on \pkg{l3keys} that  allows the options to be
-% specified and checked individually. Internally the supplyed key values are used to build up
+% specified and checked individually. Internally the supplied key values are used to build up
 % the arguments to the commands described above in \ref{sec:expl3}
 %
 % The package just provides three commands.
 %
+% Results containing path separators \emph{always}
+% use~|/|, irrespective of the platform in use.
+% 
+%
 % \begin{function}
 %   {\QueryWorkingDirectory}
 %   \begin{syntax}
@@ -103,9 +107,9 @@
 %     \cs{QueryFiles} \oarg{options} \Arg{spec} \Arg{function}
 %     \cs{QueryFilesTF} \oarg{options} \Arg{spec} \Arg{function} \Arg{pre code} \Arg{empty list code}
 %   \end{syntax}
-%   This generates a file list  based on the \meta{spec} and \meta{options}
-%   the options then applies \meta{function}  to each item in the sequence of filenames..
-%   The \meta{function} should be a macro body which will be passed the file path as  |#1|.
+%   This generates a file list  based on the \meta{spec} and \meta{options}.
+%   The command then applies \meta{function}  to each item in the sequence of filenames.
+%   The \meta{function} should be a macro body which will be passed the file path as |#1|.
 % 
 %  The TF version executes the T (\meta{pre code}) argument before iterating over the list
 %  and the F (\meta{empty list code}) argument if the list is empty.
@@ -113,10 +117,12 @@
 % 
 %  Note that this interface in mapping directly over the sequence of
 %  filenames does not allow some uses which are provided by the
-%  programming interface described in the previous section, which allows
+%  programming interface described in the following section, which allows
 %  the sequence to be manipulated before being used.
 % 
-%  The defined keys map vey closely to the options of the \texttt{l3sys-query} command.
+%  The defined keys map vey closely to the options of the
+%  \texttt{l3sys-query} command which is described in
+%  section~\ref{sec:lua}.
 % 
 %  \begin{itemize}
 %  \item 
@@ -144,8 +150,21 @@
 %  which may be especially useful if the \texttt{pattern} key is used
 %  as \% is the escape character in Lua patterns.
 %  
+%  \subsection{Examples\label{sec:examples2e}}
 %
+%  \begin{itemize}
+%  \item 
+%  Include every |png| file in the current directory.
+% \begin{verbatim}
+% \QueryFiles{*.png}{\includegraphics{#1}\par}
+% \end{verbatim}
 %
+% \item
+%  Input every \TeX\ file with a filename matching \texttt{chapter[0-9].tex}.
+% \begin{verbatim}
+% \QueryFiles[pattern]{chapter%d.*%.tex}{\input{#1}}
+% \end{verbatim}
+%  \end{itemize}
 %
 % \section{The L3 programming layer interface\label{sec:expl3}}
 % 
@@ -179,7 +198,7 @@
 %   to contain one entry for each line returned by \texttt{l3sys-query}.
 % \end{function}
 % 
-% \section{The \texttt{l3sys-query} Lua script}
+% \section{The \texttt{l3sys-query} Lua script\label{sec:lua}}
 % \subsection{The command line interface}
 % 
 % The command line interface to 





More information about the latex3-commits mailing list.