%D \module
%D   [       file=typo-plc,
%D        version=2020.07.01,
%D          title=\CONTEXT\ Typesetting Macros,
%D       subtitle=Placeholders,
%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 / Placeholders}

\unprotect

\installcorenamespace {placeholder}

\installcommandhandler \??placeholder {placeholder} \??placeholder

\permanent\tolerant\protected\def\placeholder[#1]%
  {\begingroup
   \cdef\currentplaceholder{#1}%
   \placeholderparameter\c!before
   \dostarttagged\t!placeholder\currentplaceholder
   \useplaceholderstyleandcolor\c!style\c!color
   \ifcstok{\placeholderparameter\c!text}\emptytoks
     \ifempty{#1}\unknown\else#1\fi
   \else
     \lastnamedcs
   \fi
   \dostoptagged
   \placeholderparameter\c!after
   \endgroup}

\defineplaceholder
  [todo]
 %[\c!text={Still to be written!},
  [\c!text=todo, % labeltext ?
   \c!style=\v!bold,
   \c!before=\blank,
   \c!after=\blank]

\protect \endinput
