From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32517 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Albert Krewinkel Newsgroups: gmane.text.pandoc Subject: Re: Line number of input file Date: Wed, 03 May 2023 09:03:13 +0200 Message-ID: <87o7n1c2oy.fsf@zeitkraut.de> References: <4b09ae5e-99be-4772-b65d-62c5ffe68ccfn@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31632"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCZJF7XJTILRBYUQZCRAMGQEQP2V2TY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed May 03 09:08:22 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ej1-f59.google.com ([209.85.218.59]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pu6b8-00082h-QQ for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 03 May 2023 09:08:22 +0200 Original-Received: by mail-ej1-f59.google.com with SMTP id a640c23a62f3a-94ecfab8993sf617571266b.1 for ; Wed, 03 May 2023 00:08:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1683097702; cv=pass; d=google.com; s=arc-20160816; b=K+J31QuFDNGO6+Icxq+vqMtY9cqerIK2zFXvYN8PZgilKquDHDmQdavpoaer0UadqL Ll1frZJUjhsak7uj5s2Iv4DR7cQ7n70Q5LTO0trU0CxO6YFAZcuQt52O7euD9ZMG/PfZ 2D/LbqAJ7CRsyMZKaTab8X1Q8DC/OZOIYRepAI3sEW6GJSKwDg8Zdvgore2TCcA+YDCk hiCAK+ERhPDZugcQTWw62YHQC2pY8i+r490nfySNyRvdcD3DZBaYAwukfyu+FUPCktrp i8MRH2b7Q3e3FHLvzyPLIHs+mQQwuXNInzI5cHmu0jT0sLZteaLNXJ6HQPTLN/rUqOpM TVGQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:mime-version:message-id :in-reply-to:date:subject:to:from:references:sender:dkim-signature; bh=WE2j/mTAZetXDZTf7/rs7IdgBXbUcN73Gazy6ZUz0J4=; b=Ju/euY7uxOMiXgN41npcxk7s+OEFVjBw+iyGvxkmTMsYCYkGl+I8jnohsdSZisnajl UwN0lGp58SWW+pgzHe2EHvTTDqFBq8m0+AiF9aEcKYZba2hqNAY/8kq7e91YaaQ8lxjT 6EloTV7WcyOevCCd3K9oYgilniwA39okztoPSNXH+a+RjQWKLAPFmEVBgQr8Ln9fZ4yN M3CANdQw43ay58KnXDWZzN8PM+rgfSDVzfdPMj1U+JOFM34H/zADYtfBtqlAIBkJgQWl HcSCNxCxmoeFYWesbEm0TA9qOyijzQh1sMLHAA6/Gu1Isbf2bq2WXtZxB5LDMsmebJwF mqoA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050:0:465::201 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1683097702; x=1685689702; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :message-id:in-reply-to:date:subject:to:from:references:sender:from :to:cc:subject:date:message-id:reply-to; bh=WE2j/mTAZetXDZTf7/rs7IdgBXbUcN73Gazy6ZUz0J4=; b=sox0G6u19pxTOzGklfXiub1k4bso0tMA2c6Wzvk6sRYL25jf6exCNk3X1W8eRwseys kqA99mBKP42Py7MBbFTaPbpBfmmMBEyFOo4eBZMESTd0SIvdVjb9GD6WbpvOb33n7Fbc Uph1mAmyLm8//2xWUAV8s06lOxQ/Qf1sxM5ACoDGXbufn0rAEhg0kmKaNJ2hBbPK8v1X ix4LxWqHVmp9mUKS0BKsXLQP7EF+EcReadBrm2rg03ObGEOPN4eNsu5+YHX4xxn5grcw +uZOb63xYkGU9EGKLVx9PbreYtNFSm3M+lR3xS++trFvxwttGT1snu+3wOfn7KTtVJcu X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683097702; x=1685689702; 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-authentication-results:x-original-sender:mime-version :message-id:in-reply-to:date:subject:to:from:references:x-beenthere :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=WE2j/mTAZetXDZTf7/rs7IdgBXbUcN73Gazy6ZUz0J4=; b=HOjA2hjBR86IDpdQIyquaZFGpeutCnh8fhQB80Bozh9j2syx6vQxM+ZS229P94ltTi rFEiZSU5v0tEYGyYfbMtO10Wb9BeBMyN4GkhQENS5F8buhcxqC6E4D1C7Mf2RJcmv/4L XCS8KTAUWBmwff5vbjCEKpkGcrWfwBpMC2WU0qGnuhdDjeqVlv8QTjFIOS+whTmqjrhq 9jDfFaCRlGq5QtiD9uj2gC516wtyzKhFfMDb9mH9o06/NrR0q8N5oRXNV5y2AOaTvbjA awzHnu Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AC+VfDw7euV16YjSR5Ql0XIwHnAOzV8Hti/aie01tSh+Lq8L8kOSjXo4 iDzBsiPjV2uxpkXlf+edI4Y= X-Google-Smtp-Source: ACHHUZ7txKk6Qw9rAJM3LWdsBinOv5o96ziJmCHzZlPknNdTHg164nlpfg43Hwn3r4p7M9IPt0aWmA== X-Received: by 2002:a17:907:2c41:b0:953:8cab:aadf with SMTP id hf1-20020a1709072c4100b009538cabaadfmr955100ejc.7.1683097702270; Wed, 03 May 2023 00:08:22 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:906:7e11:b0:961:9f75:5e9f with SMTP id e17-20020a1709067e1100b009619f755e9fls4876538ejr.7.-pod-prod-gmail; Wed, 03 May 2023 00:08:17 -0700 (PDT) X-Received: by 2002:a17:906:9c84:b0:95e:d3f5:3d47 with SMTP id fj4-20020a1709069c8400b0095ed3f53d47mr2691067ejc.48.1683097697521; Wed, 03 May 2023 00:08:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683097697; cv=none; d=google.com; s=arc-20160816; b=GqlGN4i024SBVmoyJ3hXtJLhHROWy0Q9MlsajUlMWvPdOTwNIySntapG1hY+5y6pIp dNM2NHTkXhOOcAzYQrZr2kZUsDZk67efRYNOCaJ0eO1PfaXZydg7MhheLpeleAXciQlW 9rCa5l5IX/1lFgr4xzdCFmfyOFNFnsJCL/4eToovZi0ks8zEJmFjub/TQxBOahrFrcSw lc3pyK3XDAIyJy0K2Q56HKzR9XYRMQFwG2FMR/mr6ipe0lt7ZTJ10M5SuH38ehvj7CYT e8WMmwcVyzChSMj/CJyiO0NkcyGqnDmH/DftcdpuCZMYMl5DTus3LUnwOGOZELME+8A5 cLBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:in-reply-to:date:subject:to:from:references; bh=12+S+py8ulSkADYqm1qmExxvpUztStuKpR+xdRHjq2w=; b=k3Uugt8HrddZWMp6bBN0RNj78PzZnU+VJoG2XJiL6UWt8H+2tAhs8kikQucy37reC4 /HO4USTMfQcH313v0tJA6K8Zi9waSZygj926v+x1mrIO7FjMzuNWWf0J0Dwg6++TdEzt SOedfnCu+MoGEAIiAN9066hLUTRkno2FjiexLg+eIhax+C8X9oly/Ho9Txy9Cpkij0j2 PKE5YL32FXuWCDjI+toTxDruXbAvKeux0hvsSayVLrKWIQYMKh1DWjQceUzuchQREVrb 1Zg/bjZuKa0qplyUTuQ6duFpmhy0xy4efv5bo4xkJRnUYGlUB2rUNvHuW90E8yzOiqBX /ahA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050:0:465::201 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org Original-Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org. [2001:67c:2050:0:465::201]) by gmr-mx.google.com with ESMTPS id n11-20020a170906378b00b009531f349d24si2297840ejc.0.2023.05.03.00.08.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 00:08:17 -0700 (PDT) Received-SPF: pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050:0:465::201 as permitted sender) client-ip=2001:67c:2050:0:465::201; Original-Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4QB7MM394mz9sb5 for ; Wed, 3 May 2023 09:08:15 +0200 (CEST) In-reply-to: <4b09ae5e-99be-4772-b65d-62c5ffe68ccfn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Rspamd-Queue-Id: 4QB7MM394mz9sb5 X-Original-Sender: albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050:0:465::201 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@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:32517 Archived-At: 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. -- Albert Krewinkel GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124