From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30609 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: msprev Newsgroups: gmane.text.pandoc Subject: MWE for building a table using Lua Date: Wed, 25 May 2022 04:48:06 -0700 (PDT) Message-ID: <11978438-43d6-4943-aaac-659d51f05f43n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_860_1797802519.1653479286132" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3414"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBD2ORKWKWEDBB5VOXCKAMGQEK6G5JLI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed May 25 13:48:09 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oa1-f60.google.com ([209.85.160.60]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ntpUn-0000hZ-Lv for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 25 May 2022 13:48:09 +0200 Original-Received: by mail-oa1-f60.google.com with SMTP id 586e51a60fabf-f29b8679f0sf2529792fac.23 for ; Wed, 25 May 2022 04:48:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:date:from:to:message-id:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=bVxNd/S7VmvCFBMykTIlo6rTtGlG07hgV8Zpi/tgZrE=; b=DusTYFuVn0VsHBOK/rhwcU4LxPvZoleDI8fRRDtuGKizWEe8eI/oPGVZ3z1peIDa5X fanBzXntsuFfcZq0K5pWslvi4IA/c6l9pSgxQHykka4vr3+F8l+s7sdZsS5ktifQt9UI JEkQVrjQpDP7l1b6AREUKfmbvQPTWj3Swawkr5wzyQmtkQ4TgssDnfaVpBtHHnYqp4g6 J3HGToOqleyJWfWN6ZU+vADLLR9vxvcB4yA3EKJpLQV9PBrbmXOKU18mIkqnfLKlOXUf hDuSGXFdtyP+Bq9Vkgk4HzcE/rkIh6je7SIEe1gg6hGpix/8z34+rMYRoGk3bEqrVzXW yrKg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:message-id:subject:mime-version:x-original-sender :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=bVxNd/S7VmvCFBMykTIlo6rTtGlG07hgV8Zpi/tgZrE=; b=MtpzRgMbV+TD4GmLD4WIwInOQ4Eea1H5EdLeu9DpwnOurVv8KbCGLz/4SlMgbF0F/e XPrSY9ijblnocLdxoNAn3/5dEyndab3oVIE9CGqbq49w3cAB6W5hLFt6AWw3idrY4OZF nos50ZvTFA0tbT71b5ecAo7Xk4dlLDQNP0BXMm/Xqb6CslUJfGsI+yiY+i3HZvtJA8jl MifYnmD3j8HBS8M2ZXw5t2qX2qJDTjNxgbZc4PHTCaE0xGUUfRSE4QCezCQI+s9u7oEx Q0ecClSalMDv2xMU2BkHOaisiNHM+MjZc2LwqsyWPW+0XeBNUOY5XveF626RDHWJ0ois FW1Q== 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:message-id:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=bVxNd/S7VmvCFBMykTIlo6rTtGlG07hgV8Zpi/tgZrE=; b=ZVaCa0INyqLE60b6ZUdtHa/vfk+pYa5v7Sl66fDfXzke2HhqnKn9AYnjZoT64o0Uu/ vwpA9ax1/nIVumLgCs8yi6tliQiYuXaJ03JL9Cz2hzAapFCEWIcil+xa0Pmdv1B4kug2 0JTzc840quHwIkyamh/Due2Wwx3dmCegiw9SG3vGSNI182aZH6X+/Fg15olYYU0BW8bQ LN5aFdw1sitLCtCDT/guFi+8Qen75C8ziB6T2CLbStUQ+I42i2+6xHYBmpPr0n3GxpQo wsnYKYakr8ssncnbxnr0QKa/PlGuP1K5KfwUIZ/U6CK8Ul5n49R3e38ifj3Jn9xg0qP1 UsKQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM532UWk8vstnVr5F2cGC2pA9n+ixByhcyjQSTXWB9NVYY+6/XBiiV f+H6kvxtHnxBldQoyz1FeCM= X-Google-Smtp-Source: ABdhPJzz0A5ToSZutM7XYXSICrM36wqDRYFwxmE2pWa7L5NOIOgnVQH0M5q9ljGLy+nn8dDd1Ox6cg== X-Received: by 2002:a05:6871:441:b0:f2:bca0:d51a with SMTP id e1-20020a056871044100b000f2bca0d51amr1996623oag.138.1653479288638; Wed, 25 May 2022 04:48:08 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6870:a11c:b0:f1:8768:4744 with SMTP id m28-20020a056870a11c00b000f187684744ls7967796oae.9.gmail; Wed, 25 May 2022 04:48:06 -0700 (PDT) X-Received: by 2002:a05:6870:e612:b0:f2:91f3:9c07 with SMTP id q18-20020a056870e61200b000f291f39c07mr5417134oag.203.1653479286590; Wed, 25 May 2022 04:48:06 -0700 (PDT) X-Original-Sender: msprevak-Re5JQEeQqe8AvxtiuMwx3w@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:30609 Archived-At: ------=_Part_860_1797802519.1653479286132 Content-Type: multipart/alternative; boundary="----=_Part_861_1883362780.1653479286132" ------=_Part_861_1883362780.1653479286132 Content-Type: text/plain; charset="UTF-8" I've been struggling to get my head around handling tables with Lua in 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 get the body to appear. Can anyone help tell me what has gone wrong here? BTW, I tried to call the pandoc.TableBody() constructor, but that throws an error as it doesn't seem to be defined ("attempt to call a nil value (field 'TableBody')") ``` local caption = {long = {}} local colspecs = {{pandoc.AlignLeft, pandoc.ColWidthDefault}, {pandoc.AlignDefault, pandoc.ColWidthDefault}} local head = pandoc.TableHead() local cell1contents = { pandoc.Plain({pandoc.Str("cell1")}) } local cell2contents = { pandoc.Plain({pandoc.Str("cell2")}) } local cell1 = { alignment=pandoc.AlignDefault, contents=cell1contents, col_span=1, row_span=1 } local cell2 = { alignment=pandoc.AlignDefault, contents=cell2contents, col_span=1, row_span=1 } local row1 = { cells={pandoc.Cell(cell1), pandoc.Cell(cell2)} } local rows = { pandoc.Row(row1) } local bodies = { body=rows, head={}, row_head_columns=0 } local foot = pandoc.TableFoot() local mytable = pandoc.Table(caption, colspecs, head, bodies, foot) table.insert(doc.blocks, mytable) ``` -- 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/11978438-43d6-4943-aaac-659d51f05f43n%40googlegroups.com. ------=_Part_861_1883362780.1653479286132 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I've been struggling to get my head around handling tables with Lua in pand= oc 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 w= ith any empty table body and I can't figure out how to get the body to appe= ar. Can anyone help tell me what has gone wrong here?

BT= W, I tried to call the pandoc.TableBody() constructor, but that throws an e= rror as it doesn't seem to be defined ("attempt to call a nil value (field = 'TableBody')")

```
local caption =3D {long =3D {}}
= local colspecs =3D {{pandoc.AlignLeft, pandoc.ColWidthDefault},
= {pandoc.AlignDefault, pandoc.ColWidthDefault}}
loc= al head =3D pandoc.TableHead()
local cell1contents =3D { pandoc.Plai= n({pandoc.Str("cell1")}) }
local cell2contents =3D { pandoc.Plain({p= andoc.Str("cell2")}) }
local cell1 =3D { alignment=3Dpandoc.AlignDef= ault, contents=3Dcell1contents, col_span=3D1, row_span=3D1 }
local c= ell2 =3D { alignment=3Dpandoc.AlignDefault, contents=3Dcell2contents, col_s= pan=3D1, row_span=3D1 }
local row1 =3D { cells=3D{pandoc.Cell(cell1)= , pandoc.Cell(cell2)} }
local rows =3D { pandoc.Row(row1) }
l= ocal bodies =3D { body=3Drows, head=3D{}, row_head_columns=3D0 }
loc= al foot =3D pandoc.TableFoot()
local mytable =3D pandoc.Table(captio= n, colspecs, head, bodies, foot)
table.insert(doc.blocks, mytable)```

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/11978438-43d6-4943-aaac-659d51f05f43n%40googlegroups.= com.
------=_Part_861_1883362780.1653479286132-- ------=_Part_860_1797802519.1653479286132--