I've seen the alternative keyword used throughout ConTeXt:
\setuppagenumbering[alternative=doublesided]\setupheads[alternative=inmargin]\setuplist[section][alternative=d]
I assumed that it was just a popular keyword: an enumeration hardcoded into each macro definition, like:
def setuplist(alternative="a", ...):
if alternative == "a":
doAlternativeA
elif alternative == "b":
doAlternativeB
elif alternative == "c":
doAlternativeC
elif alternative == "d":
doAlternativeD
However the answer to ConTeXt: avoid enumeration items across pages defines a completely new alternative. This implies that alternatives in ConTeXt are a generic macro hook rather than per-macro keywords.
\defineuserdataalternative
[itemize]
[renderingsetup=userdata:itemize]
\defineuserdata [item] [alternative=itemize]
So what does the alternative keyword mean? At what stage is it used or called? What is its scope; what does it do?
Then there is the renderingsetup keyword for which I have the same questions. Is it specific to only a subset of ConTeXt macros or is it a generic macro hook? I assume it allows modification of the underlying TeX code before page rendering starts. How does that differ from the usual command= keyword? Why must it be defined via an alternative rather than directly?
command=. If a module defines additional commands, those commands can be used simply by knowing the new names... Perhaps alternatives provides a more consistent interface? I've only seen rendering setups access content via\getinlineuserdata. Commands aren't as uniform. Some apply to the entire environment (\setupitemize), some apply to specific elements of the environment. Some are passed content via parameters (\setuppagenumbering) but most don't have access. – user19087 Dec 06 '18 at 04:51strc-ren.mkiv. – Henri Menke Dec 06 '18 at 07:57