ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Kevin D. Robbins" <krobbins@alumni.princeton.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Example of passing unexpanded text between \startfoo ... \stopfoo into Lua?
Date: Tue, 30 Jun 2009 09:02:30 -0600	[thread overview]
Message-ID: <f5d0b64b0906300802x372af4a0t280d23afd9478144@mail.gmail.com> (raw)
In-Reply-To: <68736D61-A4DD-4A68-94CE-E25ACC5F6BAE@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1853 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 2883 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

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

  reply	other threads:[~2009-06-30 15:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-18 16:21 Kevin D. Robbins
2009-06-18 16:53 ` Wolfgang Schuster
2009-06-30 15:02   ` Kevin D. Robbins [this message]
2009-06-19  9:49 ` Matthijs Kooijman
2009-06-30 15:13   ` Kevin D. Robbins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f5d0b64b0906300802x372af4a0t280d23afd9478144@mail.gmail.com \
    --to=krobbins@alumni.princeton.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).