From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32520 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Albert Krewinkel Newsgroups: gmane.text.pandoc Subject: Re: Use Writer in Lua Filter? Date: Thu, 04 May 2023 08:07:32 +0200 Message-ID: <87jzxobp5d.fsf@zeitkraut.de> References: <9dc956cf-74a3-4e25-b4bd-62aae6dcc3f4n@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="15209"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCZJF7XJTILRB44ZZWRAMGQEXFSETZI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu May 04 08:13:14 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lf1-f56.google.com ([209.85.167.56]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1puSDJ-0003li-Uj for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 04 May 2023 08:13:13 +0200 Original-Received: by mail-lf1-f56.google.com with SMTP id 2adb3069b0e04-4f1385c2c35sf42199e87.1 for ; Wed, 03 May 2023 23:13:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1683180793; cv=pass; d=google.com; s=arc-20160816; b=WCd66FUFGOIuHnujLnPKO/a1RrAybsWERGbU3sW5NmiMH6Nd7IKcqdT98DS/MMSmKr KWlRniQlt+PsS3ei1CoLSJ74Qq/3XBFugq4n19Yc1jc/OPmJtzJBProEjRF/B7V9BrZk naOhPPPnBEKdGaTdYSYbrNxgdFusVZ3o0shd9HPltzAPFW+U7LaPuWuMQHRC/eET9cj3 Z2ZC9tGB8DzyReAjRWd/8U3UKP3GquQyGQ3fft2eLBkfkBLWrUhEjJw3UMKTU8uxAw1/ NE0Eb/OaJZKY+1idBUZmMIcgQt+XX5+OhZvOUP3qBIekFIuIywXr3JHgpafXL+d49mmX sj4w== 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=lhJlo+BN95BeBve/zXxag1bD2tyATusGW8Rp7wG6r98=; b=hbT0RtjNWPM+CX84ydVH0ae9Um4A3eJyGJZioU7owR9bgYhsOnHYUwM5JBaeGmVCYW OxTscSKB10xYcJcvETMBVuz0slBz/PooRhvQDfQGOpDG/wZj+L4cV3O6kT5002I25gCD /uA7AupEPxMJaO/lHxxHCK31lIfV6Q7BbyhsILFm71DOJWG1cMOPHABTFjtQz4ccyBp/ OnwoxrJLGY0WA5YTU8hbP3zP905tCArEy0+6dvkX4SVFoT5l6EqHjxMva8McXaPs1kUp P+1dOrWFStrH2gkh73DVLffdzUD5LBhLCLmxghbjCBRZutLh4bRxcrLQWJ5SzOi4fV3e 0dbQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.56.152 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=1683180793; x=1685772793; 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=lhJlo+BN95BeBve/zXxag1bD2tyATusGW8Rp7wG6r98=; b=srDCa8C0NnulQ4M4TFmfTRn4XB/ijHsvlyeacZUdRS4/Nhw3kyGWNaRsJA350cYm/k uBa97gcVPunILB8AgjiE9Qa2fI5mtX8n7WRdhX+trDugQEQjbSGsyRbXm7q/uOrm5BpG ZwJfKDJ3pZk+cP+0sW16q8LzlRB4PIagEPSdzo1QyzjX8T77jQDIakqBSQe+8/lR2Wfi SYvOs4eeLDewzaQUnefs4JgFpfeNCfJjyZffAvHEJadUsuiPU8ApE0sH1MyfsGIimHVA nQ6d2poCKyPkwp3Sj2HNA5gAQG3bJsItotIiUSRWaN7SGcanM0DQhd6x0SScbjWNGIdp X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683180793; x=1685772793; 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=lhJlo+BN95BeBve/zXxag1bD2tyATusGW8Rp7wG6r98=; b=icYubkCjT2QZGbZ3fgUMnIl7SiwgvMoC8s9NLqtcd24vNIg+GwChCn7j9riCNUyqP8 TPww2GfSVlOua5GQZxPxm0FfTgIGbBcpPiHGaRh3jmNu2D7dlurK5YQNv8FgM30869bz 6iHewujd2+qGbp0UdOqqmk1gUTAX8yqQ6Yh/vLGO3Ouah2CIzVU61AYEZOTRbbhmcVbn t84+DeSWKUqAnL73UnLTjlsymC//8R2T5GEgf4I9LF0ypPxWglIvBO75WvK7Bhq68Pf4 tbCtoS Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AC+VfDwFyrop/Cxx72lJCk64RwjeluGdW+uKVo9oUi/88YGms7zhxYOt cc7f/bUzRjbZHY42xR+s4JA= X-Google-Smtp-Source: ACHHUZ6gArMWX25zsh1XrlUoMbIxueHZA4cVMKvpAOxYcywAYZBSd6CoNforr1ARDb9vI4oQE+gLzw== X-Received: by 2002:ac2:43d7:0:b0:4f1:458f:1302 with SMTP id u23-20020ac243d7000000b004f1458f1302mr54921lfl.1.1683180793476; Wed, 03 May 2023 23:13:13 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:651c:1617:b0:2a6:20dc:a0e8 with SMTP id f23-20020a05651c161700b002a620dca0e8ls3837886ljq.0.-pod-prod-gmail; Wed, 03 May 2023 23:13:06 -0700 (PDT) X-Received: by 2002:a2e:b048:0:b0:2a7:a616:c39 with SMTP id d8-20020a2eb048000000b002a7a6160c39mr597020ljl.48.1683180785997; Wed, 03 May 2023 23:13:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683180785; cv=none; d=google.com; s=arc-20160816; b=kIlZ1p5JXLycndBFNpEKYFbs1Au910ezXR/XTh81myIe3kPjMbRvgd3yNPUMh1YunI n19w/IvANgAVjn4JvfAympTQmiN2tZygW9iQucH8WKCWZo0YdbNQrIIY+J+/rymrImLy i0ONj/itKBcllxLG5YR4o4dfgul5CEpnSdEL/onqMBbV0zoRGCVxHiT7Vhx5Dfx7AZuh ggU6LHJrfTSj9cbnefWSpRBCGTlePyZ2pW0DH8KmXWILPBdTo5SZ4o3jInWuPGV22l7/ Igh5ldrwpxFvzXT2/H63NALhdf7rDmyYzWmdmzy3MSqklkXc2sNn/C7DeLL9rxbX9ax4 clZQ== 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=dG3Kc1UzfdrDl71sYJfKs8hg6qtjn0rHrJmkwZAEwI8=; b=Z9EG89G86YwuurdSi8qnoLalQhIdCYNkbs6mdA/cO44/s3CHdZtafKiz+HoqJ4PKpw VKM1wGl3kfX47r/I7ATi+9y1LtkQu/m2jTwsWpVXzv7ZcuiJ+HFg3vApGfCK4ZOMPcoD ENouhpLLZAT9edhyPYx6achOMDRjiu0xGYzGf5mD8Zd8IlUvqGgshMWtrRYCi1+jejRc Fp/8D2YJ+BZcGP0wDsl+BB42I+sVYnzVm4jnS5Gbz/M+VRyTEV48PRljyC46CijVbDKw zWLbBQhoRVmG64xqY/dlCOnbFL+hSGk183PvpLCABImazRUPPEZso4QrCbCUK+NZYSf1 rDww== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.56.152 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org Original-Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org. [80.241.56.152]) by gmr-mx.google.com with ESMTPS id b29-20020a2ebc1d000000b002a8ba7c9a04si1925016ljf.7.2023.05.03.23.13.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 23:13:05 -0700 (PDT) Received-SPF: pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.56.152 as permitted sender) client-ip=80.241.56.152; Original-Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (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-102.mailbox.org (Postfix) with ESMTPS id 4QBk5C361Xz9tyS for ; Thu, 4 May 2023 08:13:03 +0200 (CEST) In-reply-to: <9dc956cf-74a3-4e25-b4bd-62aae6dcc3f4n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 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 80.241.56.152 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:32520 Archived-At: ThomasH writes: > Can I use one of the standard Writers in a Lua Filter? I would like > to import the 'native' Writer and use it to serialize parts of the > AST while in a filter function. The AST elements can be converted to strings with `tostring`. We currently use the native form as string representation, so this should suffice: `tostring(element)`. Note, however, that I plan to change this in the future, and to provide a string representation that contains the element's Lua fields and that is valid Lua code. The alternative is to use `pandoc.write`, e.g.: print(pandoc.write(pandoc.Pandoc {element})) -- Albert Krewinkel GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124