Great, that's it! Thank you.

Best regards,

Lukas


On Fri, 02 Dec 2016 20:04:56 +0100, Wolfgang Schuster 
<schuster.wolfg...@gmail.com> wrote:

Procházka Lukáš Ing. <mailto:l...@pontex.cz>
2. Dezember 2016 um 08:10
Hello,

is there a way to let ConTeXt to flush the input stream in parallel
into an output buffer, like:

----
\starttext

A

\startoutput{Test.mkiv}
  Hello!
  \startitemize
    \item Item
  \stopitemize
\stopoutput

B

\stoptext
----

which would produce:

---- Test.mkiv
  Hello!
  \startitemize
    \item Item
  \stopitemize
----
You can use a buffer to store content and save it in a external file.

\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]
   Hello!
   \startitemize
     \item Item
   \stopitemize
\stopcontentexport

B

\stoptext

Wolfgang



--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.      | mailto:pon...@pontex.cz | http://www.pontex.cz | 
IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751 (+420 720 951 172)
Fax: +420 244 461 038

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to