From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32113 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bastien DUMONT Newsgroups: gmane.text.pandoc Subject: Re: Lua Filter for \citeauthor and \citetitle in HTML Date: Mon, 30 Jan 2023 17:21:15 +0000 Message-ID: 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 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="6999"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDCINCES2QJRBDXZ36PAMGQESSJGTQI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Jan 30 18:21:22 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wm1-f64.google.com ([209.85.128.64]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pMXqL-0001aU-VZ for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 30 Jan 2023 18:21:21 +0100 Original-Received: by mail-wm1-f64.google.com with SMTP id fl5-20020a05600c0b8500b003db12112fdesf7493996wmb.5 for ; Mon, 30 Jan 2023 09:21:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675099281; cv=pass; d=google.com; s=arc-20160816; b=fnKHvx0Wp7zzPdktUHGLfm+CV1m01PWpBcQQg9G/QtdQgPAFIo31TguUo6l/27Ft2n KcyoZRlpaBRTx7Bk84CmpXX87rn+AziDYg3geYFetwo1RDed3Phpv1mILzkYwCU0TSOD hu35nXdJpHbZYNIrPT5HG7Um8wL7jd37gpzGDDxjC4y3LUgXnoD/DT8VAaRmQwxsCUCY frDSL9fQiGpeYkR+A9A03cob1O42iL6C+mwNMEvUQFuTNVSDHkvsEu/mglwCas1Vsfyu +lKeeODuwH3xXoCipKMC7B6msxLxmU9CVj0MVZVnaAMpQeE6XTC+ONvIO80nnDK5Vvj3 PstA== 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:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:sender:dkim-signature; bh=diMIom3+2lvZsf3JG9wIFW2DdcRDntDvEaZa1gsclrU=; b=IdV6IOprab5IE5dPrIUGfrViKSBXeE6O8VCpceKRFnz2n0xnUxgsWlQNETIKbQHd7F axSmysTghWeHmCCA3Y/E2yuEA3dVCiz9QrUZ0msdyAcmJ1dmFdducIK81siRQ8+TX6++ 1FJDHPqhnOocBULQ0VU/4HoYngCwe6HV/werE+B6Lt4kteuqhjJPKWs2G1qH5vuLviL7 UljUnZt5u6+zQXIprauL96WReEkZwj0pbDALPwWRne0YupzEVWn/CcpDHw05yX8VU8Vz wbMEDBiPCUV/2ff+avI0egaqYvG2qHo5Y8coOfl8WrPVKdYKkb7TOwgOJZB+4g4oPazL WR2Q== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=NQD1ktx7; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net 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:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to; bh=diMIom3+2lvZsf3JG9wIFW2DdcRDntDvEaZa1gsclrU=; b=po+Ep6M/UEnnF2WQ+qbRObK4NdGaqUalxJUgJNZstCYxFdhdLOHYRO0EE68XToDSqc 14F+Ey/Ozh9hWy2fFZvs/bMUytK5IHfus96viHnydJCvho9jtWXH6+1gilC5V65ZC5OD RuLo/4A5hXUtgyx3zOGwueEKOBpsGU4qWSb/e55qJmmCt8tTFEBbVSQbpqPFu9jhy48P uiyASF7WWJxzEUixnkSkkJtnnT7FfIfAc4gimfwptf1Nqb00D/VB7/yapCWVf7ndqCm/ 2CGhhF5rrPw8AMQlXR1sTCi4SxA9B2f3YQ5QsezT+bJiq 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:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=diMIom3+2lvZsf3JG9wIFW2DdcRDntDvEaZa1gsclrU=; b=zrMR20XrgSgnnetEhHRBa4a0ndsYyf1gZEKQ2+yoVG53lOkyc97QAT6MU8xljWKvE0 vKz96wgq/Hd2QjpSoBVcRJuOQ6Vh1PWhO4+ddUimjUQfaBbX4tfODGHwqNE15MyAtqsZ cf4tdzwZs/9HDEsu7fgGAhfdiay1NieOgTQjJ66Qe7He2VhyQslG3TBDitAKtRWFpDDp mbbZIpqLFx1TuRVpijMePtD/4nXlEI8OeY2wnNeIQC8wCsVE7cHD13BwB1v66aweVQtD Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AFqh2ko6LRu46SIfI8WLvEBbbAJ2m/x6aguj7+3m94TxBNchcxWLc45A ggwZgCJmwewHkP/iC69Vnnw= X-Google-Smtp-Source: AMrXdXveEAAbyNh9bBZkslMu1obfRpPnDJS26leWYdtWr253N47tSq9Nl0o6aJJsFGyixr2f3RnkrQ== X-Received: by 2002:a05:600c:3b09:b0:3cf:5584:7730 with SMTP id m9-20020a05600c3b0900b003cf55847730mr3337347wms.187.1675099281486; Mon, 30 Jan 2023 09:21:21 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:adf:ee4b:0:b0:298:bd4a:4dd9 with SMTP id w11-20020adfee4b000000b00298bd4a4dd9ls2718197wro.1.-pod-prod-gmail; Mon, 30 Jan 2023 09:21:17 -0800 (PST) X-Received: by 2002:a05:6000:2aa:b0:2c1:2a15:9dd3 with SMTP id l10-20020a05600002aa00b002c12a159dd3mr113431wry.48.1675099277289; Mon, 30 Jan 2023 09:21:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675099277; cv=none; d=google.com; s=arc-20160816; b=c4bDraF6V5XIW86aw2oqwXZdujtgwoWYKgI+/CPz0aPcNEuSEeuH+agwmJmcjkmUmq /mXbgHnEivmWCXnFSZf6Q9JxjqP7LNo5xJqckoMgoHzsyPBqY1Z0fDRz+W2R/tgd000g nk9z530OsMedz56ywiV+x9MrNxAq2sU49MLMcE4i6GaRNT+iY5yEZLvnwC2VNc7njaCy djZhaSrR9xx3oGvoxPKTrEcpjUYssJM4XglBSHfD+EIQGjWQU/bxorvWA7GKrxtE0Pgp s7A9paLkBatWFh3m9vfdlhyFgGLjGiDF1KbhcpTpjH8UdMn5plv8ZjT25jN3FeV6q6Cm WK9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:to:from:date :dkim-signature; bh=5rrbz5W+i7jVh2lCuMosLDbON7a+XxQPcx0+Ozmqy9c=; b=pRuGskKNEXhnK9tqVRgClNMPO5tnz0pkK3CDtJDsrH/twu8BdgizBR6/HejvTgHTV4 DPS9uB2iMPtvdS/TsvYmpAfkJt6q0YKpVk9c7bR9irpkVdcajrQ6kOruIRsa2xiX9iKT gSPrQDK7e73ZFl3zdHAdENQnvuuSlk9quiMFA4bNhOBOX5hh84nFYrBM8uCseujHvSJM qV0rovERcRrJQ3PjOQBgYQrTpmdx/LooWJLiVCaGQ34CXQyIcL3llgBfkWkJSpUqZo5q 5mW1M0WERbPsCUKahEA+XT86J2JYr9NYoD/iJ9rhhQ7ssYpX3Wb0tWFTBkEDhCF5iAzr dPOA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=NQD1ktx7; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Original-Received: from mout02.posteo.de (mout02.posteo.de. [185.67.36.66]) by gmr-mx.google.com with ESMTPS id bt1-20020a056000080100b0024222ed1370si644731wrb.3.2023.01.30.09.21.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 09:21:17 -0800 (PST) Received-SPF: pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 as permitted sender) client-ip=185.67.36.66; Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id EB40C2402E0 for ; Mon, 30 Jan 2023 18:21:16 +0100 (CET) Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4P5FMc2plVz9rxN for ; Mon, 30 Jan 2023 18:21:16 +0100 (CET) Content-Disposition: inline In-Reply-To: <4865a325-42c0-4245-b992-b4fbdeab576en-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=NQD1ktx7; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net 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:32113 Archived-At: Do you mean a function that parses the .bib file directly? I really think t= hat it would be easier to convert the .bib file to a CSL JSON file and impo= rt it via a JSON parser. Le Monday 30 January 2023 =C3=A0 08:49:36AM, Bernardo C. D. A. Vasconcelos = a =C3=A9crit : > Thanks for the feedback, Bastien!=C2=A0 > Can you think of a similar example script that contains the function to p= arse > 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 th= ere > was no > > feasible way for it to be implemented as part of Citeproc. I sugges= ted a > Lua > > filter to achieve this and John said it sounded doable.=C2=A0 > > > > 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: parsi= ng the > bib > > data and saving it to a Lua table (stuck here); filtering spans; ch= ecking > the > > type and performing the replacement (not clear to me either what th= e > correct > > way would be to replace the id with the data or if this would have = to run > > before/after citeproc). > > > > Any pointers would be much appreciated. > > > > -- > > 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, s= end an > email > > to [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit [2][1]https://groups.googl= e.com/ > d/msgid/ > > pandoc-discuss/51e71797-b029-4438-be64-6a8a15dd500an%[2] > 40googlegroups.com. > > > > References: > > > > [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 Groups > "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an= 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/m= sgid/ > 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-b= e64-6a8a15dd500an%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > [4] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [5] https://groups.google.com/d/msgid/pandoc-discuss/4865a325-42c0-4245-b= 992-b4fbdeab576en%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/Y9f8i/Jl%2BgDjNo/a%40localhost.