blob: 70c9c12e34c35335610b9ea2b93a421ab5995cc4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
%D \module
%D [ file=cldf-int,
%D version=2019.01.01,
%D title=\CONTEXT\ Data Macros,
%D subtitle=Integer,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
\writestatus{loading}{ConTeXt Lua Documents / Initialization}
\newcount\trialtypesettingstate % gets aliased at the Lua end
\registerctxluafile{cldf-ini}{autosuffix}
%D With each new update of \MKIV\ we can join Within Temptation in singing:
%D
%D \startbuffer
%D \startluacode
%D context("I go faster%s",string.rep(" and faster",6))
%D \stopluacode
%D
%D \cldcontext{"I go faster\letterpercent s",
%D string.rep(" and faster",6)}
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D Anyway \unknown\ the following are {\em not} user commands:
% \zerocount removes as it's the default
% \def\cldf#1{\directlua{_cldf_(#1)}} % global (functions)
% \def\cldn#1{\directlua{_cldn_(#1)}} % global (nodes)
%
% \ifx\luafunction\undefined
% \def\luafunction#1{\directlua{_cldl_(#1)}}
% \fi
\let\cldl\luafunction
\let\cldd\lateluafunction
% \catcode`=\activecatcode \let\luafunction % saves 10% on the call
% \catcodetable\ctxcatcodes \catcode`^=\superscriptcatcode\catcode1=\activecatcode \glet^^A=\cldf
% \catcodetable\ctxcatcodes \catcode`^=\superscriptcatcode\catcode2=\activecatcode \glet^^B=\cldn
\protected\def\cldprocessfile#1{\directlua{context.runfile("#1")}}
\def\cldloadfile #1{\directlua{context.loadfile("#1")}}
\def\cldloadviafile#1{\directlua{context.loadviafile("#1")}}
\def\cldcontext #1{\directlua{context(#1)}}
\def\cldcommand #1{\directlua{context.#1}}
% \def\cldverbatim #1{\directlua{context.verbatim.#1}} % maybe make verbatim global
\endinput
|