[NTG-context] parsing custom syntax in lua

2010-08-31 Thread 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)?

Thanks,
Vianney
___
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
___


Re: [NTG-context] parsing custom syntax in lua

2010-08-31 Thread Wolfgang Schuster

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
___


Re: [NTG-context] parsing custom syntax in lua

2010-08-31 Thread Vianney le Clément
On Tue, Aug 31, 2010 at 11:05, Wolfgang Schuster
schuster.wolfg...@googlemail.com wrote:
 Take a look at this module: http://github.com/adityam/filter

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

 Wolfgang

Thanks Wolfgang, that module does indeed seem very interesting and do
something related to my problem. I'll dig into it.

Vianney
___
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
___