In ConTeXt, is it possible to use modes to extract only parts of a document, say only the exercises?
My naive try was
\defineenumeration[exercise][
before={\startmode[Quest]\blank[line]},
after={\blank[line]\stopmode},
]
\starttext
\input knuth
\startexercise
\input tufte
\stopexercise
\input knuth
\stoptext
but that does not even compile. What I would ultimately like to have:
Running context file.tex
I get the full document.
Running context --mode=Quest file.tex
I get only the exercises (that are defined in the enumeration exercise).
I would also like, if possible, not have to type \startmode
and \stopmode
at every instance where the exercises appear.
\startmode
?