s-present-common.mkiv /size: 1291 b    last modification: 2020-07-01 14:35
1%D \module
2%D   [      file=s-present-common,
3%D        version=2016.10.20,
4%D          title=\CONTEXT\ Style File,
5%D       subtitle=Presentation Common Helpers,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14\startmodule[present-common]
15
16\startluacode
17
18    -- sources               -> presentations
19    -- tex/context/base/mkiv -> doc/context/presentations
20
21    function commands.inputpresentationfile(name)
22        local mkivpath = file.pathpart(resolvers.findfile("context.mkiv"))
23        local filename = file.join(mkivpath,"../presentations",name)
24        if lfs.isfile(filename) then
25            context.input(filename)
26            return
27        end
28        filename = file.join(mkivpath,"../../../../doc/context/presentations",name)
29        if lfs.isfile(filename) then
30            context.input(filename)
31            return
32        end
33        context.starttext()
34        context.formatted.type("missing file: %s",name)
35        context.stoptext()
36    end
37
38\stopluacode
39
40\unexpanded\def\inputpresentationfile#1%
41  {\ctxcommand{inputpresentationfile("#1")}}
42
43\stopmodule
44