From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30918 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Albert Krewinkel Newsgroups: gmane.text.pandoc Subject: Re: Changing colons to full-stops in titles Date: Tue, 05 Jul 2022 12:16:16 +0200 Message-ID: <87h73vj1m1.fsf@zeitkraut.de> References: <2a8d940b3675472fb4b50ead406f6fc7@unibe.ch> <5c2a1a00-28b9-4846-9541-92baaf0d5200n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22480"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCZJF7XJTILRBG5ESCLAMGQEJ3DDGLY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Jul 05 12:27:44 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lj1-f186.google.com ([209.85.208.186]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o8fmS-0005e8-0X for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 05 Jul 2022 12:27:44 +0200 Original-Received: by mail-lj1-f186.google.com with SMTP id p7-20020a2e9a87000000b0025a99d8c2dcsf3470889lji.18 for ; Tue, 05 Jul 2022 03:27:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1657016863; cv=pass; d=google.com; s=arc-20160816; b=Bj8d2nFv4SgNC/Ixdpvj1+Mzv0dNx8InmJ67KkCdAx6HKZFnkxxKExVJAmcKDrDivv sBlcW2sMiCZqpMqRbJ16qu0SVVsKrlIO0pVwXuB8Rzy2PUBfKzWuwSLbrhUnCNFOR1LB EeWuXgt31hKQYHqxyScR0DRWOzDmglsb7pDS8Yq+wwGx2W2nSWJt/ZPDVgpo+IPN5fSe S20bWWrNX8EoYxwcDyl5Tb9Y7V+txz/XPiP2dg5HOan/553l/bI/wWR5THFK+ISKn26p oBTI/Gxf8Pmo1dRvmp6A/ADa4xFyeL5oJNONXpOUqoyzvawytLJB2MRqe0Y+g0Fp6rz3 HzEQ== 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:mime-version:message-id :in-reply-to:date:subject:to:from:references:sender:dkim-signature; bh=55fZwSlAmHq+QB7lwSFu8GUUQZLAzm0LwBNfiAbhISA=; b=tS8l1i39w+DNRieVHBSFNJe+PHlrARzfDh6mbuazq+VmkWKRbOD9IQ46RXlRWqfYZG NgTzPL0mooL6+98fHCw1ycg71WR9C9gs4X669dIw42Vdwx/lIXQLjvrgc3O8sMcCOjHL hvzxIiwhit+oefc6xTe2yVwaIY/tw9mQrSRJloJPHYZFZRBLu/yz1NLhb9VDfQK92ILs aFgQTEBGU5fS3QEupbZ65UPZ6eZ+dC/Y1kum8luWRRIVskLgGT6v/3PIA2cCKKCyF36X 6dLg2Ra1Vbjko3wfJzXJxPhggrXE+jRh6jhB7bk0elN5KH9FU/kclKtc94eF/332mbCd vPaw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050:0:465::201 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:references:from:to:subject:date:in-reply-to:message-id :mime-version: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=55fZwSlAmHq+QB7lwSFu8GUUQZLAzm0LwBNfiAbhISA=; b=okqLT2SdQAy14+h8oCxlkT91OodcEaUGGcQaom8G6DW5NBDX6gjmr1mJc00doXUoG2 nVp4QEh2jz4dQRoURb0t4RTtRW4T69v1xY2t4FYZMg7eJ2eDR2oCPEGT1BotTAd24ivI igkFApwSHWAaSWh8ea8F2y8eDaPbgZuK92OBG8INyvVUzMYZxN9pF6Zl1wZuBg3rVZ3D RXXT68kYSdH+h2cGZUoJLPnQ/jVHFl6tsZ/iUzBnIwyqC3a/Xv2LaFgxRwGyigdx4hDw 6r9t+V3o3PPohJNqXATVQS4dF6DaZXvobyD0Jyqg0xlLVJ7ahaWTl+UI0a8FN1txlfsJ yT1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:references:from:to:subject:date :in-reply-to:message-id:mime-version: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=55fZwSlAmHq+QB7lwSFu8GUUQZLAzm0LwBNfiAbhISA=; b=wXbgmhyhbEBQpr0MAa882lHEXjHiaNymznbzt3fjA+8W33rGkcPlC8beqOZEvz0/CO 7cM4udv/bfyUrqgUY9VGoxuGqW3snqc7nYMdp1ISbZ7BT+lcmCgo1pqh9PJ9wFOEWItM xp2wKGocfEuZaIEvDDIvukgMn5ZDehAzuCj4RxKAStLse3I172/EaoUvM0midD1RgPah IRPbfnXmLht91BjTdRwB6Ysp+DaXQtQ4+gBUUQd1Ixuy4Pd4Y8p4mBq8Joxy8j2+yuSA R7hhSO7ar4Vu/pBoOlcBHgmfgDvHELPnT+QFsivhq3XvQv1xsxJNFn8gYQVqqoLSg/7D ZysQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora/p1fuXHM18efc8kXGLXgjNhCwLlA3QmMzdPYPrxD3jedqJ3zmr SqeiOkW8dNLJlQ8LYYubeys= X-Google-Smtp-Source: AGRyM1vhw9Xi4NxKH+BP6nbU3Bd19PajzRcUU9qUH65H6pheUBPTBYO+FKeRPijcQ8yFkgLl4VY9aQ== X-Received: by 2002:a2e:9bd9:0:b0:25c:63cf:2001 with SMTP id w25-20020a2e9bd9000000b0025c63cf2001mr10696585ljj.60.1657016863429; Tue, 05 Jul 2022 03:27:43 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a2e:8ec4:0:b0:25a:a013:4f2b with SMTP id e4-20020a2e8ec4000000b0025aa0134f2bls5003161ljl.3.gmail; Tue, 05 Jul 2022 03:27:38 -0700 (PDT) X-Received: by 2002:a2e:8859:0:b0:25d:1cc9:3ccd with SMTP id z25-20020a2e8859000000b0025d1cc93ccdmr6686764ljj.267.1657016858443; Tue, 05 Jul 2022 03:27:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657016858; cv=none; d=google.com; s=arc-20160816; b=iSeZaiZl0y/jPRDmU0VjroL3DtDQHGD4m3RyQ8YkOrDZoOxcT/6hUADrYA3yntH1v9 qClk4Bbwsjk9VwrPmGIx+WMYlU2TfxdOUTRYmZVRJB1odeTmmt07ppx9Ofo8e1f26ebh b9shz3tJmn7OaEzTPPfWf1xsn+lXhjXRqWb5RVzDF+TNsJMrMLMOR8UELm4wlPyhW9ng Kl5rsw4zwzpRDTWtqCztivH5dcVQ9GaroZVw1hgwFVWSrGuymeGmeeoC1ybXLDE+pbDB j8cIaDiNf9P0NMlH88Ftp1T7EyklOrtG6KhBk8hoN14Uqk96yON5/S6NYclix5ej6wGW Pfcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:in-reply-to:date:subject:to:from:references; bh=HMQqh84potcJcS6wiPjRGjOil5Ho62hrGFQijqrVAac=; b=n+l59C9AZAImZ4/5qE/i8LQh9afeWInUkxSbiqKeuUFUtTuQEY+QHfE7oxL/VZnpdB ldympiVzFZ3s8cTz297oQWQA0qG9E1iWjjPqFohLsMtclONdEDDSObpW4N4rU5SpalN5 hcgn6dT5hjDUm6/M+uaarTJPa1QzqJeW3eo+NKqlrJmewS/Ey/DAtlKKEFBAHUK6dPVC LbjnLdMjIuomh3WrdW7SM37a019mb/YRz9yZlESdWRnBHpERnYxl85VlUfBRfZ4HuWcx jZ7ZbI0AQ1eoBzE3SUx0NifPMlmATGFE49+qSO2zNPoblGcynsZkjSiSR/im8CxeU9+r zzsA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050:0:465::201 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org Original-Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org. [2001:67c:2050:0:465::201]) by gmr-mx.google.com with ESMTPS id p16-20020a2eb7d0000000b0025a71229262si1171843ljo.3.2022.07.05.03.27.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 03:27:38 -0700 (PDT) Received-SPF: pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050:0:465::201 as permitted sender) client-ip=2001:67c:2050:0:465::201; Original-Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4Lcf4l5V2lz9sW3 for ; Tue, 5 Jul 2022 12:27:35 +0200 (CEST) In-reply-to: <5c2a1a00-28b9-4846-9541-92baaf0d5200n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050:0:465::201 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@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:30918 Archived-At: John Carter Wood writes: > I have finally had a chance to try out Denis's lua filter but I don't > seem to be able to get it to work. > 1. I saved the filter in my .pandoc/filters folder (as > colon-to-dot.lua, attached) > 2. I used the test .md file Denis provided (as dot-test.md, attached) > 3. I used the pandoc command: pandoc dot-test.md --citeproc > --lua-filter colon-to-dot.lua -o dot-test.docx > But what comes out looks like this: the colon is unchanged. > Screenshot from 2022-07-05 12-00-17.png > What am I doing wrong? I didn't test them, but these changes could help: 1. Change the order of `--citeproc` and `--lua-filter=...` on the command line. The order in which these are given is also the order in which they are applied. We want the Lua filter to be applied first. 2. Make sure that the `references` field is populated by filtering the Pandoc element and adding `doc.meta.references = pandoc.utils.references(doc)` Here's the updated filter: ``` lua function Pandoc (doc) local meta = doc.meta meta.references = pandoc.utils.references(doc) meta.bibliography = nil -- prevent citeproc from parsing this again for _, ref in ipairs (meta.references or {}) do ref.title = ref.title:walk { Str = function (str) return str:gsub(':$', ',') end } end return pandoc.Pandoc(doc.blocks, meta) end ``` HTH -- Albert Krewinkel GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124