On Tue, 20 Dec 2016, Jaroslav Hajtmar wrote:

very much for your Metapost example. This I certainly sufficient for the production of simple images for my ideas.

\define[1]\mycircle{
        \startASY
        import graph;
        draw(Circle((0,0),#1));
        \stopASY
}

\starttext
\mycircle{20}
\mycircle{30}
\mycircle{40}
\stoptext

It is already feasible to define something this simple using the filter module. I don't have asymptote installed on the machine that I am currently working on, but here is an example that uses pandoc.

\usemodule[filter]

\defineexternalfilter
    [MARKDOWN]
    [
      filtercommand={pandoc -f markdown -t context 
\externalfilterinputfile\space -o \externalfilteroutputfile},
      cache=yes,
      purge=no, % Just for testing. May be removed.
    ]

\define[1]\TEST
    {\setbuffer[MARKDOWN]This is #1\endbuffer
     \processMARKDOWNbuffer[MARKDOWN]}

\starttext
\startMARKDOWN
  This is **one**
\stopMARKDOWN

\TEST{**ONE**}

\TEST{_TWO_}
\stoptext

With this method, the results are not cached. Let me know if this works for your needs.

Aditya
___________________________________________________________________________________
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