ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* parsing custom syntax in lua
@ 2010-08-31  9:01 Vianney le Clément
  2010-08-31  9:05 ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Vianney le Clément @ 2010-08-31  9:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: parsing custom syntax in lua
  2010-08-31  9:01 parsing custom syntax in lua Vianney le Clément
@ 2010-08-31  9:05 ` Wolfgang Schuster
  2010-08-31  9:16   ` Vianney le Clément
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2010-08-31  9:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: parsing custom syntax in lua
  2010-08-31  9:05 ` Wolfgang Schuster
@ 2010-08-31  9:16   ` Vianney le Clément
  0 siblings, 0 replies; 3+ messages in thread
From: Vianney le Clément @ 2010-08-31  9:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, Aug 31, 2010 at 11:05, Wolfgang Schuster
<schuster.wolfgang@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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-31  9:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-31  9:01 parsing custom syntax in lua Vianney le Clément
2010-08-31  9:05 ` Wolfgang Schuster
2010-08-31  9:16   ` Vianney le Clément

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).