Hello ConTeXist.
Is there any possibility or modifications that will allow to savebuffer to work, so that will add (merge) the buffer contents into a file (Which content of the previous buffer)?
For inspiration, it is possible use a solution that wrote before year ago Wolfgang for Lukas Prochazka – ie
https://mailman.ntg.nl/pipermail/ntg-context/2016/087657.html
Thanx
Jaroslav Hajtmar
Here is source code of Wolfgangs solution:
\unexpanded\def\startcontentexport
{\dosingleempty\dostartcontentexport}
\def\dostartcontentexport[#1]%
{\iffirstargument
\edef\contentexportfile{#1}%
\else
\let\contentexportfile\empty
\fi
\grabbufferdata[contentexport][startcontentexport][stopcontentexport]}
\def\stopcontentexport
{\doifsomething{\contentexportfile}{\savebuffer[list=contentexport,prefix=no,file=\contentexportfile]}%
\getbufferdata[contentexport]}
\starttext
A
\startcontentexport[Test.mkiv]
Basic content …
\startitemize
\item Item
\stopitemize
\stopcontentexport
B
\startcontentexport[Test.mkiv]
Add this text into Test.mkiv file
\startitemize
\item Item
\stopitemize
\stopcontentexport
C
\startcontentexport[Test.mkiv]
And this text add into Test.mkiv file too.
\startitemize
\item Item
\stopitemize
\stopcontentexport
\stoptext