Open main menu

Changes

2,454 bytes added ,  15:26, 18 November 2021
Created page with "Documentation for \selectblocks"
<cd:commandgroup name="selectblocks" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
<cd:shortdesc>The command <tt>\selectblocks</tt> is used for printing blocks
</cd:shortdesc>
<cd:variants>
<cd:command category="structure" file="strc-blk.mkiv" interfacedate="2020-04-24T11:54" interfacefile="i-block.xml" level="document" name="selectblocks" variantnumber="1">
<cd:arguments>
<cd:keywords list="yes" ordinal="1">
<cd:keywordsdoc></cd:keywordsdoc>
<cd:constant type="cd:name"></cd:constant>
</cd:keywords>
<cd:keywords list="yes" optional="yes" ordinal="2">
<cd:keywordsdoc></cd:keywordsdoc>
<cd:constant type="cd:name"></cd:constant>
</cd:keywords>
<cd:assignments list="yes" optional="yes" ordinal="3">
<cd:assignmentsdoc></cd:assignmentsdoc>
<cd:parameter name="criterium">
<cd:paramdoc></cd:paramdoc>
<cd:constant default="yes" type="text"></cd:constant>
<cd:constant type="cd:section"></cd:constant>
</cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
</cd:variants>
<cd:description>Like {{cmd|useblocks}}, prints blocks of type ''block'' tagged with ''tag''; but you can add an argument <code>[criterium=section]</code> to print only blocks defined in the current section. If the tags argument is missing, all blocks of type ''block'' are printed.

</cd:description>
<cd:examples><cd:example title=""><context source="yes" text="This gives:">
\defineblock[myblock]
\hideblocks[myblock]

\starttext

\section{A to B}
\beginmyblock
A is for Amy, who fell down the stairs.
\endmyblock
\beginmyblock
B is for Basil, assaulted by bears.
\endmyblock

\selectblocks[myblock][criterium=section]


\section{C to D}
\selectblocks[myblock][criterium=section]

\beginmyblock
C is for Claire, who wasted away.
\endmyblock
\beginmyblock
D is for Desmond, thrown out of the sleigh.
\endmyblock

\section{All everything}
\selectblocks[myblock]

\stoptext
</context>
</cd:example></cd:examples>
<cd:notes></cd:notes>
<cd:seealso>
<cd:source file="strc-blk.mkiv" originator="system"></cd:source>
<cd:wikipage originator="system" page="Category:Structure"></cd:wikipage>
<cd:commandref name="defineblock">to define a new kind of block.</cd:commandref>
<cd:commandref name="setupblock">to set up block style.</cd:commandref>
<cd:commandref name="keepblocks">to start displaying blocks where they are defined.</cd:commandref></cd:seealso>
</cd:commandgroup>