From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/24485 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Top level header lost Date: Fri, 21 Feb 2020 09:42:25 -0800 Message-ID: References: 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="ciao.gmane.io:159.69.161.202"; logging-data="85052"; mail-complaints-to="usenet@ciao.gmane.io" To: Dmitriy Krasilnikov , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBD5NYDZAKGQEWHIJPWY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Feb 21 18:42:43 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pg1-f185.google.com ([209.85.215.185]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j5CK3-000M1c-74 for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 21 Feb 2020 18:42:43 +0100 Original-Received: by mail-pg1-f185.google.com with SMTP id n7sf1558080pgt.7 for ; Fri, 21 Feb 2020 09:42:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1582306962; cv=pass; d=google.com; s=arc-20160816; b=ilr4WfS20af/1D13NeWV+oogot4GHL993cJXG9dqJFglNymFp/i6Vf1FywyuqyWsin /XILA5ipdscWsq/iv5jrxmtSBsn+x7xIN5FQA+s89yPZA+5sx/aJ/Yaed4vZ6Gr/5Z6m npkSoOEKYFOx4AVqEPhmq5282H0VxcBIm20tjxVq/qHIaAxHnDjNfed4vhRVoQdh/qvg V1L7WHk16m+T8j79ppHh964dcHNME3EebHmsRXdo0PxEqjQUNPBWpxasLjuCcfR1UXT+ UO/HEiNKneOozdtl92rxclPNeWqlW7bfRs6qxFyfa6EM0O8q+FWdPUxO4oBjEd+lWJ4J zRcQ== 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=IR9INFrH8NQ/xMFKN2Qbx2dRv12w2qGdfkrotkXEQO0=; b=KJ/76PpKb3m3TAAJN0xyQArEYf4HROUqzw2t3zgFNAeAB+xQe1eVk6BOi2g6yblnUk 8BQB4t8Yvq8RXzIN8cYzYrzw48GMhDGl1SRdJKCxaoAHp5tD6+XCq8kquRuhx6HDpJqk 2VP4Z+hJwrU+qPd7XTRFPfitA6vXvcK+Os6AEGfIKFdi1pxkuJxtThs+uGgv1QFwgrHG ZIgLFbWHUuneS7wjuodospFlBoHFZcWbRhpCFC0mV3OxiAxaGwYiXplJVFa0Lvh2F2XB 4G8SqzH4Fw+fVValuVmRyNzCt1gwcAwjq+wjoClmPJi/yzyuRHX0yrfLCE57an+iPoyE 0wVw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b="NTzPpS/I"; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::62c as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; 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=IR9INFrH8NQ/xMFKN2Qbx2dRv12w2qGdfkrotkXEQO0=; b=k5laJgi5vNqXehMCN677YMP6n/Mr1jLNxERP58UYxsgJqy/unWtx41H2oPLn8z+le3 mVWTzSjXFfmke0jBkTz2zQY3vJOXvOO+pFGvlY8+VW35MFIGXRQL2fvGC6n4dvdYb1+J dfAKe7IYnuVQbUm6QHRSc84qPU6QHnQhztp4YNl6nbBD7ti4i0B+hUm3K53/0I98r6PO vrkOLkn6OvBFH0AEkXPkIpxfPNknjzVsfSd0mY2CrlryUYA78yZF1H2829iify/gNkKI SEcDgEi6PK+2nsekn8QByNhrbFJwBuebjJcz24qBWUpt3U6NOhmyukTC725CQdENQF7S RzEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=IR9INFrH8NQ/xMFKN2Qbx2dRv12w2qGdfkrotkXEQO0=; b=Ndz/c71/IE2aGU1TYJOuVRAQlk88WgJoNWBCprYwA/KNVI6JdsYEC17X9hRSp7a6p6 qvJMaBXzc9Tfa6zw6NMtr5EJQ+zuXwbmko5s5dakiwTTVaMG1tBor+eLsFOcyUjmuFIA TaHHgkE4WrTXF9DcguICY8v7eLkmGXPgwXcnr+ShvwRQEI6AYP8f4fZ3SD/x2TTdKNkO RFlg/Nttt/ijOY4Gnem/kNonJSba0CtnMc2MuJXT8jYgL3HNxj5wFIYvROunFDRgxbvH ntc3QykhPS1cJTLsmaEqjH6bqa//y9Dl2kgggBrKAsNlnhOsZ2YWz6XbsYbCb0m+l+Re Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAWS0YmXBUqn+BLBUq+AfS1ZG0ywaV9OrpP4YQ4PafR2mB+dirZN PFHX5Yt6FD92lv+sFcYLLZw= X-Google-Smtp-Source: APXvYqxKUQ5/g9QfBhdhzdhS0qjbvlYZ1ajg5WDc/QaOno83+TtuTZkJgN7EVh6NzYK57YUbIp/nbQ== X-Received: by 2002:a17:902:6a8c:: with SMTP id n12mr36907313plk.191.1582306961899; Fri, 21 Feb 2020 09:42:41 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6a00:2a1:: with SMTP id q1ls971697pfs.9.gmail; Fri, 21 Feb 2020 09:42:39 -0800 (PST) X-Received: by 2002:a65:4bc7:: with SMTP id p7mr38538416pgr.204.1582306958926; Fri, 21 Feb 2020 09:42:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582306958; cv=none; d=google.com; s=arc-20160816; b=JRbMKbOZ9DJ1zZUnwzPlNG0cXY0MzXqEUDwZsu0yU9M5ybvGuSJxanvCC2WbbnqIyt cAfP7/S+HoEgbrZhN4CfC+NTsD/YeRBNzZ+DotwM+fdESKlFY0nYJBtiXo8VLOFvCjlw A2XEXhF6sAugaxLFSF7M0IWngeLOk5+ODyMhuCvvEDE+u9qZ+5O0wIVmsH4cFsKFW/2L JXVgw9HhJtve0qasij3YFFu5X7NZHJ7dAMCh5fEl9lgKdHFxkHT5iwHhv4Y7b1HyjNb+ N8QWpVoG5MFu0AMTVvCjUJBg9IbyLupnZFN6ojz8lrbthlhgoefdhrsgsw4riHYBUJzW ryaA== 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=H5SBtmaK2PmztMUL/K0hNJDBbA9tbEDqK2DZDyrc2+o=; b=wvfJAuV54qz2EubNG2MDLcWXEZXU/OcqkF+cSj4jLvsTr3c9lMIHM9rPe9LKgxua9p Elgs4ORynTl9+7h+/40Dhu37NUTBCPdUUL8IiEkFyI1ey4tfOrWAeIfJ+J/FzlkrC8Yy h0N7iiTaa/oCkJns57IaNpm68jHlb+iNf9P2F+GPBk063jhenrOCphN7cyBo3Hj7xmla uMJ2A4Ebxry/JzhrkI/TxK4ISaFlx6PLrRWC3dR72uxPUaEYs1A+xdENk3zq/PxNqgmK pfGq2WXGFxmjhggJi+Y4O+RPe5+U9Ive+zDKKv9h994yj1c3/gQx6gvEXxSuk5phnFUq 8LDw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b="NTzPpS/I"; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::62c as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com. [2607:f8b0:4864:20::62c]) by gmr-mx.google.com with ESMTPS id y13si157350plp.0.2020.02.21.09.42.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Feb 2020 09:42:38 -0800 (PST) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::62c as permitted sender) client-ip=2607:f8b0:4864:20::62c; Original-Received: by mail-pl1-x62c.google.com with SMTP id g6so1153648plt.2 for ; Fri, 21 Feb 2020 09:42:38 -0800 (PST) X-Received: by 2002:a17:90a:20aa:: with SMTP id f39mr4446802pjg.35.1582306958560; Fri, 21 Feb 2020 09:42:38 -0800 (PST) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id t189sm3309953pfd.168.2020.02.21.09.42.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Feb 2020 09:42:37 -0800 (PST) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id C42CFA231; Fri, 21 Feb 2020 12:42:26 -0500 (EST) 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.20150623.gappssmtp.com header.s=20150623 header.b="NTzPpS/I"; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::62c as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@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:24485 Archived-At: This is because it's a convention in rST that the top-level heading is the document title: https://docutils.sourceforge.io/docs/user/rst/quickstart.html#document-titl= e-subtitle If you add `-s` to your `-t json` you'll see the difference. So why the difference with docx output? It's because pandoc automatically enables standalone when you have a non-text format for output (docx, pdf, etc.). Dmitriy Krasilnikov writes: > I'm trying to bind Header_1 to some docx style. > > This sample Lua filter function should output a header level each time it= =20 > finds one: > > function Header(el) > print(el.level) > end > > The source reStructured text code: > *************** > Header 1 sample > *************** > > Text > > Header 2 sample > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > Text2 > > > Header 2 sample > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > Text2 > > In a command line this should print 1, 2, 2:=20 > pandoc --lua-filter=3Drst2docxHead.lua -f rst -t json test.rst > > 1 > 2 > 2 > {"blocks":[{"t":"Header","c":[1,["header-1-sample",[],[] > > So, let's see how in converts to docx=E2=80=A6 > > $ pandoc --lua-filter=3Drst2docxHead.lua -f rst -t docx -o test.docx test= .rst > 1 > 1=20 > > For some reason in this configuration the top level header is not process= ed=20 > and seems to be directly passed to docx output as a document title. > > --=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/a9db644a-43b0-4b2b-9b80-7f34cb9694ba%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/m2sgj3x2f2.fsf%40johnmacfarlane.net.