1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22\startmodule[referencesidentify]
23
24\startluacode
25
26moduledata.references = moduledata.references or { }
27
28local context = context
29local NC, NR = context.NC, context.NR
30local bold = context.bold
31local text = context
32
33function moduledata.references.show(str)
34 local t = structures.references.identify(str)
35 context.starttabulate { "|T|T|T|" }
36 for i=1,#t do
37 if i == 1 then
38 context.FL()
39 else
40 context.ML()
41 end
42 local ti = t[i]
43 NC() bold(i) NC() bold("reference") NC() bold(ti.reference) NC() NR()
44 NC() NC() text("kind") NC() text(ti.kind) NC() NR()
45 NC() NC() text("operation") NC() text(ti.operation) NC() NR()
46 NC() NC() text("arguments") NC() text(ti.arguments) NC() NR()
47 NC() NC() text("special") NC() text(ti.special) NC() NR()
48 end
49 context.LL()
50 context.stoptabulate()
51end
52
53\stopluacode
54
55\installmodulecommandluasingle \showreference {moduledata.references.show}
56
57\stopmodule
58
59\continueifinputfile{sreferencesidentify.mkiv}
60
61\usemodule[art01]
62
63\starttext
64
65 \showreference[page(123),StartMovie{mymovie}]
66 \showreference[JS(ForgetChanges),CloseDocument]
67 \showreference[manual::contents]
68
69\stoptext
70 |