grph-epd.lua /size: 1777 b    last modification: 2020-07-01 14:35
1
if
not
modules
then
modules
=
{
}
end
modules
[
'
grph-epd
'
]
=
{
2
version
=
1
.
001
,
3
comment
=
"
companion to grph-epd.mkiv
"
,
4
author
=
"
Hans Hagen, PRAGMA-ADE, Hasselt NL
"
,
5
copyright
=
"
PRAGMA ADE / ConTeXt Development Team
"
,
6
license
=
"
see context related readme files
"
7
}
8 9
local
variables
=
interfaces
.
variables
10
local
settings_to_hash
=
utilities
.
parsers
.
settings_to_hash
11
local
codeinjections
=
backends
.
pdf
.
codeinjections
12 13
local
trace
=
false
trackers
.
register
(
"
figures.merging
"
,
function
(
v
)
trace
=
v
end
)
14 15
local
report
=
logs
.
reporter
(
"
backend
"
,
"
merging
"
)
16 17
local
function
mergegoodies
(
optionlist
)
18
local
options
=
settings_to_hash
(
optionlist
)
19
local
yes
=
options
[
variables
.
yes
]
20
local
all
=
options
[
variables
.
all
]
21
if
next
(
options
)
then
22
report
(
"
% t
"
,
table
.
sortedkeys
(
options
)
)
23
end
24
if
all
or
yes
or
options
[
variables
.
reference
]
then
25
codeinjections
.
mergereferences
(
)
26
end
27
if
all
or
options
[
variables
.
comment
]
then
28
codeinjections
.
mergecomments
(
)
29
end
30
if
all
or
yes
or
options
[
variables
.
bookmark
]
then
31
codeinjections
.
mergebookmarks
(
)
32
end
33
if
all
or
options
[
variables
.
field
]
then
34
codeinjections
.
mergefields
(
)
35
end
36
if
all
or
options
[
variables
.
layer
]
then
37
codeinjections
.
mergeviewerlayers
(
)
38
end
39
codeinjections
.
flushmergelayer
(
)
40
end
41 42
function
figures
.
mergegoodies
(
optionlist
)
43
-- todo: we can use runtoks instead
44
context
.
stepwise
(
function
(
)
45
-- we use stepwise because we might need to define symbols
46
-- for stamps that have no default appearance
47
mergegoodies
(
optionlist
)
48
end
)
49
end
50 51
interfaces
.
implement
{
52
name
=
"
figure_mergegoodies
"
,
53
actions
=
figures
.
mergegoodies
,
54
arguments
=
"
string
"
55
}
56