From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30623 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bastien DUMONT Newsgroups: gmane.text.pandoc Subject: Re: MWE for building a table using Lua Date: Thu, 26 May 2022 09:05:25 +0000 Message-ID: References: <11978438-43d6-4943-aaac-659d51f05f43n@googlegroups.com> <82a0d0eb-877a-47ff-8632-907322c40648n@googlegroups.com> 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="7523"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDCINCES2QJRB64FXWKAMGQEZRBAJTQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu May 26 11:06:07 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wm1-f57.google.com ([209.85.128.57]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nu9RW-0001ih-Hl for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 26 May 2022 11:06:06 +0200 Original-Received: by mail-wm1-f57.google.com with SMTP id o23-20020a05600c511700b0039743cd8093sf777797wms.6 for ; Thu, 26 May 2022 02:06:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1653555966; cv=pass; d=google.com; s=arc-20160816; b=uIAOOTR9CpUG9RJRXfFaAQOwL/tgDcTP/L8js0xI1P6GQQoaPXk/PiGXAUP6NSLWWx Il6hSiCaMs4F9fJnclr8LBkcSYfKj9gyCtHX8gffYTk2lkAuhc90ZfYSM0HnCpi4wW/Y bXRE1s6vAN8LG8BrG5Q2C4zqvgsS1XHdtoOuhxaWCRMxsa6FPx4SJAZ9PTW9u2YdcjPE 6CK1qUU76sdH7TzJIDZdZJEH0ha/OJDZkKwmykRGA//LRKAyh1puWzW75zbrd29nsj6a jSToWhkRTkbBvJSKj4JCLBCtEk+eVMcga1ygZ+9V+fqqQ6DDMwu7nppIUSfriKbS0Hs7 +JaA== 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=WFSpUY7uqqXgR1LnQ3XaE0ryxonsFRatcOF6LTDgh8Y=; b=IMWFK32O4HZn4FT56RcFIyQYMXBXaXNSbTl63TgUkFlvLFrSEYpnTxy/7gSeIWS7nn QaaswgPyTrmNyM/mzJRWZW5n6j4Kasz3P44J3i+daRf4UAOgeaAoY6KCdrQ3WEO+kcfh u2MvHj2cr/8j2FffIUuSMHY5LhEqNdyg6xGwERAyHB8AFKGUDz+b8UuZv96iibZQurYb Ops+/1lwMjkTjVLATfhH3vdfkdeXrnCgCphHJgj00t3QiiymfMqhsTzpHQ7SlXx7J6rj /Qwn/jbKkc5SvQ4H9weQ5qfEYmofyHPjsnhyQFErwG9eBIKORCDg5Uw0gOOX2a5VnAam Pzng== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b="oBr/YHrq"; 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=WFSpUY7uqqXgR1LnQ3XaE0ryxonsFRatcOF6LTDgh8Y=; b=p80hiV9/dC/lc/XFQzQycLFBonz6Cui82APNt5ahNYy7LF8kG0JkDtcjdOSJOzYF8W SXd2ybxd6uPIRmNGNybM2gHZSBGr8SA6BX1/k8JhTA6fB6vvAVk94zRNw/lgqD2wfzkw QNZsguSe2RSDeSFAhvDrxteNDZSs6w+b+EAu2Rndl0nedmNJCMdY8hFQtW9Efx/7EiQa +8D+I+CD8+0VEdXNFOP7wtjf0XgkloaFjVp3d9wQ8BWyeJx+XUQ8Mo/fWfx5wCG0cROr RFINduu1P9PQiR054NRjIyDzXrQLwUZCxCNSpMLUThYV7mJsTPPeTBTw56ha1Zbi4uWK dAoQ== 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=WFSpUY7uqqXgR1LnQ3XaE0ryxonsFRatcOF6LTDgh8Y=; b=KpadZ2p/Qnc7cW9j7MEVDetULm+h8S0kCEgeuiQXfQI6Ha1gG8Z5lUugYusruBC0yt vqwaJnu70LXHNKW1V95v7Sy3jDoxbLOUW4vbe4fqTd+nsX3Zo6TtANTQ+c4WW+nw1Cmg jvJEaweVrdk2AQP6c6mXMXc82GOfkwBAjYhjyc+fThWcNoJzgCPbipLh2ooVGC5Olqrm DPBA1rlbYHRA5Fi7CRV054GASVdOd8d1OofS0n2CyqCWQ31TH3xBahvlWtSiTE63pVeH HWR0qubUca/JeS8YX/GQ+oemGk78XE2eLUe2rFGQ2fou Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM533Y7U+uIPTO4SdITm0YaS5k9EeP1upldSKV+Sqx//983lP96A+Z nqF/TGeD1PkL6lXkTE7V+bM= X-Google-Smtp-Source: ABdhPJxtpoNqzSNmW/ffCllt0pa728FGwfPDaFjtS4qSspADS6uv3fK1ZyxfWVJ2I0fQ6Ixfudynog== X-Received: by 2002:a5d:6792:0:b0:210:9bf:3c3e with SMTP id v18-20020a5d6792000000b0021009bf3c3emr2006430wru.79.1653555966154; Thu, 26 May 2022 02:06:06 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:600c:1c8f:b0:397:380f:f614 with SMTP id k15-20020a05600c1c8f00b00397380ff614ls4155626wms.3.gmail; Thu, 26 May 2022 02:06:02 -0700 (PDT) X-Received: by 2002:a05:600c:646:b0:397:77ab:5eb7 with SMTP id p6-20020a05600c064600b0039777ab5eb7mr1388682wmm.166.1653555962113; Thu, 26 May 2022 02:06:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653555962; cv=none; d=google.com; s=arc-20160816; b=ABhIBzHsuhxqZtx/WCcWlW5W/4dd4Ixp13NiJDziDAbU/dJ/I3uAex5sTnXHBRD8Se jOIXaGAIe4EKcShjMxulUDfKVlG798nYRYDI+CeAHrKriGYfOovvIW8OtoqWr1p4kcdl W4OHw+2s45elVW6JRxWHWMNA7uxLQmNB6q/8crkI3hzyzc6OkmU3x52PZ6XRNiJFoWGz kJvds3i8d4DVqSPc6sJ0etGtzY398NmrnpONaHdsQc2i/bz9Bu15IkCX7Dey9YlTjwdu MNP0T1IgQCaI+eNjsw7xWDe9sy/hNBe7icMUfGO1tV9OTFT0bSiegu1uEPKbW/R7Wo9y Vp/Q== 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=4297HBXEoQVz565zJ+1J8Qmi/X6hIkh8pY3dRWfyr4k=; b=jUyxdi0dFDy4xOEoIkdsfgdxGqnRMZAevks+7GHhjaBeb+GPqLwDIJxHktNUbRfUuz epycehdPlnjyqCyZemTaUhw1dW5QtQ3UgItncODFGmu8OTBUDfBlbQJSOjRmv+bDP5EI 8SrzOY2sXhBXc13FrivKSVirBOvHxArQgB1ti/CsGPCkwJl9A3YGSImmoMrepJjxgphj viA9q2inGY/v/oIHWnGlz9wqPjB2DR2cYG4Wh31uS4RwZiJ1ZBCTK5ILBvLNBCsYav+t /S9dkcjLx+9+Qys/T++GRPyotQvsLKX2h9iF8l8ewx7NKOazgQYNaR3NzWDqXFnYFjt6 u/rA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b="oBr/YHrq"; 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 n17-20020adfe351000000b0020c9eedfe67si64336wrj.3.2022.05.26.02.06.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 02:06:02 -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 BD942240027 for ; Thu, 26 May 2022 11:06:01 +0200 (CEST) Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4L82952Kv8z9rxh for ; Thu, 26 May 2022 11:06:01 +0200 (CEST) Content-Disposition: inline In-Reply-To: <82a0d0eb-877a-47ff-8632-907322c40648n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 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="oBr/YHrq"; 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:30623 Archived-At: The constructors don't take tables as their argument, but discrete values. = I have not found the definition of the constructors in the official documen= tation, but you can look into this filter to see how they work: https://git= hub.com/pandoc/lua-filters/blob/master/list-table/list-table.lua Le Thursday 26 May 2022 =C3=A0 01:53:39AM, msprev a =C3=A9crit : > This creates the following structure -- all ok, except the table body, wh= ich is > empty ('[]'), and I cannot get it to appear. Any suggestions on what I'm = doing > wrong would be gratefully received. >=20 > ``` > Table > ( "" , [] , [] ) > (Caption Nothing []) > [ ( AlignLeft , ColWidthDefault ) > , ( AlignDefault , ColWidthDefault ) > ] > (TableHead ( "" , [] , [] ) []) > [] > (TableFoot ( "" , [] , [] ) []) > ``` > On Wednesday, May 25, 2022 at 12:48:06 PM UTC+1 msprev wrote: >=20 > I've been struggling to get my head around handling tables with Lua i= n > pandoc 2.18. I'm trying to write a minimal working example to create = a > table as I can't seem to find one online. The code below does create = a > table, but with any empty table body and I can't figure out how to ge= t the > body to appear. Can anyone help tell me what has gone wrong here? >=20 > BTW, I tried to call the pandoc.TableBody() constructor, but that thr= ows an > error as it doesn't seem to be defined ("attempt to call a nil value = (field > 'TableBody')") >=20 > ``` > local caption =3D {long =3D {}} > local colspecs =3D {{pandoc.AlignLeft, pandoc.ColWidthDefault}, > {pandoc.AlignDefault, pandoc.ColWidthDefault}} > local head =3D pandoc.TableHead() > local cell1contents =3D { pandoc.Plain({pandoc.Str("cell1")}) } > local cell2contents =3D { pandoc.Plain({pandoc.Str("cell2")}) } > local cell1 =3D { alignment=3Dpandoc.AlignDefault, contents=3Dcell1co= ntents, > col_span=3D1, row_span=3D1 } > local cell2 =3D { alignment=3Dpandoc.AlignDefault, contents=3Dcell2co= ntents, > col_span=3D1, row_span=3D1 } > local row1 =3D { cells=3D{pandoc.Cell(cell1), pandoc.Cell(cell2)} } > local rows =3D { pandoc.Row(row1) } > local bodies =3D { body=3Drows, head=3D{}, row_head_columns=3D0 } > local foot =3D pandoc.TableFoot() > local mytable =3D pandoc.Table(caption, colspecs, head, bodies, foot) > table.insert(doc.blocks, mytable) > ``` >=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 [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit [2]https://groups.google.com/d/m= sgid/ > pandoc-discuss/82a0d0eb-877a-47ff-8632-907322c40648n%40googlegroups.com. >=20 > References: >=20 > [1] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [2] https://groups.google.com/d/msgid/pandoc-discuss/82a0d0eb-877a-47ff-8= 632-907322c40648n%40googlegroups.com?utm_medium=3Demail&utm_source=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/Yo9C1QJeUl%2BLbwKo%40localhost.