From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30947 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ismail Jattioui Newsgroups: gmane.text.pandoc Subject: Move TOC when converting html to docx Date: Mon, 11 Jul 2022 01:48:41 -0700 (PDT) Message-ID: <77066946-d07a-489a-9ec2-99796422f682n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1426_1318162947.1657529321673" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24363"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDH3TLP3SIARB2WHV6LAMGQEJKWC2EY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Jul 11 10:48:47 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-yw1-f186.google.com ([209.85.128.186]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oAp5y-00066a-3v for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 11 Jul 2022 10:48:46 +0200 Original-Received: by mail-yw1-f186.google.com with SMTP id 00721157ae682-31c88e36c0bsf40251287b3.20 for ; Mon, 11 Jul 2022 01:48:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:date:from:to:message-id:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=4QcRuGQ382VqDzMQgichP8CEYGa0fuzZ05dl2ZJ0zU4=; b=rS8jRZB6LyUnyKatBzcP+GiyUONj8XzAUNTyBaxlh7EsDcshSoCVFcxyFnskeQjjVu JKreOveqOCM3yPBzRpDOOKTI401lSV09i5v/Kp9iv3r7Ff43IUJMNkOblLSO+OIQUVmi ooeYu7QsobuRMl507MUVqsc/epFycfHcrGOzkJbn3n6etU9ddhFgeYZNyKLdFZvNr/XG irQIG4MJGt3FlIM4Z+PGlYlJNInCbs8EbFuu7Ij2zrBOHL42h3LiGfn5CI3SarAzvXkZ fLsGRWs/a85W5uez3dzcEfbJe0S/Eg+YxW3qPCcp7cgywIt9FVsW8mxk0ODAtljGEUNS 8IkQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:message-id:subject:mime-version:x-original-sender :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=4QcRuGQ382VqDzMQgichP8CEYGa0fuzZ05dl2ZJ0zU4=; b=qMFTHG48x0jcBbiMBGu2zEOHbGmqajFG6U89lWXAT/+5yB2o/s6+S5AeGIPsaWb68H OgbN7JMPZt0U65l+kkSSNqAK9+Useolw2vYnlE1gpMyFpuBaVhaYXGOruvmmWeGaVs+a 0Ex+XqdxsBlgfyxE2Cu/o4JIhlBZghc5ZXqqOKSC8eettF2MpIbk/8qvw8+ADLo5Dcps xcb/svUb78MlbRqtXNG8EkySn8tPe1iBBeJqpgL+Zid9lQdOUyuPwD9qTrpq/R6W4xkN 3Y63DzFvtvImjylSM9XRpNKkSB1WL+OgHLTrbunbiFMrWP1MyFoLXiDkEDbYidkspwfx D7xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:date:from:to:message-id:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=4QcRuGQ382VqDzMQgichP8CEYGa0fuzZ05dl2ZJ0zU4=; b=RzM2F+DRdD0O0x7iv8Dtry413XU63qEPhc0O9ziDPeetrctG7nZA8FEFiBbuGCqbST iyg8m7Tqc5BKuyc8VZ49YUWTx73MCqUAduBdOde41il+mYLXKPx36O+YcFd0yjyOh4al SJgyM67NP9EM0xYnlEnbJ5Gk07BhlD8ykxbqRDeDPNS4/m/QVUe1I4Zcofe8HDnwZXhN s9c3f75U6zYe8zXgWhj8GtYGbdY7eQurxzAanNAZiEEIJ5C3tH6WLVgO6ez1bxy+cx66 ew1IAofRrv+2cBZEczsOrY9sVSqS9AdIdvVT8hPUEpbv2WqSyZbdqJSpKLkFydy+jqbZ aKpw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora8yZSpA237K2Zn55ZwMCd8afRRQ30MjPyeE4YXkb0sH1A4+ixji aDwAwuj7gu6gKlUfpi3DGVs= X-Google-Smtp-Source: AGRyM1vneIEQ+RgB/+TJBzwqb+zelEtkPjKGkYJAyYzZqFQUlBDWyTlAVF/jEyJo3EwXa0bT78+XCw== X-Received: by 2002:a25:850f:0:b0:655:b2cb:381 with SMTP id w15-20020a25850f000000b00655b2cb0381mr16568387ybk.552.1657529325189; Mon, 11 Jul 2022 01:48:45 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a25:e64a:0:b0:66e:bd0b:da58 with SMTP id d71-20020a25e64a000000b0066ebd0bda58ls5774200ybh.5.gmail; Mon, 11 Jul 2022 01:48:42 -0700 (PDT) X-Received: by 2002:a25:c405:0:b0:668:c24e:3065 with SMTP id u5-20020a25c405000000b00668c24e3065mr15689082ybf.189.1657529322171; Mon, 11 Jul 2022 01:48:42 -0700 (PDT) X-Original-Sender: ismail.jattioui1-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:30947 Archived-At: ------=_Part_1426_1318162947.1657529321673 Content-Type: multipart/alternative; boundary="----=_Part_1427_1328721558.1657529321673" ------=_Part_1427_1328721558.1657529321673 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, I am trying to convert a html file to docx using pandoc. My problem is that= =20 I can=E2=80=99t manage to move the table of contents to a specific position= in the=20 document. I tried splitting my document into two, then merging it again but= =20 it isn=E2=80=99t optimal since we are using it in production and it costs u= s 2=20 calls to pandoc and it isn't very maintanable I was wondering if there is a way to do that using Lua filters In a nutshell, let=E2=80=99s say I have the following html document that I = wish to=20 convert to DOCX :

Title 1

Some stuff 2

Subtitle 1

Some stuff 2

Other things
Insert TOC below
How do I manage to generate a Table of content below the div with the TOC= =20 id, without splitting the document ? Thanks in advance --=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/77066946-d07a-489a-9ec2-99796422f682n%40googlegroups.com. ------=_Part_1427_1328721558.1657529321673 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi,

I am trying to convert a html file to docx using pandoc. My problem is=20 that I can=E2=80=99t manage to move the table of contents to a specific pos= ition in the document. I tried splitting my document into two, then merging=20 it again but it isn=E2=80=99t optimal since we are using it in production a= nd it costs us 2 calls to pandoc and it isn't very maintanable

I was wondering if there is a way to do th= at using Lua filters

In a nutshell, let=E2=80=99s say I have the following html documen= t that I wish to convert to DOCX :

<!DOCT= YPE html>
<html lang=3D"en">
    &l= t;head>
        <meta charset=3D"UTF-8" /><= br>    </head>
    <h1>Title 1</h1>= ;
    <p>Some stuff 2</p>
    <h2&= gt;Subtitle 1</h2>
    <p>Some stuff 2</p>    <div>Other things</div>
    <di= v id=3D"TOC">Insert TOC below</div>
</html>


How do I ma= nage to generate a Table of content below the div with the TOC id, without = splitting the document ?

Thanks in advance

--
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/77066946-d07a-489a-9ec2-99796422f682n%40googlegroups.= com.
------=_Part_1427_1328721558.1657529321673-- ------=_Part_1426_1318162947.1657529321673--