%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 Typesetting 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.

% \enabletrackers[builders.hpack.overflow]
% \enabletrackers[builders.hpack.quality]
% \enabletrackers[builders.vpack.quality]

% \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]%
  {\clf_defineparbuilder{#1}}

\unexpanded\def\startparbuilder[#1]%
  {\ifhmode\par\fi
   \clf_startparbuilder{#1}}

\unexpanded\def\stopparbuilder
  {\ifhmode\par\fi
   \clf_stopparbuilder}

\unexpanded\def\setmainparbuilder[#1]%
  {\clf_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

\unexpanded\def\enableparbuilders {\clf_enableparbuilder } % hooks in otr so we need to pickup
\unexpanded\def\disableparbuilders{\clf_disableparbuilder} % hooks in otr so we need to pickup

\protect \endinput
