From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30750 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bastien DUMONT Newsgroups: gmane.text.pandoc Subject: Re: Experimenting with pandoc module using just Lua Date: Fri, 17 Jun 2022 09:49:23 +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="3398"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDCINCES2QJRBJ44WGKQMGQE4SIDWBA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Jun 17 11:49:31 2022 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 1o28bb-0000k9-Ey for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 17 Jun 2022 11:49:31 +0200 Original-Received: by mail-lf1-f56.google.com with SMTP id a29-20020a194f5d000000b004790a4ba4bdsf2131773lfk.11 for ; Fri, 17 Jun 2022 02:49:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1655459371; cv=pass; d=google.com; s=arc-20160816; b=eiDdEeO7JiUz8Rb7cXHF1/s0OohEfmdrAMzYdidNqCqkj/zJE0L1WHk7vSOyWsTUhY VmXmKEjaWkJe9ThSc38ReaLQqRvsCzw+VpHYe8DAk6ztRDKM5JgKQnxZofheBYAgyAQU cFBegByH4Wvh9XRqRvsPM7SWeAb5brmt1PLkOnL46xG3c4xsYjK3QQGSIjimx/rKAXyQ XIJqOBBpvXnd5dejSBem4T0PpFz9pHNRhKhumrHp+UZQtQ2gQLcXGlaTXdXbGJdPbwbj Ty5aiGPnMW7Q/sqFW1pT2U6v+1AyHj6iklZKZDjdaFZYVcEycaKS6RMNHoqh7cVFlEYx IbNQ== 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:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:sender:dkim-signature; bh=HgrTH0cb73wGYjVrNITcP/sPycbYAIprDe98IkWFQSg=; b=PzfcGbnSjT1LYPS+2OjbjIQP04+0r8NFQssCRCMeOv/02k8QGm5sBVWW2VPjBu7kWy KBmSuCgjxs2RS5gfrfMQ4ioBU/y+0nMQKUNkbCJk4A9XBmOFDe1QlejKyrYVv9JUlCC8 5Nkyns3foNkWfiobfn3hNYHFcRTEXW3tCsXYs0LIZTikAD7kEyR/vxyVkXUep0EuvFIk 57ae0RONbY1Fjoeu/jrgqjS4mZY/nuRtMFB+Ca+iNFQmi9nC8tJgh0iYL9JGwn3iYwkI tH1xSPESEtGaeWEZYWQSCQC9IRMBe6HBj4Pn8BC8VRVFO2bzXpoD4qEgUy5bj4cR9Qur k9wQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=Oc0EpXm5; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :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=HgrTH0cb73wGYjVrNITcP/sPycbYAIprDe98IkWFQSg=; b=S4uNx2ep05gvehoI1yQg11+fl8cLcR5QBr6Z8VpmQH1DrP5KNYHcI6MLB1+M744v0L jAIDUUzSJFWjax1tYaNG72EO/VcD6W/8FzM/rj1D16X+91cXYEUQ0XtdzJKv1YTnGRR1 IbI6P0ehHIISU8J/rfPbmQt4xJMpaRa/GI0NNh8sZBwOHapLMq9Nr/e6JIV6kvq3olu9 vC1EUDL3pS2+gytDWaoldhsqiwNW1FT8ZuBH9+mJbdK3FDu+rplN1RSi4cUzgOK8bx5M VCJ7co2M3lROH9bNy9QcNVQD2t0BMueNXa5LpF9+Q0WK6m2FJ8TXI6Mdo7dwWH2P9vbu RkSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:date:from:to:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to: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=HgrTH0cb73wGYjVrNITcP/sPycbYAIprDe98IkWFQSg=; b=iLoSPxFBgafMdw6FmjODkekeokGCGglC41Vdz8mXMbDcL1RC+6Qk5O7m8jFMac6NvE O7hNtb/lOtjNspQN5BFmCrPHM1+H9X3m6x3DkVqh0nxzSIBLslFHQWDZY0z+LcHaO2KZ uORibUUqeI5qcfzAzhKI3SCNb2iD3Xj5+98i7IZbwh/mgvyiqFN3JDpf0YQvjqny5YsW f++ErqnQGLHS2q922CM3a0aDoDp5h58xwqKqNnpzS9S7Na32CYaNABkT+Lxtn/A3sbKt ALdD8JO5nWzr9p7RVYca3Hwp5nsju/sl4tlpqrOtAw6g Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora+mvj1NyKlezJEgpzbYJZ5iaLbbRHe5xfuLEPMYjISCEsZR7V// BnSebbB7s9Gp3UMR8ATFwmo= X-Google-Smtp-Source: AGRyM1smRrM/+cETGr/WR9UVAW6fggKVF8sLNTO68b4KEe8VSDdnozJ+pioU6H9EmCCevqqR/gM4IQ== X-Received: by 2002:a05:6512:23a5:b0:479:3159:5f2e with SMTP id c37-20020a05651223a500b0047931595f2emr5038306lfv.265.1655459370928; Fri, 17 Jun 2022 02:49:30 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a2e:81c8:0:b0:255:7bff:427d with SMTP id s8-20020a2e81c8000000b002557bff427dls730089ljg.0.gmail; Fri, 17 Jun 2022 02:49:26 -0700 (PDT) X-Received: by 2002:a05:651c:4c7:b0:255:93bc:55b6 with SMTP id e7-20020a05651c04c700b0025593bc55b6mr4635492lji.386.1655459366225; Fri, 17 Jun 2022 02:49:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655459366; cv=none; d=google.com; s=arc-20160816; b=NJymEiiIajbM4icKFXoOulkdW5yPqkAFza+WgNn+jPKeG0ouVHXXRZrVWjH9uPIEHC anW17Ct1R6quSHY3fuhrB7VoReW4FL3ivEy+fa4Tahs5LwqZrgPDHSsI0u3jlGaTnfoz DUZVcAsMRQ8H52z6P+Q6+aP14ozZG57Vdvq62GFSWz0y7kuz0jmG0dU4+m7fUe2aRLSA Q9DKwBl1TUm7rrNTm84a98AYPbzv9tKeAVNtWuoqqDEWrboGqbTbOjop1hbHnRhA+Zl7 UDQHDwxV9p6Ycs/s0qJCqMem/mGJwuQYHEafdf/3RdP74Z/3tYOEziSsLox9gGxYlp+G wySw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:to:from:date :dkim-signature; bh=KqBPORDKOFAsLFd0d1ELOZMX70U7kIezmnAQ3Fuy04A=; b=bwogbDie+lU84h9/W3yXrizzm7ce6FYCs9v43SoKUg+FWwgvT/ZQc6K1vdiHdZAs09 F3jpKeE+G+f69u7Q75YykVPn4qA8AA3V5wwKs6yazMAHywByFpVLHQosJFTZ4YW4jpSi 6ii0T9zJrNLkZzHbNStUzRkgsOLLJCemuL07W+PSNJhU+oynbjaZ9Vfs2nM9f9gNTvoj iLvdn4HlpxRIDZ6LBeSifKxxl1yueTakhgsp+AJgOTYTzrFICPT3W0S6xIPovfVWNQig 6MtVA2xltS6SDvCEV57o0oH9vsOl0fX7WPLDf4bw0G2oGLbA96wxvrx91P3Z3h9YP9Rq kaMw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=Oc0EpXm5; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Original-Received: from mout01.posteo.de (mout01.posteo.de. [185.67.36.65]) by gmr-mx.google.com with ESMTPS id e17-20020a195011000000b00479321d8077si188790lfb.3.2022.06.17.02.49.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jun 2022 02:49:26 -0700 (PDT) Received-SPF: pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) client-ip=185.67.36.65; Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 7BF0E240028 for ; Fri, 17 Jun 2022 11:49:25 +0200 (CEST) Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4LPZ505Xy2z6trF for ; Fri, 17 Jun 2022 11:49:24 +0200 (CEST) Content-Disposition: inline In-Reply-To: X-Original-Sender: bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=Oc0EpXm5; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net 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:30750 Archived-At: You need to supply an empty input to pandoc. In Powershell, you can type `e= cho '' | pandoc -L build.lua`. Le Friday 17 June 2022 =C3=A0 11:38:11AM, A A a =C3=A9crit : > Hi Bastien, >=20 > Thanks, that's a bit more like what I'm looking for. >=20 > 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 there until I press C= trl+C. >=20 > Pretty sure I'm doing something wrong but I'm not sure what.... >=20 > Regards, >=20 > Amine >=20 > On Thu, 16 Jun 2022 at 17:34, Bastien DUMONT <[1]bastien.dumont-VwIFZPTo/vqzQB+pC5nmwQ@public.gmane.org= t> > wrote: >=20 > I don't think that you can do this directly from a Lua interpreter. T= his is > how I would build a document programmatically: >=20 > ```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 > ``` >=20 > pandoc -L build.lua <<< '' outputs `

