From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/24482 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dmitriy Krasilnikov Newsgroups: gmane.text.pandoc Subject: Top level header lost Date: Fri, 21 Feb 2020 05:57:05 -0800 (PST) Message-ID: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_273_1095556039.1582293425306" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="38559"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCW6BWX4WAKBBMWDX7ZAKGQETR7UFEY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Feb 21 14:57:15 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oi1-f186.google.com ([209.85.167.186]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j58nr-0009mi-0l for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 21 Feb 2020 14:57:15 +0100 Original-Received: by mail-oi1-f186.google.com with SMTP id 21sf835488oiy.15 for ; Fri, 21 Feb 2020 05:57:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; 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=HcE6lZOpqWnteLhYuz6auakFoWmUstpjbLPI7Hm/pLg=; b=YKSvb+fwnS82VnR0vUeoaIUbAmS+u6I+ZSIyIUuXq406uEQQ++Nhvcwdzjz5ch7XxC jvjHKWA/b4kmxr79xPT337RbslBUyljFxD2C4CL3shAWYGFZclHXGQWEjapqlISa93rC hWXU1I+2PCaTsFiTpURyzGFMA5j8Xqm6D6knWOt3ks7kZ4gOApBJHxD9BpIL7vBdG8KD v16J+L0MPuHdpNkpMcDFHWzfMx3xggtOZHPD9J8bQVAKVHNV234TvANyh753W7Z7o9iM 0PEf6wbxClP/qjc9kl8qVsh0wkg6Z1xUjR5rJlvAlS3+NZyeWjlsoLlOtphNpqZapNIY 1+kQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; 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=HcE6lZOpqWnteLhYuz6auakFoWmUstpjbLPI7Hm/pLg=; b=TY7Vs6kxcS5L/w/KB7iw3ykVpoWjS7jtpiUsVvxo5Ni3EK3pp53HRQ0gqNVHANHdsp 223/S01djHk5hpeWwiGUr4QGq0fiiMmAWitDrjA3LQZwFEUd8jq+Br5AE1NPK9kdvwnu Y6dwvRnO+oVAWbTNAtqxVgjgSOhIxVcDcnUHymp87bI/Y6yEiU0T4ikzoo0O+3OUyJI0 I08tACcSWEgF0HfmNN6AY1Nwewd9Gi1Y5wkCQ1jX7ScsBaZ/rosPmvC36QkFsto5KAKH L8d++/TrivuyLmxrQDxgq99xlV/YBeFAUJQZTReulkfw95CCwRNRApVckQRZIlLE6yZ5 p+Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=HcE6lZOpqWnteLhYuz6auakFoWmUstpjbLPI7Hm/pLg=; b=kStYxqp2cyFKwuf0AZrxQY82kWKZog/R6Yo5CJWKjRUpPNeWKdbBooWXtCZ8bz9aoy 6+oHDDkOv7sXX163GCSBMx3GB1VYXUIeMDGVQF3et5hFL3xjGpnavNkdt2TES2zeaFjm b12k4z+iJMUkaJ2ZOa4xdFX8aD4kfNp74Lyh18dcCO1iDIBdU2g+d7Pt7kg5j8V+JnB+ AtpzJByQzwuEa4Zb6QsVKaxlCeALV0fN4rXS4zlILfsFMaCGaTOtNLnCeeOB9syA+PPE 9lFX3+VBHalXg7By110uk7yrMLzpwYXEVA5RvuwAU0p3Ez6yj9O9LlAY4lRxXYnO8qY2 SXdA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAUkeXbIb7gTU5cZBDVJHpnth8b+mTJCYihHcAcmZwd/6/ZDlDcR oaLCQwmlP/0JxGPGVc/ZHoI= X-Google-Smtp-Source: APXvYqzyzBkJp811xRVfSyEP0+N+CYca/en5FfJT2MysUHZFsdPSNQZwRBipdwTBs6++m9t+8DT15Q== X-Received: by 2002:a05:6830:1e76:: with SMTP id m22mr23694059otr.295.1582293429018; Fri, 21 Feb 2020 05:57:09 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a9d:7193:: with SMTP id o19ls388173otj.0.gmail; Fri, 21 Feb 2020 05:57:06 -0800 (PST) X-Received: by 2002:a05:6830:1e76:: with SMTP id m22mr23693874otr.295.1582293425843; Fri, 21 Feb 2020 05:57:05 -0800 (PST) X-Original-Sender: dmitriy.krasilnikov-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:24482 Archived-At: ------=_Part_273_1095556039.1582293425306 Content-Type: multipart/alternative; boundary="----=_Part_274_282489835.1582293425306" ------=_Part_274_282489835.1582293425306 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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.r= st 1 1=20 For some reason in this configuration the top level header is not processed= =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 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/a9db644a-43b0-4b2b-9b80-7f34cb9694ba%40googlegroups.com. ------=_Part_274_282489835.1582293425306 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm trying to bind Header_1 to some docx style.

This sample Lua filter function should output a hea= der level each time it finds one:

function Header= (el)
=C2=A0
print(el.level)
<= /span>end<= /div>

The source reStructured text code:
***************
Header = 1 sample********= *******
Text<= /span>

Header= 2 sample
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D

= Text2
<= br>
Hea= der 2 sample
=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D

Text2

In a command line this should p= rint 1, 2, 2:
pandoc --lua-= filter=3D<= /span>rst2docxHea= d.<= span style=3D"color: #000;" class=3D"styled-by-prettify">lua -f rst -t json test.rst

1
2
2
{"blocks":[{"t":"Header","c":[= 1,[= "header-1-sa= mple"= ,[],[]

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<= /span>.rst
1
1

For some reason in this configuration the top= level header is not processed and seems to be directly passed to docx outp= ut as a document title.

--
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/a9db644a-43b0-4b2b-9b80-7f34cb9694ba%40googlegroups.co= m.
------=_Part_274_282489835.1582293425306-- ------=_Part_273_1095556039.1582293425306--