From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/61377 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Vianney_le_Cl=E9ment?= Newsgroups: gmane.comp.tex.context Subject: parsing custom syntax in lua Date: Tue, 31 Aug 2010 11:01:18 +0200 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1283245310 1982 80.91.229.12 (31 Aug 2010 09:01:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 31 Aug 2010 09:01:50 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Aug 31 11:01:48 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OqMiy-0000qB-8Q for gctc-ntg-context-518@m.gmane.org; Tue, 31 Aug 2010 11:01:48 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8F445CA6B5; Tue, 31 Aug 2010 11:01:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id S0FourSi0kY0; Tue, 31 Aug 2010 11:01:44 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5F9DACA6AF; Tue, 31 Aug 2010 11:01:44 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E6E5BCA6AF for ; Tue, 31 Aug 2010 11:01:42 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id VjRvZ0ae79IK for ; Tue, 31 Aug 2010 11:01:40 +0200 (CEST) Original-Received: from filter5-til.mf.surf.net (filter5-til.mf.surf.net [194.171.167.221]) by balder.ntg.nl (Postfix) with ESMTP id ADE70CA6A2 for ; Tue, 31 Aug 2010 11:01:40 +0200 (CEST) Original-Received: from mail-qy0-f169.google.com (mail-qy0-f169.google.com [209.85.216.169]) by filter5-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o7V91d0L012561 for ; Tue, 31 Aug 2010 11:01:40 +0200 Original-Received: by qyk12 with SMTP id 12so4810954qyk.14 for ; Tue, 31 Aug 2010 02:01:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=ARW2poArb0nxlDvAkDKMOSDV6BYilutNS06O1ntMIa0=; b=qqQR6VSHu530q03pW/dwD8DGUaoWfOFuprvsEQM3YUIlSYEO3V2o2beJm/rJGlPfVz jj6z+831OSsWpdfQ9r4BUQNM2tJLKgv8WkTbu9qckiuoVqK9slXXobUgsMxTcZknjtVA Gi2n3lzpvmy/hDUrhhkwjhN7ETOXzxPuQ/rAI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=m5oE/CW9uhCYAkv1Ar4fu/b6S+ooU+fmbN8VRQ2MngwQ9KOj1wsJVfBCltwQf2Tzej s6ihRUHo9V6sVw/J7l6/42Uao3rFAtisH8jYvn95BZfha8NP2tR2OLNTCBwi025THxRI aaNtrOrtyBN6bQx10+RfUMvkkkv6opV1htPoQ= Original-Received: by 10.224.105.76 with SMTP id s12mr3700568qao.295.1283245299097; Tue, 31 Aug 2010 02:01:39 -0700 (PDT) Original-Received: by 10.229.189.15 with HTTP; Tue, 31 Aug 2010 02:01:18 -0700 (PDT) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.216.169; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0xD0V1Dpk - 60b6796ca67d - 20100831 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.221 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:61377 Archived-At: 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 ___________________________________________________________________________________