[latex3-commits] [git/l3build] demotasks: Add a hook for additional demo work (14b585b)
Joseph Wright
joseph.wright at morningstar2.co.uk
Sat Dec 9 20:43:08 CET 2017
Repository : https://github.com/latex3/l3build
On branch : demotasks
Link : https://github.com/latex3/l3build/commit/14b585b8ca2b1b62a4145016e3a53c7eab4c1ada
>---------------------------------------------------------------
commit 14b585b8ca2b1b62a4145016e3a53c7eab4c1ada
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.
>---------------------------------------------------------------
14b585b8ca2b1b62a4145016e3a53c7eab4c1ada
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 a80d32a..647bf0a 100644
--- a/l3build.lua
+++ b/l3build.lua
@@ -2123,6 +2123,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)
@@ -2145,6 +2150,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