Open main menu

Changes

1,980 bytes added ,  17:55, 6 September 2020
Created page with "Documentation for \definebuffer"
<cd:commandgroup name="definebuffer" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
<cd:shortdesc><!-- a short command summary goes here -->
The command <tt>\definebuffer</tt> defines a named buffer class.
</cd:shortdesc>
<cd:variants>
<cd:command category="buffer" file="buff-ini.mkiv" interfacedate="2020-07-14T09:24" interfacefile="i-buffer.xml" level="style" name="definebuffer" variantnumber="1">
<cd:arguments>
<cd:keywords ordinal="1">
<cd:keywordsdoc>Name of the new buffer class</cd:keywordsdoc>
<cd:constant type="cd:name"></cd:constant>
</cd:keywords>
<cd:keywords optional="yes" ordinal="2">
<cd:keywordsdoc>Optional buffer class to inherit from</cd:keywordsdoc>
<cd:constant type="cd:buffer"></cd:constant>
</cd:keywords>
<cd:assignments list="yes" optional="yes" ordinal="3">
<cd:assignmentsdoc></cd:assignmentsdoc>
<cd:inherit name="setupbuffer"></cd:inherit>
</cd:assignments>
</cd:arguments>
</cd:command>
</cd:variants>
<cd:description>Named buffer classes replace the default buffer commands with special versions wherein the <code>buffer</code> part is replaced by your desired command.

On the downside, these newly defined buffers do not support an optional argument like {{cmd|startbuffer}} does.</cd:description>
<cd:examples><cd:example title=""><context source="yes" text="gives">
\definebuffer[mybuffer]

\startmybuffer
Arbitrary content for my buffer
\stopmybuffer

Some more text

\getmybuffer

\typemybuffer

</context></cd:example></cd:examples>
<cd:notes></cd:notes>
<cd:seealso>
<cd:commandref name="setupbuffer" originator="system"></cd:commandref>
<cd:source file="buff-ini.mkiv" originator="system"></cd:source>
<cd:wikipage originator="system" page="Category:Buffer"></cd:wikipage>
<cd:commandref name="_startbuffer"></cd:commandref>
<cd:commandref name="_getbuffer"></cd:commandref>
<cd:commandref name="_typebuffer"></cd:commandref></cd:seealso>
</cd:commandgroup>