From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32846 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: H Newsgroups: gmane.text.pandoc Subject: Re: Wrapping sections of existing document in
Date: Mon, 19 Jun 2023 20:14:57 -0400 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12457"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: K-9 Mail for Android To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCEIZSNSZ4IRBDW7YOSAMGQE674KLGY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Jun 20 02:15:14 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-qt1-f189.google.com ([209.85.160.189]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qBP1d-00035B-RH for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 20 Jun 2023 02:15:13 +0200 Original-Received: by mail-qt1-f189.google.com with SMTP id d75a77b69052e-3ff2770311dsf10038101cf.2 for ; Mon, 19 Jun 2023 17:15:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687220113; cv=pass; d=google.com; s=arc-20160816; b=r9kUWLFCciTylg0pYPylAENtEaOyt1oZOWILICrKSVBdoYajL0U6TlIdkbGPKlXi/O YxnbXQJqfhA4h+BveouYClpCcklToJD1+t4IprlXFDgJqfrqRgIUBOYTQjTy7nfeUcUb pinUx+sOKboPLhkMFHgYXHhljfpVUeLHQ1IV96tboMRtAngKriJQui7g7m27d1zLF8By 4vGC8SJAxdYZvGo92/UzyKmju90NpcMlCwm2p8E6rLa64y5q5FKFeyc0nioQyfhXRdAY zdBtHw+H7X1KZBxE8TDTDXDBa65DDmPtO2iscVsQuMFikvcBqoZ428De5OobHp2p3C7c Zpgw== 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:ui-outboundreport :message-id:from:to:subject:mime-version:references:in-reply-to :user-agent:date:sender:dkim-signature; bh=Z3MG3sz67rA7Cw+bjvzu72hFa7k19qwjizbdy9YNzWg=; b=m89UJ0a3F98bxtJ2FcZT9REyFhOGsqJvnWKHN+RsQ2ZJ6fS/NM156XxhwUtpTdzQQR O3gEroKZB8EyIe2qwLhckqTzg70yRuKfYpiE5i4R+x21Kn+PR7p/6b0+ds+VqA5R8lkZ d38andV33HHPouQ2MqanxN0vzfk8IBBAE8oVgiZaQdPMY6nbPglXBp3goJdZWfa1r1pV AGkzqx0xjI5zuDNF9M1oK4A539s7vI4yguNFtTFc+8t+i5G1SZsbHES3l8FKeU8QgXvT DKGFhgxS1edje7AZ6buUllRc81qYjR8O5Ipmiv1QL80JqWdQVUgV77myYSZ/dMLr1nyD n1uQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org designates 74.208.4.194 as permitted sender) smtp.mailfrom=agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=meddatainc.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1687220113; x=1689812113; 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 :ui-outboundreport:message-id:from:to:subject:mime-version :references:in-reply-to:user-agent:date:sender:from:to:cc:subject :date:message-id:reply-to; bh=Z3MG3sz67rA7Cw+bjvzu72hFa7k19qwjizbdy9YNzWg=; b=L24vZgEkT/MpW+o2cP0dG51oygFvJu5VAhYwg3FG5DrmtL2aBoXYEN0M+qpE9MGr5W kse+dXT4cyU1pP9BX3r+cKlksI9S9cn4LvRypTx2E7b/T3pSGDak1Emac7dyhf+6Q9qH jwnFFQOgqo+uJl1YNtJdvI1E5Ftxewb1iXlzHidNk9F4+a0UgldH9MftlvkJn7+Xxx+1 uouwuyYmzbb1GRdz+da4sEnZG9+48HqUygUsFy9eFjw68S/ldrlGpd9wUU6XrDRHfMQV PrczxTQppRq1uaqcLRi4/x98erq4E1OKfs X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687220113; x=1689812113; 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 :ui-outboundreport:message-id:from:to:subject:mime-version :references:in-reply-to:user-agent:date:x-beenthere :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=Z3MG3sz67rA7Cw+bjvzu72hFa7k19qwjizbdy9YNzWg=; b=hFG+5vRqnzr4DW7Mndh0HPctfUDUt23AE3RjsgdZwDAOoJQ20CfhZuGJ/1Ayl+HHa9 HdGOXo6EZWeKPBStwGWlyEmWgVAQERPikd4DszUObdnXFtksoEe+a0u2p17/oTnj9dFT zwQoHfiYM3qlt2YMKocyn141tB6yKfxOBAM7FBq9dpoDS93fMjTq678/62H/66/zGVAA pZ2hWxtxPU2OfNKdmK2iw9Xo80s2FZ4Fmx81GuYkfuFt6 Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AC+VfDxdAMLuxIaELOfENvLWS2ceBY+UGyQ6qtgdnAPUkx5VwYh1a+sq n1n4wzAn5iWP1YrrGiUdzNs= X-Google-Smtp-Source: ACHHUZ7hmkfFhBoxnHumCDAT3G9j3LGikeRm4rplni594+LjZsNJZDdIlsJKKJQEBP3yQn3SP05f0g== X-Received: by 2002:a05:622a:184:b0:3fd:d53a:2cdc with SMTP id s4-20020a05622a018400b003fdd53a2cdcmr13933509qtw.31.1687220112870; Mon, 19 Jun 2023 17:15:12 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:ac8:5309:0:b0:3ff:1f10:2264 with SMTP id t9-20020ac85309000000b003ff1f102264ls912304qtn.1.-pod-prod-07-us; Mon, 19 Jun 2023 17:15:10 -0700 (PDT) X-Received: by 2002:a05:620a:8e89:b0:762:739:6dac with SMTP id rf9-20020a05620a8e8900b0076207396dacmr9849129qkn.2.1687220109964; Mon, 19 Jun 2023 17:15:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687220109; cv=none; d=google.com; s=arc-20160816; b=mO1+c0IF6hAmESE0YnW3NoswS4ty4K+fvDNQWFH/uP/4TMFxqbyybKMRBfO9jcUTxK bVJvW5Mf3oWfVg2bLnex39Sf5v0upYPvQ+LZzeKp3CoqEwG47CojpvGKAvUC4D5l7FQI ZjlRt6dPIvngNcF1h71e8YXsjLwcCMnsuj1DuxItpQaspSv7Fy97PTlxK0H8msDXOBen 4c9c9JFeu4cjGQaLVbV5ZeTZK3L7r62NJCyOBTqbKehSXqR1v6tKkpvuMblqNI5VsZrP 0xYbaLSdtxymiWfx39o8MWFNLItrBK7tfFxcK55cO29wBymC5QwIC7J2ScVokC8oit8g vrgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:message-id:from:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date; bh=cqgAPHAt2Yju2+lsiIWg9Qv82aKFctoHoGg2nraX7Kw=; b=MdItixAs6188lARW1AoDyUAKJOQNoKcv/ccqzeiwwe+e8LW9Aam1/zfpCRW/Zqakhh qTr7axZojQHIV+6J3PYV51QikqBRx2bDeGetJRU0RPsLco23/Gk2tnBZ6EVUQEuRjd1f knuVB8V9FlgNtYYKkI2H6c8bRfc+N+k07UGddtxsA7yK1Z8KCwm8jiG3fav4PhYa0So4 85R0tbhbiBzVgLwNeoVm4gN2xOCC5I67tHrHp2tJJchX3qQSooQVIckosAzkCx4IY5Cz h1JXtaaq2who9I8DT4UtxlI7HRFMZv9vszLyweaKam/GHk2BQhWbTPBsf8Zwyox2lYT5 GLGw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org designates 74.208.4.194 as permitted sender) smtp.mailfrom=agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=meddatainc.com Original-Received: from mout.perfora.net (mout.perfora.net. [74.208.4.194]) by gmr-mx.google.com with ESMTPS id ea5-20020a05620a488500b007625167adc5si67608qkb.3.2023.06.19.17.15.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 17:15:09 -0700 (PDT) Received-SPF: pass (google.com: domain of agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org designates 74.208.4.194 as permitted sender) client-ip=74.208.4.194; Original-Received: from android-ac763af9abb12b56.home ([72.94.51.172]) by mrelay.perfora.net (mreueus004 [74.208.5.2]) with ESMTPSA (Nemesis) id 1MrPuF-1piMoN3sf9-00oX0P for ; Tue, 20 Jun 2023 02:15:09 +0200 In-Reply-To: X-Provags-ID: V03:K1:O8PFMex+uCyWACi9oXRu+LffY8NcKHBLJOA/sWrHcsxJdvmq0I0 jGLcj3V4iAwgzLZOG1cSnVu0wn3Ro6hHiqgW15KqUki9xPLmLJzvHIptGHPe7EAwdAMtBH+ mwD7zJw5yCjqxJFVpENrDBGtBBUuivojKsEMdreawTvyAPJcHvqByAgHfzod2qERs9FXZ1B PqsUVQJAf1HSEZOjtAQBA== UI-OutboundReport: notjunk:1;M01:P0:ooK0tQTAsPs=;OCtV+s+JsFGg9NIaa+xI/2e5/6a bnRDPgk0GpPW2M41EQQ2m9PuYRnW3NoAyK9E3kuFrA2bDdbUfTE4ikl2Q3T7IzJZMbFUUUhlk uxYzo0ehTZvMpFiPgQ+hJV0+8y8Its0z6TGzb2f+fNZOumi3kkBCmXVlJ1Gf7xsWoolERsdvK 3PCk0Uu+uFci5iXQoK0rcgOApGmlHPgEwwQHOCp2PP/qMsbLs7AKuu2wmlrsRUmIXy1aY/pJg kbFDgrjvaCQMTp3xpHGDAjteKodogweVi7gTht+GqG4Xs5ozEfBkAZjbJYyPCMO8d7G2q69h+ i7RqKKa4OEg5W1TLiUl5E3EcsvorTidjpfpTO7sgHPF4Iq/yVI/r2LGxYiSlt87eX+leJakCm +wiRpxDzf+8jU3f7yQ+ZeONKwjM14UW5/d9oKjaQbIhSRRpnEVOQFuvYNigfZBSmQb/SbqTXv lXM/V/MZZZQfrx6AoSV1Nz0drEmfmtRZJ3wJHrVIs8HThg/YZnatqjobbLAivtn0gAhKVtbRd onrHHmxYe6X0HEB8Fn4PgTDS/+EnjKK2XGcfCVBxXDMfJbDSO6HATOb+rtT/bHlUIUeLaxDLh WS+S2K1h3TQR5qJ4tBk9f0HOhxsQkuPmLQy2F3LNbtKYCTHosQFnXLYTN1LU9oDJet+cb7ejy wi2QTH0WX0OzLwRFPIE5raSIuS55hYqxWqCAhWMe0A== X-Original-Sender: agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org designates 74.208.4.194 as permitted sender) smtp.mailfrom=agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=meddatainc.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:32846 Archived-At: On June 19, 2023 6:11:35 PM EDT, H wrote: >What is the "best" way of wrapping parts of an existing document in >
in a filter? > >Using insert.table(existingtable, pandoc.Div(existingtextblocks)) does >not work since the existing text blocks get duplicated in the output. > >I see two options but there might be others: > >- Surround existing text blocks with pandoc.RawInline(1, 'html, >'
') and pandoc.RawInLine('html', '
'). > >- Create a new table and use insert.table(newtable, >pandoc.Div(existingtextblock)) and also insert the rest of the >document. > >Are there other options? Replying to my own question, it seems the most "elegant" way of accomplishing this requires this to be done be in two stages: - First, delete the blocks in question from the block list table, eg doc.blocks. - Second, insert them into the same table using pandoc.Div(). Unfortunately it seems table.delete() does not accept a list of blocks, only one block at a time, pandoc.Div, on the other hand, accepts a table. Here is a code example when I was trying it out: local temp = {} for i = 3, 1, -1 do table.insert(temp, table.remove(doc.blocks, 5)) end table.insert(doc.blocks, 2, pandoc.Div(temp)) The above code removes blocks 5 through 7 from doc.blocks, then inserts them, in the same order but surrounded by
, in position 2. If there is a better way of accomplishing this, I would appreciate hearing it.