summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/typo-bld.mkiv
blob: 10502005b9a7813095f6c8e3a4f5892d4a10ac45 (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
60
61
62
63
64
%D \module
%D   [       file=typo-bld, % was node-par,
%D        version=2008.09.30,
%D          title=\CONTEXT\ Typesetting Macros,
%D       subtitle=Paragraph Building,
%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 Node Macros / Paragraph Building}

%D This is very experimental, undocumented, subjected to changes, etc. just as
%D the underlying interfaces. But at least it's cleaned as part of the status-mkiv
%D cleanup.

% \startparbuilder[default]
%     \input tufte \par
%     \startparbuilder[oneline]
%         \input tufte \par
%     \stopparbuilder
%     \input tufte \par
% \stopparbuilder
%
% \startparbuilder[oneline]
%     \dorecurse{100}{\input ward \par}
% \stopparbuilder

\unprotect

\registerctxluafile{typo-bld}{1.001}

\definesystemattribute[parbuilder][public]

\installcorenamespace {parbuilder}

\unexpanded\def\defineparbuilder[#1]%
  {\ctxcommand{defineparbuilder("#1")}}

\unexpanded\def\startparbuilder[#1]%
  {\ifhmode\par\fi
   \ctxcommand{startparbuilder("#1")}}

\unexpanded\def\stopparbuilder
  {\ifhmode\par\fi
   \ctxcommand{stopparbuilder()}}

\unexpanded\def\setmainparbuilder[#1]%
  {\ctxcommand{setparbuilder("#1")}}

% no high level interface, after all implementing a linebreaker is not something that
% the average user will do

\defineparbuilder[default] % just for testing
\defineparbuilder[oneline] % just for testing
\defineparbuilder[basic]   % just for testing

\def\enableparbuilders {\ctxcommand{enableparbuilder()}}  % hooks in otr so we need to pickup
\def\disableparbuilders{\ctxcommand{disableparbuilder()}} % hooks in otr so we need to pickup

\protect \endinput