From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32898 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sylvain Hubert Newsgroups: gmane.text.pandoc Subject: Re: How to wrap code blocks within new tables? Date: Sat, 1 Jul 2023 01:09:50 -0700 (PDT) Message-ID: <4f0c1e08-60a7-4c97-9a7e-c3367ae32483n@googlegroups.com> References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_42278_1146359621.1688198990294" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17506"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDX6LT7YRQIBBUF676SAMGQEXJ4N77A-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Jul 01 10:09:57 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pf1-f191.google.com ([209.85.210.191]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qFVg5-0004NG-7o for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 01 Jul 2023 10:09:57 +0200 Original-Received: by mail-pf1-f191.google.com with SMTP id d2e1a72fcca58-666eb0346c4sf2132839b3a.0 for ; Sat, 01 Jul 2023 01:09:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1688198996; x=1690790996; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=MIxZe0kMODr/fOB81zaAnigEEx1jrqDkTl5nwyazJGI=; b=eeqGOhGre3HPB++hKS2AcrH36VbR2biRJAXY2T1o5lghLl5P4D6NV4YVfmkxBf6zbq TKCXc4duFz1lXt/7oQH9Q/tKmLXXTJ3LjSKMcFzZtw4ZQUwg6XaEDhkYnEwJmstW1oKM VJ4MQ7EQDUTpkUdbOgr4lf/5KQ6ERvCHvUXtgKcYXgict86I3VZQjN7ccPOML8obp6V3 fkTa2IEePbJ5K5pBkk+FHkPC1rtm18spS6P7nXZB4ZCLpKsxLZrvaaok0mpd3sNsJCeW nbi5m6I1BgKDzZkPO0818n3Mj3TBD7oRa+qgcd6txF1whyaBIsX6tQClKlNOwH4io5fY IT8g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688198996; x=1690790996; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=MIxZe0kMODr/fOB81zaAnigEEx1jrqDkTl5nwyazJGI=; b=RFLibhSOxUDfbRc6FbI/LWRDgbaGxG0f2YrZjlCobqj+1UA0iwkJYbrax4O5keKylh Ri28Kx36Cl4pm+9YYkM0gIEC5hOnBQzG7uHIQmRtSbkQxuevwN6NcaVbBdjBP6xce5xP 9rugSj9m6S5YsIa/IoueLCalge0Awd8e4WMJwRxV0Sqc2vbXCPqs0DoL7evv3psI0m6I YsRGPrHzw89abEmjtzyww6Apd6TLGWyQ8v9xUfPPUCtj5MX5jfcTu+Ekerk/gO7nHJcL YwDq9mN7s0+EAV/Hw4pebvPnpcAzRQPiJyhaFaWvFeJDtdk58e+Xh721FRBiOKy0ph6J A2Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688198996; x=1690790996; 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-sender:mime-version:subject:references:in-reply-to :message-id:to:from:date:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=MIxZe0kMODr/fOB81zaAnigEEx1jrqDkTl5nwyazJGI=; b=gXK/Jp7dm307B/ZOKyNoyufUlJ513ThPNt+Ev56rOdoPd3BpxJ3eYpkDlOaaVQmHYZ V8K3y0x+W1SrkAq1zubroxY6+XanEiyPzDjjGeoaoS98i2CHADw7hi4J3uHMLJp7odD0 XBZM8aJa15lsvNsklpT8xJsc5p737NSkqnM4uCokARsHO9Bjxz+OppYFljKBdq/1MIPy +jgHIoquX1f9uXTDWTbYfKyZlrmAPQyI6zCiL9y9G0UqEgc+D2EMcjAOIEDIVrPb5LtR vTSkwtM+X/VwTWNiqNcM1pqmoWjTxo9cbBKQWCCvmQ2WsNCZuK Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ABy/qLar5S7ylNe0n74ZgQR5xmUvOGB3NHEhrZjqKfuK3EF1x7vpr+qk KaTW6W4eqGTGVy2Vp/7VcW8= X-Google-Smtp-Source: APBJJlHuBzUFDFHhzV5PE7ReD+X8sqUd9z8o+NU032ZtZ0NmoHxVYQqYrFvuZAbaq8eSNmPMM1xdpA== X-Received: by 2002:a05:6a00:22cb:b0:63d:3339:e967 with SMTP id f11-20020a056a0022cb00b0063d3339e967mr4554722pfj.19.1688198995677; Sat, 01 Jul 2023 01:09:55 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a62:82c8:0:b0:672:26c7:59f2 with SMTP id w191-20020a6282c8000000b0067226c759f2ls1338475pfd.1.-pod-prod-05-us; Sat, 01 Jul 2023 01:09:51 -0700 (PDT) X-Received: by 2002:a05:6a00:114a:b0:668:8596:7538 with SMTP id b10-20020a056a00114a00b0066885967538mr6141630pfm.6.1688198991132; Sat, 01 Jul 2023 01:09:51 -0700 (PDT) In-Reply-To: X-Original-Sender: champignoom-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:32898 Archived-At: ------=_Part_42278_1146359621.1688198990294 Content-Type: multipart/alternative; boundary="----=_Part_42279_934299546.1688198990294" ------=_Part_42279_934299546.1688198990294 Content-Type: text/plain; charset="UTF-8" ok just reverse-engineered it folloing https://github.com/jgm/pandoc/issues/8932#issuecomment-1614842929 : function CodeBlock(elem) return pandoc.Table( {}, {"AlignDefault"}, {}, {{}}, {{{elem}}} ) end On Saturday, 1 July 2023 at 15:58:34 UTC+8 Sylvain Hubert wrote: > Hi all, > > 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: > > function CodeBlock(elem) > return pandoc.Table(--[[... elem ...]]) > end > > 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. > > Could anyone provide a minimal example of creating a pandoc.Table in a lua > filter? > > Thanks > -- 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/4f0c1e08-60a7-4c97-9a7e-c3367ae32483n%40googlegroups.com. ------=_Part_42279_934299546.1688198990294 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable ok just reverse-engineered it folloing=C2=A0https://github.com/jgm/pandoc/i= ssues/8932#issuecomment-1614842929 :

function CodeBlock(elem)
=C2=A0 =C2=A0 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

=
On Saturday, 1 July 2023 at 15:58:34= UTC+8 Sylvain Hubert wrote:
Hi all,

I'm trying to create boundin= g boxes for code blocks by wrapping them inside tables.
According= to the manual, I should probably use some filter like:

=C2=A0 =C2=A0 function CodeBlock(elem)
=C2=A0 =C2=A0 =C2=A0= =C2=A0 return pandoc.Table(--[[... elem ...]])
=C2=A0 =C2=A0 end=

but pandoc.Table takes a giant syntax tree with l= evels of all sorts of nodes.
Neither the manual nor the error mes= sage gives a useful guide of actually creating a table.

Could anyone provide a minimal example of creating a pandoc.Table in = a lua filter?

Thanks

--
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/4f0c1e08-60a7-4c97-9a7e-c3367ae32483n%40googlegroups.= com.
------=_Part_42279_934299546.1688198990294-- ------=_Part_42278_1146359621.1688198990294--