From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32112 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Bernardo C. D. A. Vasconcelos" Newsgroups: gmane.text.pandoc Subject: Re: Lua Filter for \citeauthor and \citetitle in HTML Date: Mon, 30 Jan 2023 08:49:36 -0800 (PST) Message-ID: <4865a325-42c0-4245-b992-b4fbdeab576en@googlegroups.com> References: <51e71797-b029-4438-be64-6a8a15dd500an@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_3154_1520216734.1675097376978" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1059"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDUKFWODQ4ARBIXK36PAMGQEIILSJTI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Jan 30 17:49:41 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oa1-f57.google.com ([209.85.160.57]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pMXLh-000Adr-9p for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 30 Jan 2023 17:49:41 +0100 Original-Received: by mail-oa1-f57.google.com with SMTP id 586e51a60fabf-1634c8f8b54sf4249411fac.14 for ; Mon, 30 Jan 2023 08:49:41 -0800 (PST) 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-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=wtgipzXG0fGUs1hT/KHSlxLGlcC0/q85L8z/CDYNHEI=; b=PDeUNQD1SBJ4bOIwr5KiDipASEvTljdOUr6q5fXeLk086pB71WMPBRBo8kii11iJCp DezHB26tNz1ANcrpVYGXd5j72Ofn0aoIGbFYA9CwE4Ek5oclfgPKmU5Y+B7GXNN+UjEn OS0/WEiTw7XDUgBQWqSwiGMlZ2h71yN+ssonIwW/ufp+PJfHfOwRiI74RbdPm3nVkyPh cXcRaQnVPZD6uZijuIZSlZBAvURTRddySwp7A7IpVwRP4cz0ThTgohimMliG1xLSC5d2 VaFtuopgZCIJ74ejRVW0ckWvf7Ck3gqlxwTxcBzciKimSZ5N7qguKot36Td1rdmnBqP1 gThg== 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-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=wtgipzXG0fGUs1hT/KHSlxLGlcC0/q85L8z/CDYNHEI=; b=QFnuQiaptDfEibPUqNRFFRsowGzt/r+gLVsyA4cr/xtgIsjjl1a/ayQP5swrH5Aan1 OoOU3FHtNcCLPQt8D2OpE9vTO2SRX+t2GFaoq0HV0P9Q0nEfNzRR4FhG+VK/lDo52ch8 nUd08g0biFfsE0Hn4I6fOZaFvJE9iJyVLXjJkC9y32Ps+1CvjXZIaO4At0DRNH2zIOWs hoK/SffZ8ccOgcjkyrLGAckXwZ455CnFWIf/0P4NP77rRxKC2X3i1iPIADy13jFldohu sBeMw/tjbyAyg7OvhtNy5TqDhdok5v5fvZSk196jFf0fOQJ2mdAcwXiHb1BwG4DPFxnw l/sg== 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-sender:mime-version:subject:references:in-reply-to :message-id:to:from:date:x-gm-message-state:sender:from:to:cc :subject:date:message-id:reply-to; bh=wtgipzXG0fGUs1hT/KHSlxLGlcC0/q85L8z/CDYNHEI=; b=abrL6L8q4/1SVG7QnuBPIMKWkFgtxLmQbTfw3oGCU8CS28LQGq9NTgFPeeSfP4cDZu etvhQo/6VL8dvK18qiOKKVTeEfBmDgnFeCuroXRGFOlkTdBaqWUE6FTWMWXZie15nzMJ atWsN0/JFIZk5vjoozBNBwCN8jXzBCcbmLvhu4j++SjsjIPPzX6iGyDilk1Sgu8gTLhT rvIR+GrPP8c95VkFCex6H/9rZalR4xHjkS/kdlhutYzfEYN6E4Oi04zyIGn53orSfLGW czq3CO0MP8f1BxpEXcKWpCxV/uaBaB+rkaYllYaMpkfwEOyk19X8VU7kP+LvWbdgTFD+ iP/A== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AO0yUKVKXaIrveKgoKTwFinOgn8d2PcWFRLyQofSELRAogbfFE3kHrJt xsi5i1Kd/Ap4/F9rwAeCYi4= X-Google-Smtp-Source: AK7set8GqjNsocl0yqPs4MpNgiMp92WWLZWVVKhQ+0HDHSZHe0fRHWFX78DF9gqp/hBrNRV0jMenow== X-Received: by 2002:a05:6870:1291:b0:163:263c:c5d0 with SMTP id 17-20020a056870129100b00163263cc5d0mr1480665oal.284.1675097380098; Mon, 30 Jan 2023 08:49:40 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6870:fd8d:b0:152:e7d4:7359 with SMTP id ma13-20020a056870fd8d00b00152e7d47359ls5475007oab.2.-pod-prod-gmail; Mon, 30 Jan 2023 08:49:38 -0800 (PST) X-Received: by 2002:a05:6870:d0c1:b0:163:7da9:fbbf with SMTP id k1-20020a056870d0c100b001637da9fbbfmr841761oaa.104.1675097377815; Mon, 30 Jan 2023 08:49:37 -0800 (PST) In-Reply-To: X-Original-Sender: bernardovasconcelos-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:32112 Archived-At: ------=_Part_3154_1520216734.1675097376978 Content-Type: multipart/alternative; boundary="----=_Part_3155_494420232.1675097376978" ------=_Part_3155_494420232.1675097376978 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for the feedback, Bastien!=20 Can you think of a similar example script that contains the function to=20 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: > I think that it would be better to run it before citeproc, since you don'= t=20 > want citeproc output (unless you want to still benefit from the=20 > "ibid./cited" feature). Citeproc would not help you so much here because = it=20 > does not tag the different parts of a formatted citation. On the other=20 > hand, parsing the bib file would be rather simple if it is in the CSL JSO= N=20 > format: then you would just have to use one of the JSON modules for Lua t= o=20 > import your bibliographic references into a Lua table. If you use=20 > Bib(La)TeX, you can convert a .bib file to a .json with `pandoc -f bibtex= =20 > (or biblatex) -t csljson myfile.bib -o myfile.json`. > > Le Saturday 28 January 2023 =C3=A0 02:07:54PM, Bernardo C. D. A. Vasconce= los a=20 > =C3=A9crit : > > An HTML equivalent of these commands was proposed in Github, but there= =20 > was no > > feasible way for it to be implemented as part of Citeproc. I suggested = a=20 > 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= =20 > have > > something worth sharing. In short: I imagined something like `[@Ref] > > {.citetitle}` and `[@Ref]{.citeauthor}`. So this would imply: parsing= =20 > the bib > > data and saving it to a Lua table (stuck here); filtering spans;=20 > checking the > > type and performing the replacement (not clear to me either what the=20 > 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= =20 > an email > > to [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit [2] > https://groups.google.com/d/msgid/ > > pandoc-discuss/51e71797-b029-4438-be64-6a8a15dd500an%40googlegroups.com= . > >=20 > > References: > >=20 > > [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > [2]=20 > https://groups.google.com/d/msgid/pandoc-discuss/51e71797-b029-4438-be64-= 6a8a15dd500an%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > > --=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/4865a325-42c0-4245-b992-b4fbdeab576en%40googlegroups.com. ------=_Part_3155_494420232.1675097376978 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for the feedback, Bastien!=C2=A0
Can you think of a similar exa= mple script that contains the function to parse the bib data? I searched fo= r it online to no avail.
On Saturday, January 28, 2023 at 7:35:40 PM UTC-3 Bastien D= umont wrote:
= I think that it would be better to run it before citeproc, since you don= 9;t want citeproc output (unless you want to still benefit from the "i= bid./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 = hand, 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 Lua to = import your bibliographic references into a Lua table. If you use Bib(La)Te= X, you can convert a .bib file to a .json with `pandoc -f bibtex (or biblat= ex) -t csljson myfile.bib -o myfile.json`.

Le Saturday 28 January 2023 =C3=A0 02:07:54PM, Bernardo C. D. A. Vascon= celos a =C3=A9crit :
> An HTML equivalent of these commands was proposed in Github, but t= here was no
> feasible way for it to be implemented as part of Citeproc. I sugge= sted a Lua
> filter to achieve this and John said it sounded doable.=C2=A0
>=20
> I learned some Lua and experimented, but I didn't come close e= nough to have
> something worth sharing. In short: I imagined something like `[@Re= f]
> {.citetitle}` and `[@Ref]{.citeauthor}`. So this would imply: pars= ing the bib
> data and saving it to a Lua table (stuck here); filtering spans; c= hecking the
> type and performing the replacement (not clear to me either what t= he correct
> way would be to replace the id with the data or if this would have= to run
> before/after citeproc).
>=20
> Any pointers would be much appreciated.
>=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 [1]pandoc-discus...@= googlegroups.com.
> To view this discussion on the web visit [2]https://groups.google.com/d/msgid/
> pandoc-discuss/51e71797-b029-4438-be64-6a8a15dd500an%40googlegroups.com.
>=20
> References:
>=20
> [1] mailto:pandoc-discu= s...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [2] https://groups= .google.com/d/msgid/pandoc-discuss/51e71797-b029-4438-be64-6a8a15dd500an%40= googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter

--
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/4865a325-42c0-4245-b992-b4fbdeab576en%40googlegroups.= com.
------=_Part_3155_494420232.1675097376978-- ------=_Part_3154_1520216734.1675097376978--