From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31004 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Move TOC when converting html to docx Date: Mon, 18 Jul 2022 10:07:00 +0200 Message-ID: References: <77066946-d07a-489a-9ec2-99796422f682n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) 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="26195"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDW7ZIEHTIIBBJ5J2SLAMGQEBFUF6XI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Jul 18 10:07:08 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lf1-f57.google.com ([209.85.167.57]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oDLmW-0006gN-07 for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 18 Jul 2022 10:07:08 +0200 Original-Received: by mail-lf1-f57.google.com with SMTP id p36-20020a05651213a400b004779d806c13sf3976869lfa.10 for ; Mon, 18 Jul 2022 01:07:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1658131627; cv=pass; d=google.com; s=arc-20160816; b=FispGioK+Sr5iKUCKlPJ9JLIscj/O2pJC7KYj1YKie5LRZsoyZQHnNW9i167w1tnCw Jqr96+5Ktz8Q4HyXEE80Xs9nMzeiz8nimDhqqBNfwrpWgvR7TBH+ELcPDcxKe5UakAqe LZuNv47LUrYiGI+O/pS7D3uEJ2CUrfeOfBQoQh8UTbSZJ0uLTvG1yII5ISMXzThIUoeY pYZn8qUphO0SvVjcfDAEMZZhQ7NwIw+vf6FljLQ1qudqRHXloxAcOiPuwyQLhRJKWkyA 4y7acjSyTExfehWKBsJ5hbVVl/GKQSGdjz1/dmfgXrgFXTv4oPRx4qwTNq6nmrBSKAls XhYw== 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:message-id:in-reply-to:to :references:date:subject:mime-version:content-transfer-encoding:from :sender:dkim-signature:dkim-signature; bh=B9RdnYZzqg9snzPiL80K659ziyk6nZ9bBwGiSO/+UPU=; b=hFdf3+YxDrwVJoAjcZ+KOgG28d1kKHavQt6WebbCFTVjJ156T+1wspE0fEpExveeHW fQrnWiS0OKjCfQw5kHtdjhLuZSLX5Arx6r88wLNXJF6MTNQI6ILNnxCrbqX4MlKkK33m tnWABiY37HsOyUe9fnUWDBF/tMStNU+8u1WPATaw+zXkp1fpjd16rHTsQk4s3Qfun25u rJjqNBIsP35WdIY8oMaywDXr4DT+7qpSRvZXbCFeZrh0hpvQDdWyhfPnA7miqrI8m/Ar Bv+YyLYG09wL5ptkS6XlbP6zPfwi2s6fF7jgeGBK2BMuj1uTUTtTtuoYTwTuxWsY0pWp BKKA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LxWkWT73; spf=pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::32e as permitted sender) smtp.mailfrom=fiddlosopher-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=20210112; h=sender:from:content-transfer-encoding:mime-version:subject:date :references:to:in-reply-to:message-id: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=B9RdnYZzqg9snzPiL80K659ziyk6nZ9bBwGiSO/+UPU=; b=bVB6UChdcDW/NdyUpnCyfTqUDVX3eN0+8DL2E02ihr6MYIOpFi2x48+PRodoMQaObO JGkMzAdbbNoP98SZ0p5v5w2CeY9sOfcp+4eFyOZH+7qZpl2Aw+cWME8me0IZWR0HA/tu +qY+3b3K4DD2cWhdp1SAneGQS5/QCanzDltFyDUkE1GkQIQIKozZSsY8pHSbgTf3MQ/q /LD9mJDJHL4tGO3ZzI5yxRLPVdNQTbVY7o2xeGIELw8orvut0Lgbwik2br57M30jz10j ALbVjCOSf/RA8y2/lU3QN43F4/oSegGIB2U38ITGDr39Qj3BPkigThHkszmgx+bxaGcw 5gWQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id: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=B9RdnYZzqg9snzPiL80K659ziyk6nZ9bBwGiSO/+UPU=; b=J4c3XT7JIIkX2bCy82qzhEhvQYbBKKKePaFcQlNNYbtRWQnRwSIvV1YQZ+f9TWacLO o10Mf3VLSxZK88Xy0uQo+jjKnVXMWPQryv/JT6nrtphZhDIcb9WtBb/UiCK7VseJUAOl 0LWtdGwFuPO9nO6EUMprQnqGBIIwIq6cE0MKeeSHmkpQf9crrQ4+wXt5/6THnqPsxhq0 vaSpDiuROz1Dl7XPP/aSa1r0OgSmVO4tARKMCmvcnfhql1FPWh0n2OLhyzr095TO+MD4 KVe9rxLHEarYQALojho1MG+UaoGU9XSy80DpMQkMgZFY0ubq2ulISYNBbvoioa1cVWse rsCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:content-transfer-encoding :mime-version:subject:date:references:to:in-reply-to:message-id :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=B9RdnYZzqg9snzPiL80K659ziyk6nZ9bBwGiSO/+UPU=; b=nPnw5JkaYXWGa7GDfr3i5iucMu0SlvZaA5NN4u1Zxtk6mHHgHG8WmMY9Allo/K5Fpy xAjbLNe7jOTIXknDNKde7hw+P6H7QnbIlxguVMwiaSBJsyxsQz0RBpdp2NCLCX04+Xn2 Mu/lmPSGgLWZEhxiXAXpRtyIZul8uvOfPQT0r5U6UA+Mgt/Q5s4DIFMWi4zUhirj2axx xrBOA79KyUoBta3Iw+xE9Y60Sfcn//02XUyvFEue6XOb3gbVF5YuW2bVEg745owLYD7/ EFGabAJ3OroOCEJOGt63vsxhkPeWNolVSxM6PWlQQsgrP53tdCe6AbdBUo6Nt2um+sUD Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora9hhV4W9OsS/+SYYqHmc1LPttEO40itO/LEP9MDl++nfbxLXCgj JdoGzXwktTbAGNwMkhjh+MU= X-Google-Smtp-Source: AGRyM1vmxRYANwTCSl1xFz8kb5Q/3oqHihJTBEjzd+lhkr91bswX+Wip+kM1FIArHFi5ipVkFheE6Q== X-Received: by 2002:a2e:9b13:0:b0:25d:524e:9490 with SMTP id u19-20020a2e9b13000000b0025d524e9490mr11665358lji.343.1658131627412; Mon, 18 Jul 2022 01:07:07 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:651c:2102:b0:25d:5f70:6f64 with SMTP id a2-20020a05651c210200b0025d5f706f64ls2871743ljq.1.gmail; Mon, 18 Jul 2022 01:07:02 -0700 (PDT) X-Received: by 2002:a05:651c:1026:b0:25d:8f2a:fcd3 with SMTP id w6-20020a05651c102600b0025d8f2afcd3mr12036731ljm.519.1658131622747; Mon, 18 Jul 2022 01:07:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658131622; cv=none; d=google.com; s=arc-20160816; b=AX5oBjgyyOrOYLJS2Ufnlur2tSwohSI7bpJN1saUOhPW04tON8iMxXAKWR3wBWasft rfq17TMk/oNi7SwouE7zxbpXEN8aWeigc1fKgZjRo4Z3c57xkW8n+ChFP8AN0u178pfY iiIqM63Z2eiypqviwbeJA6VvO7HXviiF+QB4eJbITH3cizTUsibjXmmfQqjVledgaBom d2i84ULTjoCX11/Oxdv0Th7JXS/ZyRZjwSTBY8WAQglr4z5GxRwuQruAnAyNnAWW0swk X9k8KAaAiARWXL/3hpPNP2tpieCDlCCTOCUM7yDW6ThsHmd9YnkdFagA0GijIwTNbcJR y9WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:dkim-signature; bh=acbpThhLtysMkUMTXEzDeVIPqIac+YFbN8PT2r9WlIU=; b=PLupyHHZX82KDHCew6fkp4zAv+EWTlb1WZfOkyt3zYGP74uNI78A03oX8S2E+B7QP7 tA5cx+yLwsN56IryZ0PX8ym1OTN6G9+7gb7c1UgvdWIKjIjMH+8LSCANcVSezg48JnrW 6avqnh7k422P9r1IdjKbn1oA2h5DHWUy8yTjuIkknzbk9DTrh3vN1bHYMG7g/9Hridil gWmBOqGyFww5R/Ixs8xtmfnrT9p5qNNQvl35EEW97g3aCvGr38efBU92XsvuPwnEIjHG sQ6IrM/lVn6MDZxCIg8vTmThrLQGEQjuH1evf6Fk7EOE7lqxgS3pKSEqbalJS55yWb0b 23vQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LxWkWT73; spf=pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::32e as permitted sender) smtp.mailfrom=fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com. [2a00:1450:4864:20::32e]) by gmr-mx.google.com with ESMTPS id o5-20020a05651205c500b0048858e79d43si323030lfo.10.2022.07.18.01.07.02 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Jul 2022 01:07:02 -0700 (PDT) Received-SPF: pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::32e as permitted sender) client-ip=2a00:1450:4864:20::32e; Original-Received: by mail-wm1-x32e.google.com with SMTP id b6so6105217wmq.5 for ; Mon, 18 Jul 2022 01:07:02 -0700 (PDT) X-Received: by 2002:a7b:c3c6:0:b0:3a3:2065:e022 with SMTP id t6-20020a7bc3c6000000b003a32065e022mr62994wmj.117.1658131622080; Mon, 18 Jul 2022 01:07:02 -0700 (PDT) Original-Received: from smtpclient.apple ([2a01:e0a:3b2:82e0:9c9:8601:1798:3a4d]) by smtp.gmail.com with ESMTPSA id r10-20020a056000014a00b0021d68a504cbsm10256543wrx.94.2022.07.18.01.07.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jul 2022 01:07:01 -0700 (PDT) In-Reply-To: <77066946-d07a-489a-9ec2-99796422f682n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Original-Sender: fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LxWkWT73; spf=pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::32e as permitted sender) smtp.mailfrom=fiddlosopher-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:31004 Archived-At: There's a special syntax in the docx file to include the table of contents;= you're not going to be able to do it this way. Maybe your best approach would be to have a script modify the docx after pa= ndoc produces it. A docx is just a zip file containing xml documnets, so yo= u'd need to unzip it, modify document.xml, and zip it back up. The modific= ation would simply consist of moving the XML elements that produce the TOC = to another location in your document.xml. > On Jul 11, 2022, at 10:48 AM, Ismail Jattioui wrote: >=20 > Hi, >=20 > I am trying to convert a html file to docx using pandoc. My problem is th= at I can=E2=80=99t manage to move the table of contents to a specific posit= ion in the document. I tried splitting my document into two, then merging i= t again but it isn=E2=80=99t optimal since we are using it in production an= d it costs us 2 calls to pandoc and it isn't very maintanable >=20 > I was wondering if there is a way to do that using Lua filters >=20 > In a nutshell, let=E2=80=99s say I have the following html document that = I wish to convert to DOCX : >=20 > > > > > >

Title 1

>

Some stuff 2

>

Subtitle 1

>

Some stuff 2

>
Other things
>
Insert TOC below
> >=20 > How do I manage to generate a Table of content below the div with the TOC= id, without splitting the document ? >=20 > Thanks in advance >=20 > --=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/77066946-d07a-489a-9ec2-99796422f682n%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/EE47F68F-93F4-41CF-B650-7B1E1613D00E%40gmail.com.