From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30751 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.text.pandoc Subject: AW: Experimenting with pandoc module using just Lua Date: Fri, 17 Jun 2022 10:07:27 +0000 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14216"; mail-complaints-to="usenet@ciao.gmane.io" To: Original-X-From: pandoc-discuss+bncBCZ27W53TUFBBYVEWGKQMGQEG3CCA3A-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Jun 17 12:07:34 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ej1-f60.google.com ([209.85.218.60]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o28t4-0003UY-50 for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 17 Jun 2022 12:07:34 +0200 Original-Received: by mail-ej1-f60.google.com with SMTP id a9-20020a17090682c900b0070b513b9dc4sf1842606ejy.4 for ; Fri, 17 Jun 2022 03:07:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1655460453; cv=pass; d=google.com; s=arc-20160816; b=lCOLq/l7OiUzFv3GfR557i8x1GXP6UgI6D93odEcCJvpaPJk32XVeX3T5rL/UY+viY IY1PdGt34QDPPQLaFtTRjfpgwLCCPjd5DjqT3StJsUrthW3/42I1pdd5xu+c0v1+obsg 5jvkMxhFoBVGyiTwwHet6H2y99epsYF5EXcZV0FqBuxsuU5wsiPIThc8u/i9MQxjR4+P lU6vU0NrmsqIOPfwHx67XQFLOEVrO1SSozOYGhdeVzRj2wXe1eEWERJU3hWx1MUDMPW6 61cWXqKhCVDF5mRFRsz/OIwK34qT6iosnZwW/1wsk8GcrQUuKLPr8hSSi1CK9qmwYlOp 78+Q== 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 :content-transfer-encoding:content-language:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:to:from:sender:dkim-signature; bh=ec6oA9+rNy2QfL89P1jM1GHlEmfHO23bwAs/RkKfbkg=; b=epHIkQTFSewwaP7hiC/zxgy4aISzCSRn5rvJWTD3V8ONBYSIL90jmWn6//rEq3NlqD 73ninm6rJLinSf6+NP5MYdUoXRankf0qGprSz0bDullLdsG0Hb6cPR3T6hhQSHWkLi6H sRop4QTsdBWUIe2bA2ZzW1aKvLNdox0uTpZNlcitEkfDBH8xzSZcB3zGDFautIID8zVx PsGBdzVttiAEJC/ENbasrJ5Lh6BrBWVraiRGeQjp7WJexypInDt24LOAB1nCEXU/pUK4 +p4eNrTJ42MUETc3m+91j8cHRRhn/A+rqf7hyQ6fepLLg60Y07jLe/Pg1keufjl8p/dq Vkag== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of denis.maier-NSENcxR/0n0@public.gmane.org designates 130.92.0.82 as permitted sender) smtp.mailfrom=denis.maier-NSENcxR/0n0@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=unibe.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:subject:thread-topic:thread-index:date:message-id :references:in-reply-to:accept-language:content-language :content-transfer-encoding:mime-version:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=ec6oA9+rNy2QfL89P1jM1GHlEmfHO23bwAs/RkKfbkg=; b=ZwJsq+KeHsAb3ORWU4rwgn4q1v/8xTPM2MhC/7Gs8rZaORXtYHmQKik7hd9ZMOLuvJ yE7tFTfxdF6Wcj/NHFMpoxpjtbcZ5KRco75tHjhq47M1xs4DyS51tTqvfYz653Be2NTu 74j588vbIIYr9Ko+K6TZjjoY+ijfdCQuacqu+Kgp0UHVv6mpEksZ+oK6zjYKPuyMepHQ 8pIefNF7vntLxLfqpvYEt74oj7KvKLFEmf5/qnOUwfjR5rJDOaXPiEhBN2wDfI03OGSm 3mt1dmEBPlJpET4ZIGYCqMW57LxmLqs76qTnVuUbBSGMKuLOsw X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:to:subject:thread-topic:thread-index :date:message-id:references:in-reply-to:accept-language :content-language:content-transfer-encoding:mime-version :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=ec6oA9+rNy2QfL89P1jM1GHlEmfHO23bwAs/RkKfbkg=; b=6jQrYlJN3r+bgaVX3P+wi6lGO/8Fn/7wv45HYR/XfSw7lS0uJfTYsJSZQflvWrs3FB z4qLmyxOhwZwYL7FPtrgzOAg3Wzl2kiasMiqvTyYXdSIYZITY0d+8PHppdbqMbYl9Xgz yyARDgZMsVAooc+zAPpE/kH4CGUV2Xq6aRGWTxd17hlbQzx+CY9paNJuOn5RwDuvOUHS Ukl08OZJpvfpvd9rssFt2/N4Tk7G6V/v01Oxnj+UJFroYmsiC82svY8EjJEiqNeRjmkO XU6fK Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora+ACrRioVpWuzYHQhpeiXGU7IkPrw8iObNCrIwy3igXn082YOEY 8eUFd/bdujnW+PWPk2tMZnc= X-Google-Smtp-Source: AGRyM1t9azL+4FBQOR87Z63/kLyQfIBkUOwm4ua8UpaFJcmt2lByEq11VLbZq0XMYCddRVB0A0ZIOA== X-Received: by 2002:a17:906:1d5:b0:712:3952:afc6 with SMTP id 21-20020a17090601d500b007123952afc6mr8689352ejj.564.1655460453703; Fri, 17 Jun 2022 03:07:33 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6402:35d0:b0:434:fe11:7447 with SMTP id z16-20020a05640235d000b00434fe117447ls376983edc.3.gmail; Fri, 17 Jun 2022 03:07:29 -0700 (PDT) X-Received: by 2002:a05:6402:4390:b0:42e:b7e:e9ac with SMTP id o16-20020a056402439000b0042e0b7ee9acmr11426857edc.97.1655460449836; Fri, 17 Jun 2022 03:07:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655460449; cv=none; d=google.com; s=arc-20160816; b=s6zj8GU4rytkYiw87gxL87ha8McpS2+mCP+aZhELyKoVjObdI2yizARpVQfwOBjX6G 0aPNyNbqsfQDquAZyoZ/A6Sbm0qm4hV/KG34/RhLqn9MG5pIJpa7wK3KdEoDjNfkyHOy 1RbytJGLBKdslN0R/wB6yl5zZ9X8ztuhf4nOo8LfV+PSTFLkwVDfbZn/eIGh5NsrpjWy We+FDGTal7sWGzkWYiIin07UE51v0EpEwQp9ruLyk0k5pn5h4Hha2aE5+RtOqDZlWfOt IIkGDhp1Ia8YJwVvBY3DL07sFkSmmlnffl0frdH/3HcglHNLGxJwWNV33IhAWV875v0I 93Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:content-transfer-encoding:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:to:from; bh=ttfjN8znzqv2JT28U4J5OMUmZV6BI9DEXPjObTUnmac=; b=gYQTEAFeWtIPg3Yr8cSyM+vIvqEBhXoKuYx9P9P6vx8p3mlHzM1FApBJ283sck1uCS F+LxVTP91yDKzUDKe9Nj0LaUG2zXK7NL8/NZ8iEmsQCwcYxDEUp/sgG5WdQKbLqpMtiL dJDzjVvQAPIHzydGNVcbjQpVT0uHRIbWJ/pOnT+QMOJPTJ0J0G9a0L9uZutV4jMP/T6l OgvSiTW//BIW1LwDVgs1mo44/LoTjTerbqpk0paFm5IWiWV71NCb4Ej/HHzKZ1YowvM2 2NYlZ7vwbGxQWTPZsDPPctVhPFn/IDyMy+EtyWdnfKPeeAE6etTKcznGTS4VTt63xlR9 S37Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of denis.maier-NSENcxR/0n0@public.gmane.org designates 130.92.0.82 as permitted sender) smtp.mailfrom=denis.maier-NSENcxR/0n0@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=unibe.ch Original-Received: from mailhub-lb1.unibe.ch (mailhub-lb1.unibe.ch. [130.92.0.82]) by gmr-mx.google.com with ESMTPS id el7-20020a056402360700b0042d687c85d2si182414edb.0.2022.06.17.03.07.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jun 2022 03:07:29 -0700 (PDT) Received-SPF: pass (google.com: domain of denis.maier-NSENcxR/0n0@public.gmane.org designates 130.92.0.82 as permitted sender) client-ip=130.92.0.82; X-Virus-Scanned: By University of Bern - MGW Original-Received: from mail.campus.unibe.ch (aai-edge-03.campus.unibe.ch [130.92.13.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailhub-lb1.unibe.ch (Postfix) with ESMTPS id A217050007C for ; Fri, 17 Jun 2022 12:07:28 +0200 (CEST) Thread-Topic: Experimenting with pandoc module using just Lua Thread-Index: AQHYgZCYoG8Te1s5xkWXg6oMLbv6ra1SBLKAgAACG4CAAAGIAIABLu2AgAADIYCAACR1QA== In-Reply-To: Accept-Language: de-CH, en-US Content-Language: de-DE x-originating-ip: [172.18.72.2] X-Original-Sender: denis.maier-NSENcxR/0n0@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of denis.maier-NSENcxR/0n0@public.gmane.org designates 130.92.0.82 as permitted sender) smtp.mailfrom=denis.maier-NSENcxR/0n0@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=unibe.ch 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:30751 Archived-At: IDK if the use case is common enough to warant a new command line parameter= ... But, what about a new option like this? `pandoc -L build.lua --no-input` The example `echo '' | pandoc` works with Powershell, but not with cmd. The= re you'll get the result:

