* \savebuffer to merge of save contents
@ 2017-03-21 12:30 Jaroslav Hajtmar
0 siblings, 0 replies; only message in thread
From: Jaroslav Hajtmar @ 2017-03-21 12:30 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1400 bytes --]
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
[-- Attachment #1.2: Type: text/html, Size: 8219 bytes --]
[-- Attachment #2: Type: text/plain, Size: 492 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-03-21 12:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-21 12:30 \savebuffer to merge of save contents Jaroslav Hajtmar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).