From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32518 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: ThomasH Newsgroups: gmane.text.pandoc Subject: Re: Line number of input file Date: Wed, 3 May 2023 22:56:43 -0700 (PDT) Message-ID: References: <4b09ae5e-99be-4772-b65d-62c5ffe68ccfn@googlegroups.com> <87o7n1c2oy.fsf@zeitkraut.de> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_348_1044841145.1683179803531" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14804"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCOJJAXZ7EPBBHESZWRAMGQEM565TEA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu May 04 07:56:47 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f56.google.com ([209.85.210.56]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1puRxP-0003i9-9r for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 04 May 2023 07:56:47 +0200 Original-Received: by mail-ot1-f56.google.com with SMTP id 46e09a7af769-6a5e616d5d3sf4372047a34.1 for ; Wed, 03 May 2023 22:56:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1683179806; x=1685771806; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=9VdgHTO8GWGqm3meLzB2Jp4sXcJjZKHKYIYyDl6XLEU=; b=o3n9zCYluBh8Lm863P7rWkyHbvxrJHVv5UsaOp5i9U1AZO/R9wB/H3ni8IeBgaVBwJ ht5t/VpRISGXaqj1jxMAZyrlqnRECURyw19DigBI2JB1cHpQ2XGeG+NFx1UfSm1p92QA +jhNbXkvohjU52l1+YS9DhC5vRk7QFXEXC5nm2JrtXloH6H0f3ZCRMwIefLYPIyaUyYX D2RN0a9xE/q+5sI7Y9nqkDwgFGVDDbbiz1B9jdRdujLg2poxgjAG8YC763g/kHedK1oC BRMIXZGFV48eCvUeLaqWfaf9U7a+xrua3bkZJaS7/Y0TXxC/ZskWrTJpxgaP3tv1NiSZ T9eA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683179806; x=1685771806; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=9VdgHTO8GWGqm3meLzB2Jp4sXcJjZKHKYIYyDl6XLEU=; b=hnqddPsnaBVn78ZP7g4rMhfK8GtB4Ucki6kxbBlx1sCZIZZQaGymtgaQgB1ToQaWyS aG3RBJacMjmiFZy7YfLz9KfhwhpPS1R13SpA8GXKb6EM3tfgLirlYBMB4+02PRJgixa2 LFM99sksL54+HhWMYXayCjWC9G32lxDR5O30aR4bu7PT2cWOhdXFr6bgx1I/6xGahhfN V9/wWLadaGm2RoIs06X4XV4hsLQMLzselRJxhX9pS7NV2QGRCFQv0aXFaMWyarAr7v5t XlGsAOzRuYBQpT7+JtQDtKZMn3sWKGGN+sUysI1NZx2p9r8gdLOp2b+8P1VxSG+fwGuA w8vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683179806; x=1685771806; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-sender:mime-version:subject:references:in-reply-to :message-id:to:from:date:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=9VdgHTO8GWGqm3meLzB2Jp4sXcJjZKHKYIYyDl6XLEU=; b=OsOkGglR50JIzoIl/NsMW4cWW78C0PGu4QX9uUq5jdXI8z0Z2Q02SkJxuR23F48Tsu 1cFaCVXz35ocsoR0BrROZVCzr2Xt7+6EDfcaZNXzBb63GMB4GCRA26DX7AdYJzKGY9UR WpRTvet/hc16mFdIGwCdNcOcOO5RFiSMDibcYaQCjEVXNbAaMQQlyROghF9stfzmBWoh ILtypBD+B8V685VuxXwIZeIH7HRc6MJJ/IqC+B/pYRX3xdEx/AXufoG3XegrqcQ9jIho 5e747iCboLcAuz3CvOA+4rs71AJnCMI9e9yyPa89cfjEd6xxJZ Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AC+VfDx9JFqvke8sGAqXbukPm+qEa1ixL31uQvVhsmAmFpNDItVvidWI 4blYAYczd49+M/+2ERoiW5s= X-Google-Smtp-Source: ACHHUZ7zjfSsSQFuvvUGG860pEvsNwWHshBZkb3ggmU82A4zBGJkT5JijiHyrV5iXnC3na+qKOXJ8g== X-Received: by 2002:a05:6830:1e76:b0:6a5:d188:bfb3 with SMTP id m22-20020a0568301e7600b006a5d188bfb3mr6007631otr.5.1683179806196; Wed, 03 May 2023 22:56:46 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6870:8e0c:b0:18e:7c56:c70f with SMTP id lw12-20020a0568708e0c00b0018e7c56c70fls5519539oab.5.-pod-prod-gmail; Wed, 03 May 2023 22:56:44 -0700 (PDT) X-Received: by 2002:a05:6870:1158:b0:179:c3d1:42d0 with SMTP id 24-20020a056870115800b00179c3d142d0mr401845oag.11.1683179804114; Wed, 03 May 2023 22:56:44 -0700 (PDT) In-Reply-To: <87o7n1c2oy.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> X-Original-Sender: therch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:32518 Archived-At: ------=_Part_348_1044841145.1683179803531 Content-Type: multipart/alternative; boundary="----=_Part_349_245904203.1683179803531" ------=_Part_349_245904203.1683179803531 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ah, ok, thanks.=20 On Wednesday, May 3, 2023 at 9:08:22=E2=80=AFAM UTC+2 Albert Krewinkel wrot= e: > > ThomasH writes: > > > Is there a way to get at the current line number of the current input > > file in a Lua filter? > > > > I can get the input file via PANDOC_STATE.input_files alright, but > > what about the input line? > > > > I understand that Lua filters work on Pandoc ASTs, so the raw string > > input is already transformed. I used to save input line numbers with > > AST nodes when I wrote parsers. Is there such facility in Pandoc's > > ASTs? Writing a custom reader? > > The CommonMark parser can be used with the `sourcepos` extension. > Enabling the extension will add positional information via div and span > attributes. The other parsers in pandoc don't have a comparable feature. > > > --=20 > Albert Krewinkel GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124 > --=20 You received this message because you are subscribed to the Google Groups "= pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/e57d7ea9-cdc6-4cad-b23e-babc48283893n%40googlegroups.com. ------=_Part_349_245904203.1683179803531 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ah, ok, thanks.

On Wednesday, May 3, 2023 at 9:08:22=E2=80=AFAM UTC+2 Al= bert Krewinkel wrote:

ThomasH <the...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org= > writes:

> Is there a way to get at the current line number of the current in= put
> file in a Lua filter?
>
> I can get the input file via PANDOC_STATE.input_files alright, but
> what about the input line?
>
> I understand that Lua filters work on Pandoc ASTs, so the raw stri= ng
> input is already transformed. I used to save input line numbers wi= th
> AST nodes when I wrote parsers. Is there such facility in Pandoc&#= 39;s
> ASTs? Writing a custom reader?

The CommonMark parser can be used with the `sourcepos` extension.
Enabling the extension will add positional information via div and span
attributes. The other parsers in pandoc don't have a comparable fea= ture.


--=20
Albert Krewinkel GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/e57d7ea9-cdc6-4cad-b23e-babc48283893n%40googlegroups.= com.
------=_Part_349_245904203.1683179803531-- ------=_Part_348_1044841145.1683179803531--