back-ini.mkxl /size: 2604 b    last modification: 2020-07-01 14:35
1
%D \module
2
%D [ file=back-ini,
3
%D version=2009.04.15,
4
%D title=\CONTEXT\ Backend Macros,
5
%D subtitle=Initialization,
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
\writestatus
{
loading
}{
ConTeXt
Backend
Macros
/
Initialization
}
15 16
\registerctxluafile
{
back
-
ini
}{}
17 18
\unprotect
19 20
%D Right from the start \CONTEXT\ had a backend system based on runtime pluggable
21
%D code. As most backend issues involved specials and since postprocessors had not
22
%D that much in common, we ended up with a system where we could switch backend as
23
%D well as output code for multiple backends at the same time.
24
%D
25
%D Because \LUATEX\ has the backend built in, and since some backend issues have
26
%D been moved to the frontend I decided to provide new backend code for \MKIV,
27
%D starting with what was actually used.
28
%D
29
%D At this moment \DVI\ is no longer used for advanced document output and we
30
%D therefore dropped support for this format. Future versions might support more
31
%D backends again, but this has a low priority.
32 33
%D The exact page model depends on the backend so we just define some variables that
34
%D are used. A helper at the \LUA\ end will synchronize with the internal variables.
35
%D We store these in the format.
36 37
\ifdefined
\everybackendshipout
\else
\newtoks
\everybackendshipout
\fi
38
\ifdefined
\everylastbackendshipout
\else
\newtoks
\everylastbackendshipout
\fi
39
\ifdefined
\everybackendlastinshipout
\else
\newtoks
\everybackendlastinshipout
\fi
40 41
\installcorenamespace
{
backend
}
42 43
\installsetuponlycommandhandler
\??backend
{
backend
}
44 45
%D \starttyping
46
%D \setupbackend[space=yes]
47
%D \stoptyping
48 49
\appendtoks
50
\clf_setrealspaces
{
\backendparameter
\c!space
}
%
51
\to
\everysetupbackend
52 53
\appendtoks
54
\ifdefined
\clf_resetmapfile
55
\clf_resetmapfile
56
\fi
57
\to
\everysetupbackend
58 59
%D For the moment this is an experiment (defauls is pdf, but we also
60
%D have lua, json and mps).
61
%D
62
%D \starttyping
63
%D % \setupoutput[lua]
64
%D % \setupoutput[json]
65
%D % \setupoutput[mps]
66
%D % \setupoutput[none] % for testing only
67
%D % \setupoutput[empty] % for testing only
68
%D
69
%D \starttext
70
%D \dorecurse{1000}{
71
%D {\tf \red \samplefile{tufte}} \par
72
%D {\bf \green \samplefile {ward}} \par
73
%D {\sl \blue \samplefile{davis}} \par
74
%D }
75
%D \stoptext
76
%D \stoptyping
77 78
\unexpanded
\def
\setupoutput
[#
1
]
%
79
{
\clf_enabledriver
{
#
1
}}
80 81
\protect
\endinput
82