[latex3-commits] [git/l3build] master: Add a hook for additional demo work (610b4ab)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Dec 11 13:55:53 CET 2017


Repository : https://github.com/latex3/l3build
On branch  : master
Link       : https://github.com/latex3/l3build/commit/610b4ab0fe0cd6c5d5aa256f2c418e18d753a164

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

commit 610b4ab0fe0cd6c5d5aa256f2c418e18d753a164
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sat Dec 9 19:18:46 2017 +0000

    Add a hook for additional demo work
    
    Useful for beamer.


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

610b4ab0fe0cd6c5d5aa256f2c418e18d753a164
 l3build.dtx |    7 +++++++
 l3build.lua |    9 +++++++++
 2 files changed, 16 insertions(+)

diff --git a/l3build.dtx b/l3build.dtx
index f774796..f6559fd 100644
--- a/l3build.dtx
+++ b/l3build.dtx
@@ -1146,6 +1146,13 @@
 % apply to a case where multiple \BibTeX{} runs are needed (perhaps where
 % citations can appear within other references).
 %
+% Where there are complex requirements for pre-compiled demonstration
+% files, the hook |typeset_demo_hook()| is available: it runs after
+% copying files to the typesetting location but before the main typesetting
+% run. This may be used for example to script a very large number of
+% demonstrations using a single source (see the \pkg{beamer} package
+% for an example of this).
+%
 % \begin{figure}[!b]
 %   \begin{lstlisting}[frame=single,language={[5.2]Lua},gobble = 6]
 %     #!/usr/bin/env texlua
diff --git a/l3build.lua b/l3build.lua
index 453d0c9..92c0022 100644
--- a/l3build.lua
+++ b/l3build.lua
@@ -2125,6 +2125,11 @@ function bundlectan()
   return errorlevel
 end
 
+-- A hook to allow additional typesetting of demos
+typeset_demo_tasks = typeset_demo_tasks or function()
+  return 0
+end
+
 -- Typeset all required documents
 -- Uses a set of dedicated auxiliaries that need to be available to others
 function doc(files)
@@ -2147,6 +2152,10 @@ function doc(files)
   unpack({sourcefiles, typesetsourcefiles}, {sourcefiledir, docfiledir})
   -- Main loop for doc creation
   local done = {}
+  local errorlevel = typeset_demo_tasks()
+  if errorlevel ~= 0 then
+    return errorlevel
+  end
   for _, typesetfiles in ipairs({typesetdemofiles, typesetfiles}) do
     for _,i in ipairs(typesetfiles) do
       for _, dir in ipairs({unpackdir, typesetdir}) do





More information about the latex3-commits mailing list