From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/28999 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Lua filter to set meta data Date: Wed, 11 Aug 2021 11:05:15 -0700 Message-ID: References: <998f827a-92f9-49fc-ab87-25707ba5c7e8n@googlegroups.com> 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="blaine.gmane.org:116.202.254.214"; logging-data="28897"; mail-complaints-to="usenet@ciao.gmane.io" To: =?utf-8?Q?Bj=C3=B6rn?= Fisseler , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBZ5C2CEAMGQEAYYJR6A-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Aug 11 20:05:31 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pj1-f58.google.com ([209.85.216.58]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mDsba-0007GS-RK for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 11 Aug 2021 20:05:30 +0200 Original-Received: by mail-pj1-f58.google.com with SMTP id o23-20020a17090a4217b02901774c248202sf5836208pjg.9 for ; Wed, 11 Aug 2021 11:05:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1628705129; cv=pass; d=google.com; s=arc-20160816; b=f/4Hv6U+KLGQ+5LAtIQ7hUrpLyooXomjKy9R9bnGavF/IimKqaF7b4JxtSaZSU6FX0 h6lEkzR6yhFgZVfIFa0I9yrcxg8l9zIbd1/EvKiETwYPnx248D9kzlv2SfIMkCFfw2VT pYhmcyghq05S3y3Z9o+BChrTRIzCl3cgxLC+uXSgeyDBDO5eoW9q9vMVhmi0T8+hfaW9 k47ySOUjzs/G6UY69Vy1dVLaIHfjBVAKUDhzuiGPdjbtyKSG8epcMnYsFGW+BZ78C1Oy FoQSN7AR2PDSv21HuTPYAjYCAC2bzWE+HqTYQY/NMVSXSwISjlxsfkLaQxNNMFz4isyA Lfqg== 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=7NWuN6f1D7odzm09utIzZFCJBnFZeOlqRi4djvpHaz4=; b=I/D3kd/t6j2IU+sxgYNITinP+0Y0lbKPPFyb3V9CiDcytn0T8FAMbN5jcgJu2SosCu 6lTC/SBvcD7Xe3VyTESzH8reBCIm13EMVNaDpGYT60cghV74dg8POIDAgP/X8hc16XGR cAkTklkisdtlq90xbG6wN1UsJAuOoGiK1u6LRE0riYsPzdCIUXfSKPRSbIyTWa8lYsNf s1BsjrB3frganOMWIgSGTLVyJgbnzxBAOowKg2Q3bpb6ACH3ahq3LfvTy3uW8MiBc+wx A6QazK2pXSLr/bNmXM437CbrgdpqBxSLur090kpnh/ot1Sixd2OIpZ4D0B42LuF/Zp2i dsdQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=XEjJDG4v; 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=7NWuN6f1D7odzm09utIzZFCJBnFZeOlqRi4djvpHaz4=; b=YMVJ2h9HvUwB8B4e469YJqTj4sHzC+t4QbJc0SFSrVlXmlUuA3bvPAeS9sgN3TUMhB gtVi3eiUlbR/GvGOAdDZ5pszrnNufuNoLbYWG3ILyV1BtVik0FjNsvlEdEe3cfFKeFXv f38ZVGYio7O3a8Ucsb7LAwYdNPAF9shpRGS10hGrCtUFPSwwgqTlXXX3OVOe8OFQVT+V OktWCplxtUwTmGfdVdV6dLT0s0D3O8i4mPqIAOMCRCXxUXcmfbd3yeWKoWKQVnISiPuq vUnxtSislWG8o1IozWz+pUmuWqEguX9RH0t58ea2kT4G5y8CYFspmjbWzRbL8SGQwlVq h2Sw== 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=7NWuN6f1D7odzm09utIzZFCJBnFZeOlqRi4djvpHaz4=; b=i8CaLSjvDX7nkw/yoW1R9Hy60XKUIFAev19/Y2cwNWUq/StSs8GYZZSMJQdQYvE4hL FkSlPABv70Dovz/Waz2BcYylnL7kkpBxuUNMhouYlW+Y9UEjkd6LmZ0zlSCRoAhTp0Um xyJ80yPSUrU9Twl2hNXGn96I7nIzDGKHyOFyN0I5LcHZD9MAWaT16U+tEb2A2cTaDlgO P1a/TGSvQsYaxrf9f1RBAUyUYWLogJ4hWFJMMr/Y2zEmaq6IIckx5qEQ5UCzXqTLPILq dyMa+FRy2iPoIh2N8YO0mlo+MLmZ5NRSo9kBUxfqc33MbwWdOD3/VgeMzf897oBke7iF Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM531xGgh5LfnTbWZeiOWvHZko2jzBJnBTcuVI8EoI/MBBrs4QtzE1 ez1W++6CKqRClXEv+tPTpf0= X-Google-Smtp-Source: ABdhPJxSV/dWufrsmP5Uo7C/Z4r+ZCXTvI0ZWGPnYoI0ldKjirygXwEnIPzNjaSp1ZJtbem2nmpCuQ== X-Received: by 2002:a63:3e05:: with SMTP id l5mr556242pga.403.1628705129212; Wed, 11 Aug 2021 11:05:29 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:903:1c7:: with SMTP id e7ls1328580plh.5.gmail; Wed, 11 Aug 2021 11:05:27 -0700 (PDT) X-Received: by 2002:a17:90a:9f91:: with SMTP id o17mr11746845pjp.29.1628705127115; Wed, 11 Aug 2021 11:05:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628705127; cv=none; d=google.com; s=arc-20160816; b=EXk2RwI8JfSaseZmir3DX34TARPuNBsgL990/zxPuYIxXU3boU6X7j85D19mOf6Z6Y RXPzMrqORD11a+DQG9RAL8eYIAB9HVyvYpoR2vX7ArHFu5Ka7dGufJZKzmcEII8IeJkE mf0eBELBi2nRTZeA2+7mdPLnW8hs3A4fLa9laiJRNzvOc7YFYMto0WRYO8Zb/u+78YOD US1vrDADKwaQcaY66s/+uziX1F+4Yl0j+7BFC4+iukC7Wkaj18rNkr9+3VahODLz94G4 jYgckO2KeQHV5NFythUqg3R6EYXHVYZVyM2BfEisMs2xN+Mexxn/NHCh+rn5DqEtsYTV IV7A== 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=D0AkZGL0pHdTn6AHGUnVIQPrJKqZjNFW9MaoLUBYM0E=; b=HGLjRdqTU+Bbbmgfn7ej5UbNheG/QqUpjsxNKLNJP9lDMHWsrh0ZGoV3fgUNN7KqIk Pp/D2ZAU8CntNYKWX22uM8sxnYjlotcG2y3wwAsw8J5gAPFWoWsAQdLtg69JL7DQvaBS y5uBcF3r4YW6M56lx3NyGw4oeRflaBINgCNu65P3PtovsJ1U+nmEjOAGqJiK85daGXqm 9VFecKwR+SUhVA0IIIfDr8fiPQZ+AbaHIDdFIi1fpTV5pINCD8GH/J4StsyEyedbLPGd 7ZiVmHfbxbPKZa+/Fz+rhuDxfq73qfKIdOeZxBVKRsoIZVVzc/VIoLcRw73SHTb9HCpf STdw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=XEjJDG4v; 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 nu6si133329pjb.3.2021.08.11.11.05.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Aug 2021 11:05:27 -0700 (PDT) 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 d17so3688925plr.12 for ; Wed, 11 Aug 2021 11:05:27 -0700 (PDT) X-Received: by 2002:a17:902:c245:b029:12d:2063:345d with SMTP id 5-20020a170902c245b029012d2063345dmr104753plg.43.1628705126597; Wed, 11 Aug 2021 11:05:26 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id y16sm113980pfp.92.2021.08.11.11.05.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 11:05:26 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 3C989A2BC; Wed, 11 Aug 2021 14:05:15 -0400 (EDT) In-Reply-To: <998f827a-92f9-49fc-ab87-25707ba5c7e8n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 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=XEjJDG4v; 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:28999 Archived-At: Have you looked at the pandoc option --shift-heading-level-by? Bj=C3=B6rn Fisseler writes: > Hi,=20 > > I want to use Pandoc for converting DOCX to HTML. The goal is to convert= =20 > DOCX to Moodle-Books. While understanding the very basic of developing Lu= a=20 > filters is relatively easy, I find it has a steep learning curve when you= =20 > want to achieve certain things. > > For example, I need to convert a heading level 2 to the meta data element= =20 > title while reducing all other levels by one (h3 > h4, h4 > h5). This is= =20 > the code that I came up with: > function Header(el) > if (el.level > 2) then > el.level =3D el.level + 1 > end > if (el.level =3D=3D 2) then > title =3D el.content > end > return el > end > > Thing is, it doesn't work as intended and I don't know why. While it=20 > correctly modifies the heading levels, it won't set the title. Could=20 > anybody point me to some documentation? Browsing the Pandoc manual didn't= =20 > help me to understand why this wouldn't work. > > --=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/998f827a-92f9-49fc-ab87-25707ba5c7e8n%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/m2k0kr7t7o.fsf%40MacBook-Pro-2.hsd1.ca.comcast.net.