ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: parsing custom syntax in lua
Date: Tue, 31 Aug 2010 11:05:02 +0200	[thread overview]
Message-ID: <584738E3-D5E1-40CA-8280-071926368352@gmail.com> (raw)
In-Reply-To: <AANLkTikSo11B0WfbaU9aoq7VtvfhLEy=ZQiuPaQPDjeq@mail.gmail.com>


Am 31.08.2010 um 11:01 schrieb Vianney le Clément:

> Hello,
> 
> What is the best way to pass verbatim text to lua for processing? I
> would like to write a lua parser for non-TeX text with a custom syntax
> (could be something like Markdown for instance). The interface would
> be
> 
>    \startMyFormat
>    % custom syntax %
>    \stopMyFormat
> 
>    \processMyFormatfile[external file.custom]  % alternative
> 
> The text between \startMyFormat and \stopMyFormat or the text read
> from the external file should be passed as one utf8-encoded string to
> a lua function. Any ideas on how to write these macros?
> 
> On a side note, does anyone know of a quick way to strip diacritical
> marks from utf8-encoded strings in lua (i.e., transform them to pure
> ascii)?


Take a look at this module: http://github.com/adityam/filter

You can find examples here: http://randomdeterminism.wordpress.com/

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


  reply	other threads:[~2010-08-31  9:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-31  9:01 Vianney le Clément
2010-08-31  9:05 ` Wolfgang Schuster [this message]
2010-08-31  9:16   ` Vianney le Clément

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=584738E3-D5E1-40CA-8280-071926368352@gmail.com \
    --to=schuster.wolfgang@googlemail.com \
    --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).