
\usemodule[filter]

\traceexternalfilters

\defineexternalfilter
   [ASY]
   [
     filter={asy -tex "context" -outformat pdf
             -outname \externalfilteroutputfile},
     output=\externalfilterbasefile.pdf,
     cache=yes,
     readcommand=\ReadImage,
   ]

\define[1]\ReadImage{\externalfigure[#1]}

\starttext

Testing if we can include an asymptote image
\startplacefigure[location={here}, title={An Asymptote figure}]
\startASY
  unitsize(2cm);
  draw((0,0)--(2,2),red);
\stopASY
\stopplacefigure

\stoptext

