From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30704 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Printing lua tables Date: Tue, 07 Jun 2022 06:55:16 -0700 Message-ID: References: <551a3f2a8d364717bcc569baa974573a@unibe.ch> 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="4037"; mail-complaints-to="usenet@ciao.gmane.io" To: William Lupton , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBSFR7WKAMGQE2PM3WJI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Jun 07 15:55:25 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pg1-f186.google.com ([209.85.215.186]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nyZg4-0000qB-FU for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 07 Jun 2022 15:55:24 +0200 Original-Received: by mail-pg1-f186.google.com with SMTP id h11-20020a65638b000000b003fad8e1cc9bsf8683773pgv.2 for ; Tue, 07 Jun 2022 06:55:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1654610123; cv=pass; d=google.com; s=arc-20160816; b=qXKNtvk3WTTFJrv/zgdPhvlL6qg21GET2ifx/QsijUawQPdJtVmkUa5idcm3YKp9I2 qcSo2alj6hVTdXB9J4ojoRd9HXl9IwnPJ9QlGQ/4+oJ9ak6dFulYf8RDzn4KOKHwBdxG frnlY+W2hW1DwLBgUs+IAJMSNxw5knQeTHcs2lZI2s82VPg2GqtcXPoK2ATdJNAB0fOP tuiTx7xoq2tzbW8EgGk+/k/Lan7ueIR0L5QxCnWQQotP/EZvJNDrd3gv/ZUHZ6k9FDCK hHXcRwZYMMgT0vSfHFQfKQnuGb3Kd6r6KYfGvbBVnpbTLxHGS9DWFB/wcnq2jXuy2vLO yklA== 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 :mime-version:message-id:date:references:in-reply-to:subject:to:from :sender:dkim-signature; bh=jx0m3ezVBty3lATy3P0d41G+6kMH4p+FVU3vHj4m3lY=; b=fJZPnJE5SdXUU+KYfejDJ8S1dLKwuG/JirZxLkngCSSNwEHO0JTqaHoO7ui8SXjaN8 BDGGtCl0rC9zZpiyzh+DSnxBMl6k6eSIkJprljgzaoYCEjPmFXJFnMc9gqMxAAVaVCsu ZV/SSVFY6GM88XOS62QL4v0JY3VJPe4UYI9rcdo67VwuZXC8h5xv2NIXFDD/lhWyRTQ2 Gmt3WLtLCoTdvTqt8VOhVWAwQxeqDXifUshJg4UXkNM1fBkGKXxWbBc8RzOyRmXZmxfH j9IytQ92IKsjfHhfcGJAG813kO6dfoaFTXWNH1H4Y/YDpibo9oUKbLjV/wY5lCisjKaW Iltw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley.edu header.s=google header.b="C6k/vq/q"; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::42c as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=berkeley.edu DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding: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=jx0m3ezVBty3lATy3P0d41G+6kMH4p+FVU3vHj4m3lY=; b=jSutAOR/YYGTmZgnzsoyHonA/OCB27RRBNrW1zHYw/7gT0JpAg4QXhTzqOO/i19yWS sHw25c1LYe5vfHftxvjr3SSVP8VCjyTj0TeXRE8FW7FCGRS86xXYNXcQ4MN6E6Nn/ONA /KUvhSjRZV6BftZn2FRyeVsAdWpQ5Bybw2Y7RoBLRJOCbWeF0qAzDJmzkVE82A19Q75D Dr9D016Q1F/bEIIfkmmOIyDZb03Auoh016cPxiyDwpYgml6yeH6eMhNJEe1T4nU/JImS Vf3d+J2zOAgu1OqBbZd5ffQaD8XOfrdyW1baquPKBneHh1CkxGQAGmMM4gSW45A1l9ov 0wfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:to:subject:in-reply-to:references :date:message-id:mime-version:content-transfer-encoding :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=jx0m3ezVBty3lATy3P0d41G+6kMH4p+FVU3vHj4m3lY=; b=aPC+HY1fAp/1YI5jXcLVfsyBgpZFsa/CEON5Hpz/bJ9DybFROuY0wA5H3PgG5dhA/O NtIG7YbuxhksKgKoBS9UcCfOT+Uzbu7P9qyqMPzpNKJKDcmsMaXjhJ9svFWNWq7j+H4p hQoKbXh643ba3AvVCpaUiszm+JzDTPoh8fXwTkTwQTHRP3PyiHFrsptFRIaVQADKxk/y L2ALXhgj0m9+r0w/YR8sSYVWahl3BwrHKivKa4bHhFAojnXoofpEDWg68mC61VoSDbMh Kv1vBeshzm4ONqLHZHGjY/g/A7xy/0DnMz3EsKHCvjOH/mJw3oYdrzsVyvAg/hYwAh6c Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM531q54C/0CYdhD3pnRx5+zAwoyOhouD3fhnkrc06W29IoKQb+AQR 8rMKoGjEeEk0E6Qp5kwdufw= X-Google-Smtp-Source: ABdhPJw/aEYjVu8AOSCxPeO6v84Bfph8lah1xFi5ee/pFaOc+uDY7GZjkJUyfvFPedIkloGQrNN4qg== X-Received: by 2002:a17:902:d4cd:b0:167:4fa1:44b6 with SMTP id o13-20020a170902d4cd00b001674fa144b6mr20994647plg.15.1654610123229; Tue, 07 Jun 2022 06:55:23 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6a00:139c:b0:51c:445b:5ac4 with SMTP id t28-20020a056a00139c00b0051c445b5ac4ls761208pfg.3.gmail; Tue, 07 Jun 2022 06:55:19 -0700 (PDT) X-Received: by 2002:a63:d154:0:b0:3fc:e1c1:50ea with SMTP id c20-20020a63d154000000b003fce1c150eamr23922937pgj.67.1654610119513; Tue, 07 Jun 2022 06:55:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654610119; cv=none; d=google.com; s=arc-20160816; b=wrnA9Oq7P36D5BeJPUR2yJutX1iUgeQHmT1k0PWahlFFwRnGlVQKZwYAWOualySXji UBm2HSzyjkcGUFFcufYsIuQxXPe08xQxe2ZtBV3zJrIjW5Afq0LiT3r5zL3DXNmpBBtp +92Kwcc6sqFvL1vlUp+bHzl+5Qj4ReTFoDPVHw37IJfTYY61CU3wYO+Mhx61EeKkZg3G rtHiUh+ZpTS/kjcxQ1aOyNPPEw9LLIDOmKXkeZV6vDPhAMUKItPFIy4yQhz288jkVx3s p2614TN+VqoKgL1ZH4/qytCV5URXak9Z5HyRaXpxo1jI247sjzeTk21ExvAfa7fsfnCD sW0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:dkim-signature; bh=iH+iX7s/oLw13C9yf7jfsztB4dX/p1mGI6eEbrwO+zY=; b=LBMoG7JUjhYHzKTLtOqTYKXiGrXcuIXz/EVkeRfMT2wX1K/dySEGfcMk/3g8YT3+JU 0DnMyqrSyaxDL1F8k9mT0pGrr4nBSkH9SU99EmT9+rX7720yH1I50z9R9DFhoLTaYOr1 tC2yYoFs8ZcgQ2fgaLTDzxtnjnP4lKIpPGBwnlgwjUd1lFFAoZ2cXwSB9K7hJ6w5RjkX l1HrrY7TaDK7nXFefbpm+pzCPxVqFZ2dmE//c5UgYhWUeB1HR/I0eY8sq45OsU/8/aGX hnSt4OyIBoc2fKHTkjAu5pgOGxvpon65g3siwlo/ZAGEgMqxzRC/r6LS8UJJJIpjNb81 V1Ng== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley.edu header.s=google header.b="C6k/vq/q"; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::42c as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=berkeley.edu Original-Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com. [2607:f8b0:4864:20::42c]) by gmr-mx.google.com with ESMTPS id jd21-20020a170903261500b0014f3d55ede2si771322plb.2.2022.06.07.06.55.19 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jun 2022 06:55:19 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::42c as permitted sender) client-ip=2607:f8b0:4864:20::42c; Original-Received: by mail-pf1-x42c.google.com with SMTP id bo5so15608563pfb.4 for ; Tue, 07 Jun 2022 06:55:19 -0700 (PDT) X-Received: by 2002:a62:6411:0:b0:50a:81df:bfa6 with SMTP id y17-20020a626411000000b0050a81dfbfa6mr30160417pfb.26.1654610118883; Tue, 07 Jun 2022 06:55:18 -0700 (PDT) Original-Received: from hermes.johnmacfarlane.net ([45.32.92.108]) by smtp.gmail.com with ESMTPSA id p2-20020a056a0026c200b0050dc76281e5sm9166400pfw.191.2022.06.07.06.55.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 06:55:18 -0700 (PDT) Original-Received: by hermes.johnmacfarlane.net (sSMTP sendmail emulation); Tue, 07 Jun 2022 06:55:16 -0700 In-Reply-To: X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley.edu header.s=google header.b="C6k/vq/q"; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::42c as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=berkeley.edu 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:30704 Archived-At: That looks nice. Can you share your utils.lua? William Lupton writes: > I think I've mentioned this before... but I'd be happy to contribute (in = a > suitable form) the somewhat-pandoc-aware utility that I use for this. > > Given this input: > > *% *cat doc.md > > --- > > a: 1 > > b: | > > 2 3 4 > > --- > > > # Header > > > This is a sentence (and a paragraph). > > > * This is a list item > > * And another > > > | Right | Left | Default | Center | > > |------:|:-----|---------|:------:| > > | 12 | 12 | 12 | 12 | > > | 123 | 123 | 123 | 123 | > > | 1 | 1 | 1 | 1 | > > > : Demonstration of pipe table syntax. > > and this filter: > > *% *cat rep.lua > > local utils =3D require 'utils' > > > -- do it this way to avoid reporting MetaBlocks twice > > function Pandoc(doc) > > utils.temp('meta', doc.meta) > > utils.temp('blocks', doc.blocks) > > end > > this command: > > pandoc doc.md -L rep.lua >/dev/null 2>doc.txt > > generates the attached. > > On Tue, 7 Jun 2022 at 08:57, wrote: > >> Hi, >> >> When playing around with filters I use pprint.lua or inspect.lua to >> visualize lua tables. Would it make sense to include some sort of =C2=AB= print >> the contents of this table=C2=BB to pandoc ? >> >> Best, >> >> Denis >> >> -- >> You received this message because you are subscribed to the Google Group= s >> "pandoc-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send a= n >> 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/551a3f2a8d364717bcc569b= aa974573a%40unibe.ch >> >> . >> > > --=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 pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msgi= d/pandoc-discuss/CAEe_xxiL81rUdVtCeKovjYeo%3DKaKP1GAbwEiM6_9byZY8t_XvA%40ma= il.gmail.com. > (#) meta { > a: MetaInlines { > [1] Str text: "1" > } > b: MetaBlocks { > [1] content: Para { > [1] Str text: "2" > [2] Space {} > [3] Str text: "3" > [4] Space {} > [5] Str text: "4" > } > } > } > (#) blocks { > [1] Header { > attr: Attr { > attributes: {} > classes: {} > identifier: "header" > } > content: { > [1] Str text: "Header" > } > level: 1 > } > [2] content: Para { > [1] Str text: "This" > [2] Space {} > [3] Str text: "is" > [4] Space {} > [5] Str text: "a" > [6] Space {} > [7] Str text: "sentence" > [8] Space {} > [9] Str text: "(and" > [10] Space {} > [11] Str text: "a" > [12] Space {} > [13] Str text: "paragraph)." > } > [3] content: BulletList { > [1] { > [1] content: Plain { > [1] Str text: "This" > [2] Space {} > [3] Str text: "is" > [4] Space {} > [5] Str text: "a" > [6] Space {} > [7] Str text: "list" > [8] Space {} > [9] Str text: "item" > } > } > [2] { > [1] content: Plain { > [1] Str text: "And" > [2] Space {} > [3] Str text: "another" > } > } > } > [4] Table { > attr: Attr { > attributes: {} > classes: {} > identifier: "" > } > bodies: { > [1] { > body: { > [1] { > [1] Attr { > attributes: {} > classes: {} > identifier: "" > } > [2] { > [1] { > col_span: 1 > contents: { > [1] content: Plain { > [1] Str text: "12" > } > } > alignment: "AlignDefault" > row_span: 1 > attr: { > [1] "" > [2] {} > [3] {} > } > } > [2] { > col_span: 1 > contents: { > [1] content: Plain { > [1] Str text: "12" > } > } > alignment: "AlignDefault" > row_span: 1 > attr: { > [1] "" > [2] {} > [3] {} > } > } > [3] { > col_span: 1 > contents: { > [1] content: Plain { > [1] Str text: "12" > } > } > alignment: "AlignDefault" > row_span: 1 > attr: { > [1] "" > [2] {} > [3] {} > } > } > [4] { > col_span: 1 > contents: { > [1] content: Plain { > [1] Str text: "12" > } > } > alignment: "AlignDefault" > row_span: 1 > attr: { > [1] "" > [2] {} > [3] {} > } > } > } > } > [2] { > [1] Attr { > attributes: {} > classes: {} > identifier: "" > } > [2] { > [1] { > col_span: 1 > contents: { > [1] content: Plain { > [1] Str text: "123" > } > } > alignment: "AlignDefault" > row_span: 1 > attr: { > [1] "" > [2] {} > [3] {} > } > } > [2] { > col_span: 1 > contents: { > [1] content: Plain { > [1] Str text: "123" > } > } > alignment: "AlignDefault" > row_span: 1 > attr: { > [1] "" > [2] {} > [3] {} > } > } > [3] { > col_span: 1 > contents: { > [1] content: Plain { > [1] Str text: "123" > } > } > alignment: "AlignDefault" > row_span: 1 > attr: { > [1] "" > [2] {} > [3] {} > } > } > [4] { > col_span: 1 > contents: { > [1] content: Plain { > [1] Str text: "123" > } > } > alignment: "AlignDefault" > row_span: 1 > attr: { > [1] "" > [2] {} > [3] {} > } > } > } > } > [3] { > [1] Attr { > attributes: {} > classes: {} > identifier: "" > } > [2] { > [1] { > col_span: 1 > contents: { > [1] content: Plain { > [1] Str text: "1" > } > } > alignment: "AlignDefault" > row_span: 1 > attr: { > [1] "" > [2] {} > [3] {} > } > } > [2] { > col_span: 1 > contents: { > [1] content: Plain { > [1] Str text: "1" > } > } > alignment: "AlignDefault" > row_span: 1 > attr: { > [1] "" > [2] {} > [3] {} > } > } > [3] { > col_span: 1 > contents: { > [1] content: Plain { > [1] Str text: "1" > } > } > alignment: "AlignDefault" > row_span: 1 > attr: { > [1] "" > [2] {} > [3] {} > } > } > [4] { > col_span: 1 > contents: { > [1] content: Plain { > [1] Str text: "1" > } > } > alignment: "AlignDefault" > row_span: 1 > attr: { > [1] "" > [2] {} > [3] {} > } > } > } > } > } > row_head_columns: 0 > head: {} > attr: { > [1] "" > [2] {} > [3] {} > } > } > } > caption: { > long: { > [1] content: Plain { > [1] Str text: "Demonstration" > [2] Space {} > [3] Str text: "of" > [4] Space {} > [5] Str text: "pipe" > [6] Space {} > [7] Str text: "table" > [8] Space {} > [9] Str text: "syntax." > } > } > } > colspecs: { > [1] { > [1] "AlignRight" > } > [2] { > [1] "AlignLeft" > } > [3] { > [1] "AlignDefault" > } > [4] { > [1] "AlignCenter" > } > } > foot: { > [1] Attr { > attributes: {} > classes: {} > identifier: "" > } > [2] {} > } > head: { > [1] Attr { > attributes: {} > classes: {} > identifier: "" > } > [2] { > [1] { > [1] Attr { > attributes: {} > classes: {} > identifier: "" > } > [2] { > [1] { > col_span: 1 > contents: { > [1] content: Plain { > [1] Str text: "Right" > } > } > alignment: "AlignDefault" > row_span: 1 > attr: { > [1] "" > [2] {} > [3] {} > } > } > [2] { > col_span: 1 > contents: { > [1] content: Plain { > [1] Str text: "Left" > } > } > alignment: "AlignDefault" > row_span: 1 > attr: { > [1] "" > [2] {} > [3] {} > } > } > [3] { > col_span: 1 > contents: { > [1] content: Plain { > [1] Str text: "Default" > } > } > alignment: "AlignDefault" > row_span: 1 > attr: { > [1] "" > [2] {} > [3] {} > } > } > [4] { > col_span: 1 > contents: { > [1] content: Plain { > [1] Str text: "Center" > } > } > alignment: "AlignDefault" > row_span: 1 > attr: { > [1] "" > [2] {} > [3] {} > } > } > } > } > } > } > } > } --=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/m2y1y8fuij.fsf%40johnmacfarlane.net.