Skip to content

Commit

Permalink
Add a hook for additional demo work
Browse files Browse the repository at this point in the history
Useful for beamer.
  • Loading branch information
josephwright committed Dec 9, 2017
1 parent 976e579 commit 14b585b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions l3build.dtx
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions l3build.lua
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 14b585b

Please sign in to comment.