1
2
3
4
5
6
7
8
9
10
11
12
13
14\startmodule[presentcommon]
15
16\startluacode
17
18
19
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 |