%D \module
%D   [       file=strc-flt,
%D        version=2008.10.20,
%D          title=\CONTEXT\ Structure Macros,
%D       subtitle=Initialization \& Helpers,
%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 Structure Macros / Initialization & Helpers}

\registerctxluafile{strc-ini}{}

\unprotect

% segments: 0:100 2:3 chapter:subsection 3 (=self+2)        (alternative: sectionset)

% section   : [sectionnumber(s)]
%             sectionseparatorset (default) sectionconversionset (default) sectionstopper ()  sectionset sectionsegments

% lists     : [sectionnumber(s)] [text] [prefix(es)[separator][pagenumber(s)]
%             sectionseparatorset (default) sectionconversionset (default) sectionstopper     sectionset sectionsegments
%             prefixseparatorset  (default) prefixconversionset  (default) prefixstopper  (.) prefixset  prefixsegments
%             pageseparatorset    (default) pageconversionset    (default) pagestopper    ()             pagesegments
%             prefix (no)

% counter   : [prefix(es)[separator]][number(s)]
%             prefixseparatorset  (default) prefixconversionset  (default) prefixstopper  (.) prefixset  prefixsegments
%             numberseparatorset  (default) numberconversionset  (default) numberstopper  ()             numbersegments
%             prefix (no)

% pagenumber: [prefix(es)[separator]][pagenumber(s)]
%             prefixseparatorset  (default) prefixconversionset  (default) prefixstopper  (.) prefixset  prefixsegments
%             pageseparatorset    (default) pageconversionset    (default) pagestopper    ()
%             prefix (no)

%               text  mark  reference  list
% section       P     P     P          P
% float         P.N         P.N        P.N
% itemize       P.N         P.N
% enumerate     P.N         P.N        P.N
% formula       P.N         P.N
% footnote      P.N         P.N        P.N
% number        P.N         P.N

% number prefix section page

% [text|marking|reference|list]:[number|prefix|pagenumber|pageprefix]:[separatorset|conversionset|conversion|stopper|set|segments|resetset|order]

% figure caption  : text:number:* text:prefix:* -> \setupcaption[figure][...]; stores defaults
% figure list     : list:number:* list:prefix:* list:pagenumber:* list:pageprefix:* -> \setuplist[figure][...]; takes stored defaults for number and pagenumber]
% figure reference: reference:number:* reference:prefix:* reference:pagenumber:* reference:pageprefix:* -> \setupreference[figure]]...]; takes stored defaults

% This module deals with structure: section headers, list and numbering and
% eventually cross referencing. These components are rather interwoven and
% therefore an inbetween layer is used. Eventually this will replace the
% corresponding code in core-sec, core-lst, core-num and core-ref.

% We collect operations that deal with things like formatting on each level of a
% number in sets. This is all handles at the \LUA\ end. References to such sets
% travel with the multipass information.

\permanent\tolerant\protected\def\defineresetset     [#name]#spacer[#set]#spacer[#default]{\clf_definestructureset{structure:resets}     {#name}{\detokenize{#set}}{\detokenize{#default}}true\relax}
\permanent\tolerant\protected\def\defineseparatorset [#name]#spacer[#set]#spacer[#default]{\clf_definestructureset{structure:separators} {#name}{\detokenize{#set}}{\detokenize{#default}}false\relax}
\permanent\tolerant\protected\def\defineconversionset[#name]#spacer[#set]#spacer[#default]{\clf_definestructureset{structure:conversions}{#name}{\detokenize{#set}}{\detokenize{#default}}false\relax}
\permanent\tolerant\protected\def\defineprefixset    [#name]#spacer[#set]#spacer[#default]{\clf_definestructureset{structure:prefixes}   {#name}{\detokenize{#set}}{\detokenize{#default}}false\relax}

\aliased\let\definestructureresetset     \defineresetset
\aliased\let\definestructureseparatorset \defineseparatorset
\aliased\let\definestructureconversionset\defineconversionset
\aliased\let\definestructureprefixset    \defineprefixset

% \defineseparatorset [weird][!,?,*][:]                                  % tex content
% \defineconversionset[weird][numbers,characters,romannumerals][numbers] % symbolic names
% \defineresetset     [weird][0,0,1][0]                                  % numbers

\protect \endinput

