From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32899 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: mf Newsgroups: gmane.text.pandoc Subject: Re: How to wrap code blocks within new tables? Date: Sat, 1 Jul 2023 10:48:44 +0200 Message-ID: <326e3767-e3b2-2bd3-5d60-340b2f1295bb@gmail.com> References: <4f0c1e08-60a7-4c97-9a7e-c3367ae32483n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11892"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDZYJ4HW2QPBB36Q76SAMGQE4LTRJVY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Jul 01 10:48:52 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lj1-f183.google.com ([209.85.208.183]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qFWHk-0002vD-0k for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 01 Jul 2023 10:48:52 +0200 Original-Received: by mail-lj1-f183.google.com with SMTP id 38308e7fff4ca-2b69dcf0d73sf28146911fa.2 for ; Sat, 01 Jul 2023 01:48:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688201331; cv=pass; d=google.com; s=arc-20160816; b=mwJnPyRDWtoGrL5JJfPFbB8TS9q/U9YuVXKMQiG/IWR1s1nimAzPpgQSqeUmKy1yQe ybVcn+uuvVKxqritzNkEcszYFPuLkdF0KYYfqRkSrnVcBsIQge5b+H4BMGvCxpFYU7Jg rq02ScJ2rB+oUq+WmWKCueY6Mg+szjd1Y3DZIPG6eccAwgC8qmAZ/RW20BH1Oa0HlesI S0XyWukW56QMGW97qWAjgpBFWdn6vKTfij6nm7SY35NbNLy358fJjxgW4hlX68uhleBr bfYeJ6XABSJLAHcEs/bQo79z/Ws6H3pKho3nUrARGbh5vVfWsgCYCMM5kDFpDA+m7zTL zoPw== 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:content-transfer-encoding :in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:sender:dkim-signature:dkim-signature; bh=tFBoaWqlfC6BxOLaFzzZVfen5zaGWH9MnsxEMdURtGQ=; fh=9r34WoOhqzq5q0wAFSQFgKCRgk4jnkyKIsuVBsoxsp0=; b=P5squb4Vx2aLpDaHcOofKF86PUcajpNw4lXNCw7k1ELA9+qvl0fyzAy8w4v5c5q6Hb L+f4f6QPjbOM+NIM4/DSzICEHDxKB9YEe1XMB0IGzBAtWwGbpr3avI1HTM8N+nNVgl8S PAmOJmugziYraP5Kx5uSfvTB8bEBLnwQYD8R3qUpXERuxMCZvkrTl10JvaVUbM6kLF8A hXy3huTVnBs41/Z/wzojn5HEWUkPkUhgrQPA0zc/eqoA14Yt6N7X44WWca48lBBsjmbl ETVSf4shA3XYXvgw8Hdb4avcn89/eJTU/9xtYrPg5DAJS6T34mMP9oG9xhMCaOe4qr8b ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=I5zTd0lv; spf=pass (google.com: domain of massifrg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::635 as permitted sender) smtp.mailfrom=massifrg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1688201331; x=1690793331; 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 :content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=tFBoaWqlfC6BxOLaFzzZVfen5zaGWH9MnsxEMdURtGQ=; b=AOLkD1qgqRp/kj/g5hYEP0HB2oo4thoGJUJYO6fyO99/4PS5VAOETKkhoRpULGGDgS ALE2TzA/herms+NQ1jz2knV5rGrbiUtD0Fe6Fp2wFGDEPWUcivDExj5RChMXD6uPXrrd eWSj2WdWQZhODpiUwKBQzGsg/tUL/qtsAmeQd04vl2gQgJCNA0h3LtN2ZToD7e1yS257 wqzcssFudHBG54wIZNFZATFP8RGSiomywvCWtWUK63b53wyunJsuITFbpg2Tv2X65Neu 8KSgQmoOh DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688201331; x=1690793331; 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 :content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=tFBoaWqlfC6BxOLaFzzZVfen5zaGWH9MnsxEMdURtGQ=; b=IIRy1EnNWncCGPwTbyC99XkbRvV9xOXtxuIByCv1Ln0H/Wn9MivIQSzvCYKDkSwlls maWa0jVCS7v88IkHzRuQleSR073xRf6LtTRC3rpiK33yChlNhHUM10I1gUjXx8XOGq3S jlqM28qcsxPt+CuVYNptqhKLdZ7Oz4rPxxMAcjjV4NmYIBuIparDVThTxFZg8CbFQ0Ow So2L28/VBfIUr9ivlmOqw6sh9oDUCwah4gHELHhN2VCEUpep4Kh5xWPOj8a1OuZcGpkT BxmH55DowRnxJotug/7RbwS X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688201331; x=1690793331; 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 :content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=tFBoaWqlfC6BxOLaFzzZVfen5zaGWH9MnsxEMdURtGQ=; b=Q+/nAZG2hZ25gd7HTUGkhxhnTrBu2d9bR0wZFauSm2CK2Fmvf7am6v0gQBEuptMqam KuWhlI6LvZRAYz17Z9vC5dlo4cyTOg/xf7ZqsSKSqOlqqsujOOyAiFiwqoXh4+xL2x3A Yy6+bT6UQ6CnYQ8YH4w6Oqk+l9oM0fmX2pQg5ipSl03TVHI79scqxhdBNhQAZ9mV8PIv iKloQLRj76PCITDha+qM Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ABy/qLb0chKwmZamt3xISv6Xz5iJRqTuqCrnr4tzeT/VozL/vYugPl6+ zw9mqL4kUaIZeCOVXYatFmo= X-Google-Smtp-Source: APBJJlGJFBRO71gcIvfVHMupvhKAx7iOYvRcNxdLPBaUuVaZRYcCYc0jgZ3n5cDDigiyWO7ebno0VQ== X-Received: by 2002:a2e:9844:0:b0:2b5:7a87:a85a with SMTP id e4-20020a2e9844000000b002b57a87a85amr3452865ljj.13.1688201331124; Sat, 01 Jul 2023 01:48:51 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:651c:3db:b0:2b6:b8c9:a625 with SMTP id f27-20020a05651c03db00b002b6b8c9a625ls493976ljp.1.-pod-prod-07-eu; Sat, 01 Jul 2023 01:48:45 -0700 (PDT) X-Received: by 2002:a05:6512:2107:b0:4f6:6b:a43b with SMTP id q7-20020a056512210700b004f6006ba43bmr3420094lfr.52.1688201325754; Sat, 01 Jul 2023 01:48:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688201325; cv=none; d=google.com; s=arc-20160816; b=sjMxRVUKN9SIt9jqN3c4KplwHNKL73cUokoShhfYTlQbcDatsjKLOaKSxIP7d7ysZJ 1++N8qS16jfMAC5vbvtF6Vtn+2Bba/g8YP49q/50F8qAbvSoHIRPP5H8Q61jEubqKvhs zNGXlzsCJ02FvF4xjw2Sx6dwWPuCQftVFYDUuiUFpn6BgCQbCLEFELaWGtXEwDFLXjLT OW/XW6eq6O9ukKYNfY0D6IGjkQbxhautvPns/HCUELdE0m07dbmbvwtxZOfGDUYT9+eR PgNkFcN7PT5P+L1d26HbjBRsxzm0V7YKJIFxr6jagEeSL4PnIJvhkNWVFMxnuxx+67zF NyRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=kgmwyC2kVCfB0Pjwr4OPkqUEEaSarFzTXUJxEe4zBrk=; fh=m01AhCNo7xUywHldCVYouaJypLlN7JgtNYbImzBf4N4=; b=WLI5ExY1RoKv37bWrbHPYdIZ27AD8BChqfgtjQeO3Gd7p4aX7yaXaVDuorvhHD34hj qYOfuSBCyFcp/m8EGAVmS6oSqdvAL7F9+c6OG6sKXTTBJv7BYyhC8d/jT5WzproZeKyI ChjK+TMw1pFTAMUu7IbNL2UeDJKYCSiQgaBBYws3Us3J2Tw6tXnstPvYzetoHlABeEb8 4VOaCrLgxAc9dTU6Slni/aTayGGgrc7+NLOV6HQWnxD5TgiKqG11j1mNCYXj8NExMirB /rnJgTHQcUNhOeL4HiVO10kUUAKkdRFurFqZmW9fEYdfXexQXNgBPbzwXUotUruh93aZ tNYw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=I5zTd0lv; spf=pass (google.com: domain of massifrg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::635 as permitted sender) smtp.mailfrom=massifrg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com. [2a00:1450:4864:20::635]) by gmr-mx.google.com with ESMTPS id a16-20020a05600c349000b003facc8c7725si858677wmq.0.2023.07.01.01.48.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 01 Jul 2023 01:48:45 -0700 (PDT) Received-SPF: pass (google.com: domain of massifrg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::635 as permitted sender) client-ip=2a00:1450:4864:20::635; Original-Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-992acf67388so286241766b.1 for ; Sat, 01 Jul 2023 01:48:45 -0700 (PDT) X-Received: by 2002:a17:906:101e:b0:992:9005:8302 with SMTP id 30-20020a170906101e00b0099290058302mr2932531ejm.77.1688201325169; Sat, 01 Jul 2023 01:48:45 -0700 (PDT) Original-Received: from [192.168.2.108] (93-44-206-75.ip98.fastwebnet.it. [93.44.206.75]) by smtp.gmail.com with ESMTPSA id bu2-20020a170906a14200b009829dc0f2a0sm8966007ejb.111.2023.07.01.01.48.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 01 Jul 2023 01:48:44 -0700 (PDT) Content-Language: en-US In-Reply-To: <4f0c1e08-60a7-4c97-9a7e-c3367ae32483n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: massifrg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=I5zTd0lv; spf=pass (google.com: domain of massifrg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::635 as permitted sender) smtp.mailfrom=massifrg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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:32899 Archived-At: Il 01/07/23 10:09, Sylvain Hubert ha scritto: > ok just reverse-engineered it=20 > folloing=C2=A0https://github.com/jgm/pandoc/issues/8932#issuecomment-1614= 842929 : >=20 > function CodeBlock(elem) > return pandoc.Table( > =C2=A0 =C2=A0 =C2=A0 {}, > =C2=A0 =C2=A0 =C2=A0 {"AlignDefault"}, > =C2=A0 =C2=A0 =C2=A0 {}, > =C2=A0 =C2=A0 =C2=A0 {{}}, > =C2=A0 =C2=A0 =C2=A0 {{{elem}}} > =C2=A0 =C2=A0 ) > end >=20 This is the old version of tables, that now is called `SimpleTable`, see=20 https://pandoc.org/lua-filters.html#type-simpletable You can use the same syntax with current pandoc this way: ```lua t =3D pandoc.SimpleTable( {}, { "AlignDefault" }, {}, { {} }, { { { elem }= =20 } } ) ``` and then convert it to a Table with: ```lua t2 =3D pandoc.utils.from_simple_table(t) ``` By the way, I noticed that there's no `pandoc.TableBody` constructor. The only way I found is through a lua table like this: ```lua body =3D { attr =3D pandoc.Attr(), head =3D {}, row_head_columns =3D 0, body =3D { pandoc.Row( { pandoc.Cell( { elem } ) } ) } } ``` So a minimal table is made like this: ```lua t =3D pandoc.Table( {}, -- empty caption { { 'AlignDefault', 0 } }, -- one column, default alignment and width pandoc.TableHead(), -- empty table head { body }, -- a list of one body pandoc.TableFoot() -- empty table foot ) ``` > On Saturday, 1 July 2023 at 15:58:34 UTC+8 Sylvain Hubert wrote: >=20 > Hi all, >=20 > I'm trying to create bounding boxes for code blocks by wrapping them > inside tables. > According to the manual, I should probably use some filter like: >=20 > =C2=A0 =C2=A0 function CodeBlock(elem) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 return pandoc.Table(--[[... elem ...]]) > =C2=A0 =C2=A0 end >=20 > but pandoc.Table takes a giant syntax tree with levels of all sorts > of nodes. > Neither the manual nor the error message gives a useful guide of > actually creating a table. >=20 > Could anyone provide a minimal example of creating a pandoc.Table in > a lua filter? >=20 > Thanks >=20 > --=20 > You received this message because you are subscribed to the Google=20 > Groups "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send=20 > an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org=20 > . > To view this discussion on the web visit=20 > https://groups.google.com/d/msgid/pandoc-discuss/4f0c1e08-60a7-4c97-9a7e-= c3367ae32483n%40googlegroups.com . --=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/326e3767-e3b2-2bd3-5d60-340b2f1295bb%40gmail.com.