Thanks, Wolfgang. My colleague and I are working with the method you suggested, and we'll report back when we've made more progress. We're getting there, but slowly.

We always appreciate your help and the help of others on the mailing list!

Kevin

On Thu, Jun 18, 2009 at 10:53 AM, Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:

Am 18.06.2009 um 18:21 schrieb Kevin D. Robbins:


Hi Hans and others,

I've been searching the mailing list and source code for one or more examples of passing unexpanded text appearing between a \startfoo ... \stopfoo block into Lua, but without luck. Is there such an example you could point me to?


Something like this (if not give us more information)?

\def\startcodeblock
 {\begingroup
  \setcatcodetable\luacatcodes
  \dodoubleempty\dostartcodeblock}

\long\def\dostartcodeblock[#1][#2]#3\stopcodeblock
 {\modulecode{literateprogramming.codeblock([==[#3]==])}%
  \endgroup}

\startmodulecode

literateprogramming = literateprogramming or { }

function literateprogramming.codeblock(content)
   global.print(content)
end

\stopmodulecode

\starttext


\startcodeblock[language=c,file=foo.c, etc.][blockname]
// This is the main routine...
int main()
{
  return 0;
}
\stopcodeblock

\stoptext

Wolfgang

___________________________________________________________________________________
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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________