=C3=94=C3=87=C3=96=C3=94=C3=87=C3=96

Don't know about bash or other shells. Denis > -----Urspr=C3=BCngliche Nachricht----- > Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von Bastien DUMONT > Gesendet: Freitag, 17. Juni 2022 11:49 > An: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > Betreff: Re: Experimenting with pandoc module using just Lua >=20 > You need to supply an empty input to pandoc. In Powershell, you can type > `echo '' | pandoc -L build.lua`. >=20 > Le Friday 17 June 2022 =C3=A0 11:38:11AM, A A a =C3=A9crit : > > Hi Bastien, > > > > Thanks, that's a bit more like what I'm looking for. > > > > However, when I try to compile in Powershell using `pandoc -L > > build.lua` I get no output and the command prompt just kind of hangs th= ere > until I press Ctrl+C. > > > > Pretty sure I'm doing something wrong but I'm not sure what.... > > > > Regards, > > > > Amine > > > > On Thu, 16 Jun 2022 at 17:34, Bastien DUMONT > > <[1]bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org> > > wrote: > > > > I don't think that you can do this directly from a Lua interpreter.= This is > > how I would build a document programmatically: > > > > ```build.lua > > function Pandoc(_) > > =C2=A0 return pandoc.Pandoc( > > =C2=A0 =C2=A0 pandoc.Para({ > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 pandoc.Str('Hello'), > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 pandoc.Space(), > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 pandoc.Emph(pandoc.Str('World')), > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 pandoc.Str('!') > > =C2=A0 =C2=A0 }) > > =C2=A0 ) > > end > > ``` > > > > pandoc -L build.lua <<< '' outputs `

Hello World!

`. > > > > > > Le Thursday 16 June 2022 =C3=A0 05:28:29PM, A A a =C3=A9crit : > > > Hi Bastien, > > > > > > I'm afraid that doesn't really show me how I can build a document= from > > scratch > > > similar to what is done in Haskell using a `Builder`. > > > > > > I really would like to avoid learning Haskell and stick to the Lu= a API. > > But I'm > > > getting the impression that use of the Lua API requires understan= ding > of > > how > > > the underlying Haskell objects interact. > > > > > > Regards, > > > > > > Amine > > > > > > On Thu, 16 Jun 2022 at 17:20, A A > <[1][2]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > > > > > > >=C2=A0 =C2=A0 =C2=A0I guess a better way to phrase my question is = the following: > > > > > >=C2=A0 =C2=A0 =C2=A0Is there a way to generate a document from scr= atch and > > programmatically > > >=C2=A0 =C2=A0 =C2=A0using Lua and without using Haskell? > > > > > >=C2=A0 =C2=A0 =C2=A0There is mention [2]here of a pandoc Builder c= lass but I don=E2=80=99t see > > its Lua > > >=C2=A0 =C2=A0 =C2=A0equivalent [3]here. > > > > > > > > > > > >=C2=A0 =C2=A0 =C2=A0---------- Forwarded message --------- > > >=C2=A0 =C2=A0 =C2=A0From: A A <[4][3]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > >=C2=A0 =C2=A0 =C2=A0Date: Thu, 16 Jun 2022 at 16:51 > > >=C2=A0 =C2=A0 =C2=A0Subject: Experimenting with pandoc module usin= g just Lua > > >=C2=A0 =C2=A0 =C2=A0To: <[5][4]pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > > > > > > > > > > > >=C2=A0 =C2=A0 =C2=A0Dear All, > > > > > >=C2=A0 =C2=A0 =C2=A0Is there a way to experiment with the objects = pandoc module using > Lua > > >=C2=A0 =C2=A0 =C2=A0without having to write a filter/writer and go= through the pandoc > > CLI? I > > >=C2=A0 =C2=A0 =C2=A0would really like to just experiment with gene= rating documents and > > getting > > >=C2=A0 =C2=A0 =C2=A0familiar with the Lua API using just a Lua int= erpreter. > > > > > >=C2=A0 =C2=A0 =C2=A0Regards, > > > > > >=C2=A0 =C2=A0 =C2=A0Amine > > > > > > -- > > > You received this message because you are subscribed to the Googl= e > Groups > > > "pandoc-discuss" group. > > > To unsubscribe from this group and stop receiving emails from it,= send > an > > email > > > to [6][5]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > To view this discussion on the web visit > [7][6]https://groups.google.com/ > > d/msgid/ > > > pandoc-discuss/ > > > > CAMwawgOHE5QEeHJbO%2BNF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%[7 > ] > > 40mail.gmail.com. > > > > > > References: > > > > > > [1] mailto:[8]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > > [2] [9]https://pandoc.org/using-the-pandoc-api.html#builder > > > [3] [10]https://pandoc.org/lua-filters.html#module-pandoc > > > [4] mailto:[11]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > > [5] mailto:[12]pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > > [6] mailto:[13]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > > [7] [14]https://groups.google.com/d/msgid/pandoc-discuss/ > > > CAMwawgOHE5QEeHJbO%2BNF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%4 > 0mail.gmail.com? > > utm_medium=3Demail&utm_source=3Dfooter > > > > -- > > 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, s= end an > > email to [15]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit > [16]https://groups.google.com/d/ > > msgid/pandoc-discuss/YqtNZpy71u2Ud39K%40localhost. > > > > -- > > 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 email to [17]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit > > [18]https://groups.google.com/d/msgid/ > > pandoc-discuss/ > > > CAMwawgMt32uLCRXDqwxpudMF92sBQVg_f2cNXvzV0T3rsyy5xA%40mail.g > mail.com. > > > > References: > > > > [1] mailto:bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org > > [2] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > [3] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > [4] mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > [5] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > [6] https://groups.google.com/d/msgid/ > > [7] http://40mail.gmail.com/ > > [8] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > [9] https://pandoc.org/using-the-pandoc-api.html#builder > > [10] https://pandoc.org/lua-filters.html#module-pandoc > > [11] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org [12] > > mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > [13] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > [14] > > https://groups.google.com/d/msgid/pandoc- > discuss/CAMwawgOHE5QEeHJbO%2B > > > NF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%40mail.gmail.com?utm_medium > =3Demail&u > > tm_source=3Dfooter [15] > > mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > [16] > > https://groups.google.com/d/msgid/pandoc- > discuss/YqtNZpy71u2Ud39K%40lo > > calhost [17] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > [18] > > https://groups.google.com/d/msgid/pandoc- > discuss/CAMwawgMt32uLCRXDqwxp > > > udMF92sBQVg_f2cNXvzV0T3rsyy5xA%40mail.gmail.com?utm_medium=3Demai > l&utm_s > > ource=3Dfooter >=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 > email 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/YqxOI1fX2hiBA3YB%40localhost. --=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/cb27f08f1f8244119dc1865f9b655618%40unibe.ch.