From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32114 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Lua Filter for \citeauthor and \citetitle in HTML Date: Mon, 30 Jan 2023 09:41:30 -0800 Message-ID: <9786B5A5-9022-4E5B-85DE-39D4A2CAFD8F@gmail.com> References: <51e71797-b029-4438-be64-6a8a15dd500an@googlegroups.com> <4865a325-42c0-4245-b992-b4fbdeab576en@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) 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="34459"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDW7ZIEHTIIBBTMC4CPAMGQESPDOTMA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Jan 30 18:41:36 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-il1-f192.google.com ([209.85.166.192]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pMY9w-0008po-LO for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 30 Jan 2023 18:41:36 +0100 Original-Received: by mail-il1-f192.google.com with SMTP id j6-20020a056e02220600b00310e8d2916dsf2793048ilf.10 for ; Mon, 30 Jan 2023 09:41:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675100495; cv=pass; d=google.com; s=arc-20160816; b=i71eG0GFHSNZxInE0qFtFIA5TPKBd9eBIhV1RV7IZt7lEjgHlJdevjQHGCtQqM3cYk aoe8VY+34PVX/7jtWXAms1kZd8pks7djy7VmaDzSugK9r7CuimWmeG5U9Jm/8KKECPYs KKUFkvmwzvJZiI/Rh8n9ntbPOfWtQy/tUSMhlVCQHYjUWvu7kPtlofBIeGuz16XGIb7+ IhrBKnoSPdQ/rqokDgNXvgOMnnGggpDrx7pBdQeUVIhpasdJmwfrxtMPxmelu9xQTVfX ivDElH0JnQ2+1h7OwPbNKzp784qGs+Rf80zIQ1GpNVTiiy7Tw8FfAWX4A012WGqaYn8p H1Wg== 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:message-id:in-reply-to:to :references:date:subject:mime-version:content-transfer-encoding:from :sender:dkim-signature:dkim-signature; bh=qrErxo1yGexhL7cz40Qq8V2Am568z8HI4zA86jlhUhU=; b=YftZ2kb1V4lFR3xUzh45sr4hK4qJ2Z97eeHXMcBh2oVCHYTi9cPpucp1gyrKmzkDQw zQXbJubPKx/MrWVQp6jcBBB3N9jwcnjQLQDfyc8ptdz58WqxvBoX/iRZxvYzlIr6ixm2 KGKWr66fVwhu2UK0H7QMLzRoyn7ZFxHD5uR2CPBGgDw1qf3598Y/8pkMgYhMZpIV/U1w uYiMOTYyw1lzJu4QD/0hsgEE/bvsw0VcNRrysULcgF/9Xb01K1sWWaTCSUNe3uaDtz5F vLD2A6P6c/C2xwNwDbj335o+L+Ify1C1IDn3TzXjHzgUP6xS+t70220VoUyTTwNSrcjb cG8g== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dL7d37dY; spf=pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::102a as permitted sender) smtp.mailfrom=fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:message-id :in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=qrErxo1yGexhL7cz40Qq8V2Am568z8HI4zA86jlhUhU=; b=Erzd5OLjbNljPGU8p8Uqlmp1A78Cxr5yBqgb7E7P5BG+NqZ2JQwrW6T4Ne+cvUiAOJ IjdxbztZvKUfB9LH9wRbHO4E0zinofooL7YLWziyWFvmqQvfXAHKxFk8seTNvMp+fdXK oCHy15+kOYQuhz+3Qbaaq9TT9cb7iKO3e/afpOLjbC1gzpFt2N0Y5jxAzm+RNJs5Vkoz nvt/yeK4gPZBWdJaPBrUkYCHFNwd12YD9ykATc9W60qEPqpgs8ou3I30x8KMC+K6lQJs auegCCyzYiilY3mbYTNvoaRykKYGXBuXjUnSVEaFGL+Kw7friCV0I6o9TbYgh/DEA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:message-id :in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=qrErxo1yGexhL7cz40Qq8V2Am568z8HI4zA86jlhUhU=; b=XByKQl92IrnBrXN7SqlalGZRxdvCFXOnnEm6trNa7H/b4vVc/eQMnm/69FmrWsEjMj l+w7BjKgp4xe76leBGFMVA3fPnnT1Tg8Gvl/SgD/XAxdEUFZmkSL6BqPhVC9wL88xaG3 OaISgYjZyHjwr9cEM3KEvW2Ckf1y5ncwnZ1QWig6cvXbKTwRMov+v/BO63tYe89Wm+nj DYcCvkoSlcpOLYdc3fD6ILoDztUHOtsMpabCaDLptFm/q6zv6g6zOzo2JN9N44WoVS1M ZOvP2DGhcfTJfBhHWMuNtOemW/GQ/wlLJfmV1fSe+hNQ1SofrkZsO5tDRrJlwI6hBBGK R X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:message-id :in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:sender:from:to:cc :subject:date:message-id:reply-to; bh=qrErxo1yGexhL7cz40Qq8V2Am568z8HI4zA86jlhUhU=; b=ec7J4xDJ0rGfULTSYw4O7Le6xfKWN+Fd0EJ4u+HuigDHw2kYMmsSlqTjFm2l0yB5oZ Jgya7TvnmyOZ+l+TfmozuVI3HCtDz8gb23MQEXM6OLYZxGK7nMXCnYk//sL98hwrEjTz lIINi/WqfbbSw6hxSOfWXUF7sjRWKjpuoDfQ5Y/uR+xR8bSTzNgfThXi3wZhH14SMQvX zzje9WhYXJCCPLfjqCvvB0DkPTWjz1E/gI6tWVRpQhK1cpb93z7qJWLKltu5ynlwzgdX xec93dz3mTUbyZeVmFOU Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AO0yUKWIgUxGtRjwM7h4OwzWiewlHwKurIhafwUtZyw79CVmuHLxSLaA cxsJP+7Y3XDDHXN0IrSeVDA= X-Google-Smtp-Source: AK7set9XF5vIxkKj3hLjfvoX35yBNvH7bUA7IpQwg1l3GxQy4Faa2BmdqhYMWxnrytqylze7cqwSGQ== X-Received: by 2002:a92:740d:0:b0:310:ac3d:7ef8 with SMTP id p13-20020a92740d000000b00310ac3d7ef8mr3334283ilc.27.1675100495564; Mon, 30 Jan 2023 09:41:35 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a5d:9b8b:0:b0:6de:dad2:59ac with SMTP id r11-20020a5d9b8b000000b006dedad259acls2685134iom.4.-pod-prod-gmail; Mon, 30 Jan 2023 09:41:33 -0800 (PST) X-Received: by 2002:a6b:5f0f:0:b0:715:e311:b8e8 with SMTP id t15-20020a6b5f0f000000b00715e311b8e8mr6633575iob.18.1675100493089; Mon, 30 Jan 2023 09:41:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675100493; cv=none; d=google.com; s=arc-20160816; b=HmeRMZrceicNXfgGs3l3Y8hvm/fpiIMZXGRXzzyUIBjZyJGaZwgrHThPmyVKTdLbsW bjDLg+n66cY03z+9KfUjC3pDgNmqztarySFy6IgxArHo66oy89pDnW5SWWnLy5YLK+e6 L2KcMoStiIwLGrjJOc9DLq9NKbvUedE/ASdiKj0UxWf5WDlCjAfXCudylStMFE9sJZd3 rYaMfE9krM6fO/Utm7arRyGYY8ihMJnM8/1Z1KkYLEZxWy1sWwmTN4a7AQv6GQDFt3mh j0u2dEEphSfEikmyXfRWS8NBpaX1oI03Q8eb8wUNhTUmfBhWr3/nJrU+jSVHIJveZMSe Hz2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:dkim-signature; bh=Bvj0nuEzZ6NceVnrdFgA1TdQB1ErT61wZG29M3mp2+A=; b=l+VkD3PlZFOw7Lw+r5NRBoWWAplTySs1/a04zr94YTCZ58O9nIe3cxh2i3I+7933XY +gCZH7KD/TB4CauPskQwAL4FkfrLDpZFp3qEb6nfGzQaryN9J6YgpkqfOMDbZvIaGQJh H47Uom9FfUCR2W4nhcU/BKVQX4mkEwLHvqNFNqjZ6tJul7DwM3gUyzORpVN/og/rJyhH G8QbeP9niuED82ASbvoYdihgznhTnEnR+lOIVRRv50zPeHYWUo2V0fv0kFK3EEOHZIac MqKWtfUdUeLEo8lxbtZhxUwH7Ei+/v4YfxUI6S2i/SjYeFoq4CshAprAL+vRnT1k2yBg 7N1w== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dL7d37dY; spf=pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::102a as permitted sender) smtp.mailfrom=fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com. [2607:f8b0:4864:20::102a]) by gmr-mx.google.com with ESMTPS id y2-20020a05663824c200b003a7cca5b466si1389599jat.2.2023.01.30.09.41.33 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Jan 2023 09:41:33 -0800 (PST) Received-SPF: pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::102a as permitted sender) client-ip=2607:f8b0:4864:20::102a; Original-Received: by mail-pj1-x102a.google.com with SMTP id o13so11772327pjg.2 for ; Mon, 30 Jan 2023 09:41:33 -0800 (PST) X-Received: by 2002:a05:6a20:3d24:b0:bc:5fc6:6894 with SMTP id y36-20020a056a203d2400b000bc5fc66894mr13012793pzi.53.1675100492347; Mon, 30 Jan 2023 09:41:32 -0800 (PST) Original-Received: from smtpclient.apple ([2601:644:4780:3350:fc7c:d2fd:c053:a78]) by smtp.gmail.com with ESMTPSA id cw10-20020a056a00450a00b0057a9b146592sm7661674pfb.186.2023.01.30.09.41.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jan 2023 09:41:31 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Original-Sender: fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dL7d37dY; spf=pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::102a as permitted sender) smtp.mailfrom=fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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:32114 Archived-At: In a Lua filter you could probably just use pandoc.read with the format "bi= btex" or "biblatex". > On Jan 30, 2023, at 9:21 AM, Bastien DUMONT w= rote: >=20 > Do you mean a function that parses the .bib file directly? I really think= that it would be easier to convert the .bib file to a CSL JSON file and im= port it via a JSON parser. >=20 > Le Monday 30 January 2023 =C3=A0 08:49:36AM, Bernardo C. D. A. Vasconcelo= s a =C3=A9crit : >> Thanks for the feedback, Bastien!=20 >> Can you think of a similar example script that contains the function to = parse >> the bib data? I searched for it online to no avail. >> On Saturday, January 28, 2023 at 7:35:40 PM UTC-3 Bastien Dumont wrote: >>=20 >> I think that it would be better to run it before citeproc, since you = don't >> want citeproc output (unless you want to still benefit from the "ibid= ./ >> cited" feature). Citeproc would not help you so much here because it = does >> not tag the different parts of a formatted citation. On the other han= d, >> parsing the bib file would be rather simple if it is in the CSL JSON >> format: then you would just have to use one of the JSON modules for L= ua to >> import your bibliographic references into a Lua table. If you use Bib= (La) >> TeX, you can convert a .bib file to a .json with `pandoc -f bibtex (o= r >> biblatex) -t csljson myfile.bib -o myfile.json`. >>=20 >> Le Saturday 28 January 2023 =C3=A0 02:07:54PM, Bernardo C. D. A. Vasc= oncelos a >> =C3=A9crit : >>> An HTML equivalent of these commands was proposed in Github, but there >> was no >>> feasible way for it to be implemented as part of Citeproc. I suggested = a >> Lua >>> filter to achieve this and John said it sounded doable.=20 >>>=20 >>> I learned some Lua and experimented, but I didn't come close enough to >> have >>> something worth sharing. In short: I imagined something like `[@Ref] >>> {.citetitle}` and `[@Ref]{.citeauthor}`. So this would imply: parsing t= he >> bib >>> data and saving it to a Lua table (stuck here); filtering spans; checki= ng >> the >>> type and performing the replacement (not clear to me either what the >> correct >>> way would be to replace the id with the data or if this would have to r= un >>> before/after citeproc). >>>=20 >>> Any pointers would be much appreciated. >>>=20 >>> -- >>> You received this message because you are subscribed to the Google Grou= ps >>> "pandoc-discuss" group. >>> To unsubscribe from this group and stop receiving emails from it, send = an >> email >>> to [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To view this discussion on the web visit [2][1]https://groups.google.co= m/ >> d/msgid/ >>> pandoc-discuss/51e71797-b029-4438-be64-6a8a15dd500an%[2] >> 40googlegroups.com. >>>=20 >>> References: >>>=20 >>> [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>> [2] [3]https://groups.google.com/d/msgid/pandoc-discuss/ >> 51e71797-b029-4438-be64-6a8a15dd500an%40googlegroups.com?utm_medium= =3Demail& >> utm_source=3Dfooter >>=20 >>=20 >> -- >> You received this message because you are subscribed to the Google Group= s >> "pandoc-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send a= n email >> to [4]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit [5]https://groups.google.com/d/= msgid/ >> pandoc-discuss/4865a325-42c0-4245-b992-b4fbdeab576en%40googlegroups.com. >>=20 >> References: >>=20 >> [1] https://groups.google.com/d/msgid/ >> [2] http://40googlegroups.com/ >> [3] https://groups.google.com/d/msgid/pandoc-discuss/51e71797-b029-4438-= be64-6a8a15dd500an%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfoote= r >> [4] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >> [5] https://groups.google.com/d/msgid/pandoc-discuss/4865a325-42c0-4245-= b992-b4fbdeab576en%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfoote= r >=20 > --=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/Y9f8i/Jl%2BgDjNo/a%40localhost. --=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/9786B5A5-9022-4E5B-85DE-39D4A2CAFD8F%40gmail.com.