Hello World!

`. >=20 >=20 > 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 f= rom > scratch > > similar to what is done in Haskell using a `Builder`. > > > > I really would like to avoid learning Haskell and stick to the Lua = API. > But I'm > > getting the impression that use of the Lua API requires understandi= ng 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 th= e following: > > > >=C2=A0 =C2=A0 =C2=A0Is there a way to generate a document from scrat= ch 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 cla= ss 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 using = 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 pa= ndoc module using Lua > >=C2=A0 =C2=A0 =C2=A0without having to write a filter/writer and go t= hrough the pandoc > CLI? I > >=C2=A0 =C2=A0 =C2=A0would really like to just experiment with genera= ting documents and > getting > >=C2=A0 =C2=A0 =C2=A0familiar with the Lua API using just a Lua inter= preter. > > > >=C2=A0 =C2=A0 =C2=A0Regards, > > > >=C2=A0 =C2=A0 =C2=A0Amine > > > > -- > > 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 [6][5]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit [7][6]https://groups.googl= e.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%40mail.gmail.= com? > utm_medium=3Demail&utm_source=3Dfooter >=20 > -- > You received this message because you are subscribed to the Google Gr= oups > "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, sen= d 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.co= m/d/ > msgid/pandoc-discuss/YqtNZpy71u2Ud39K%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= 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.gmail.com. >=20 > References: >=20 > [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%= 2BNF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%40mail.gmail.com?utm_medium=3Demail&ut= m_source=3Dfooter > [15] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [16] https://groups.google.com/d/msgid/pandoc-discuss/YqtNZpy71u2Ud39K%40= localhost > [17] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [18] https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgMt32uLCRXDqw= xpudMF92sBQVg_f2cNXvzV0T3rsyy5xA%40mail.gmail.com?utm_medium=3Demail&utm_so= urce=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 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/YqxOI1fX2hiBA3YB%40localhost.