From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/29084 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bastien DUMONT Newsgroups: gmane.text.pandoc Subject: Re: Help with a filter converting citations to sidenotes Date: Fri, 20 Aug 2021 16:59:21 +0000 Message-ID: References: <0f2d14e3-a86e-4fa1-b98c-52f540fe82b9n@googlegroups.com> <93663960-bbfe-40a1-b3ba-25fefe58e7e0n@googlegroups.com> <3106cf1d-5ae3-411f-b92a-c14153d58e49n@googlegroups.com> <7b758cdd-70d7-4c86-b08a-de891ff10ca2n@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="10651"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDCINCES2QJRBLF776EAMGQE3UW44GI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Aug 20 19:00:31 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wm1-f61.google.com ([209.85.128.61]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mH7sc-0002bB-Ba for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 20 Aug 2021 19:00:30 +0200 Original-Received: by mail-wm1-f61.google.com with SMTP id e12-20020a05600c218cb02902e6bbacdcd1sf2582452wme.4 for ; Fri, 20 Aug 2021 10:00:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1629478830; cv=pass; d=google.com; s=arc-20160816; b=K5eRgr56HF/w2EQUTwQtQo9+lC1CVHN4R4qMQ1e/bp6Te0bpdwl45JpHHvqxK0c04v RSfVRPecvhU4QPMZ577HOKNlh78kQzq93t4ZWMi7Jpy03PPsqST0Zl5DAMla6DTVvqZA VOy0EkTE4bcHTw56S+P0SDIeg7ATr3+qO68iOUA4ZEYJWJmcUdjicQHsv67WMVvBtcA1 7tENA0ANtY+7IX3PKGiLmKwDiIH1KmpXjRi3TixOXlo/oz0zE7g9R4YK0RR46hAxLf7J 4czEYzdyjrbNWQKbBAiC8vQkPJ0EuqQE1jrgwL7tMMhiiam7rbRTAcDvbcvEiJv5M7Bq WaCw== 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=trT+ZsW3pD07ocs/y2QITkjesnislgEqUZb7av4egw8=; b=QIbnLOLI87R5nG6HfCBLjofXXJsKbwTA0CBCkjGYAC9ETdBhZOtz/5kSbslmjAlWm0 HldyPikHNw5QJJ7l/0jjfrHFSx0HKwfchbSWirQEN6VTbw68yuvQpjhS3Ac67LMsWxRX dFNImzJLQnt5v1B+QncdP/fV2GTcqIFrAFLzjqwwUQbi45i8w3hFrcPvBsoQnbFB4Bf6 x1ya5V4otz1OosXGxBf040R7Kvep5G/u3vdqezT/aXAa00BbkKemAK8B0K2S36OWHvFD ZUBrZ2aFeaXgXfHaMX0ySIrGbZqa3VQHZ33KeJrSab7ErF4I4FHjyd5N3iNNvh9EKh5d 8G/Q== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=Zat6VU6Z; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 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=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :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=trT+ZsW3pD07ocs/y2QITkjesnislgEqUZb7av4egw8=; b=NKAMmXOVRQjIj6on+0RZh+//caoSF5I+LXrQGUblFbWmcPMwE6MHigSxVrdV2QNmym gb2KFRFGZtwgVpIFRZu6S3d8CMKDN/zAi7VxZOez19zKg1uicrgEDWn+Y6FeB0Ae0Y3y ZOb1sSbKPS1cLpelNlp4+VhpwCDtIlHx1t38GLPgxz409SDcBg0J3pUpvziyRuFLmKNJ 8QzbF3oSc8Q0ZFMtyX3g9JcEYYVxGbB6Zc8TH7K/kRMx9VVk4UOAc8udpYc8u75B4RBb eFJAVZXtUdQ6mM/EQVPdCc17ZBoZIWWsAJ8IYA2WGyrtYarl+XwmxkkeDq7H6do7CyXE Rd8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to: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=trT+ZsW3pD07ocs/y2QITkjesnislgEqUZb7av4egw8=; b=Bap0mzALG4gBffhNvikgPmhXNH99O0mM4P4iSI3xJ/8pzD4zd53T9VeNrBJ8/nbjyq CnE9F4DQTV2qyZBI1MzodbWu1CBmNyn9coi8UJBlbjIbKQiiS3wucukyDJls0ZQb40Hj uHdNEniRBOUExXWFmOhtBVh3XdkIKNtydmFYv19PVuGhNTV2+04xrqzTXnuvOcgwTVgb xcVhTIMKM2jMzxrY1KKATzIYaVS9hVoadufu8KLe2fHYERgQFqle5MEcFmTrqfjRevR3 ekpLw1KN0mGrXk2SObcoLO7hZFSt/uoEFOTMl4WH3SxM Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM531fk8BTG5hGfqe868h0XyrEjCuHAnsBxQMKPrDohJ/L5IAuIDb7 /TlvMF5Urm2Ez5e6PMt+c4k= X-Google-Smtp-Source: ABdhPJxaI1aqhJjhhE1/W4UJKd2fCXMKOYjq77vvkfq3EvHiyyBu6rM/HPGr4xSUJfRB/zGTKJWjHQ== X-Received: by 2002:a5d:42c2:: with SMTP id t2mr11288286wrr.49.1629478829926; Fri, 20 Aug 2021 10:00:29 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:adf:e5c5:: with SMTP id a5ls2262179wrn.0.gmail; Fri, 20 Aug 2021 10:00:27 -0700 (PDT) X-Received: by 2002:adf:c044:: with SMTP id c4mr11039303wrf.275.1629478827506; Fri, 20 Aug 2021 10:00:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629478827; cv=none; d=google.com; s=arc-20160816; b=Bxb1WemTSq4Sa3fCOh5Mk4sVWdJmhOTm11TXXaWZRcXB+rjBnBNDIQBWabX8WBxF53 ncHmLK3YUUCCd1gFBkbCrqY1KexsA1eBsnY9uHOOQNoyGrceQEVgSk0KtY/S1TSttqVS t3ghtr1Ndr1BXhJ24OcfSPM9hjQAmBt+VTlKKukecRd5dNvejAVMfcCjDY9Iaavu0v3z 4kPU1SOHsX0gvPgSTBT/Hyg7bRdBUA7OfG8UE5XE+DH8ToFi87E2ySaQIkkHokscEzEk uQSmRlTYEBG6qHfHQZVQ7kTo5maXeLa3+cnUrW3Dgy8PxA0qLf/2dCyI5On4y+FKRc+R E6jw== 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=YutUuPCunnmEwbpWcqwNX2CtzZAZjEww0gtUX0xW7MA=; b=fmBrwBscu1U9EJgD6CTspfq/AIIKExaO/HHFONA/j/7vmtk1+5MNK/b+t7LtDiuoN5 ClvyMkIEu78LyECx6MHjA9UkUYh1DRfqqZsJoOtzb9VqXdw9kQQC1DaU39wzU14NTrND R84WalA4gGGtf6COEWIPlig2Pt20KT2BojnfBrKIZVB2t19qWJjhO2Y3vTEYNg42APzE TtUYCGj5rITYCKuy3a35p7x/34VgroMDaKS2W0N52qVP6VXMPzBxtoW5UWw/kqFhhL83 HF8cUFS+g83IEBxdEMCMiZ7XzYufIT2PMfmfLFGF0lwKxwWps8UA7kJ5yYJOm1DCZ6vT esdQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=Zat6VU6Z; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 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 mout01.posteo.de (mout01.posteo.de. [185.67.36.65]) by gmr-mx.google.com with ESMTPS id z70si1053503wmc.0.2021.08.20.10.00.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Aug 2021 10:00:27 -0700 (PDT) Received-SPF: pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) client-ip=185.67.36.65; Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 25897240026 for ; Fri, 20 Aug 2021 19:00:27 +0200 (CEST) Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4GrnvG5TpJz6tmg for ; Fri, 20 Aug 2021 19:00:26 +0200 (CEST) Content-Disposition: inline In-Reply-To: <7b758cdd-70d7-4c86-b08a-de891ff10ca2n-/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=Zat6VU6Z; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 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:29084 Archived-At: If I've understood correctly what you want to achieve, you only need to con= struct one span: ``` function Cite(el) marginnote =3D pandoc.Span(el.content) marginnote.classes[1] =3D 'marginnote' return marginnote end ``` Le Friday 20 August 2021 =C3=A0 09:41:18AM, Leena Murgai a =C3=A9crit : > Yes, thanks for taking a look :). I should have said that I tried also > returning pandoc.Span(el.citations[1]) in my list of inlines but it seems= like > an empty string. I also tried running it before and after citeproc but as= you > said, the only thing that changed was the content. >=20 > Any other ideas? >=20 > On Friday, 20 August 2021 at 09:37:55 UTC-7 William Lupton wrote: >=20 > Not sure if this helps, but here's a simple example showing a somewha= t > readable dump of the AST before and after citeproc. I think only > cite.content has changed. I suspect that your problem is something el= se. >=20 >=20 > % cat cite.md=C2=A0 >=20 > @RFC1149 >=20 > =20 > % LUA_PATH=3D../?.lua pandoc -L rep.lua --citeproc -L rep.lua cite.md= =C2=A0 >=20 > (#) meta {} >=20 > (#) blocks { >=20 > =C2=A0 [1] content: Para { >=20 > =C2=A0 =C2=A0 [1] Cite { >=20 > =C2=A0 =C2=A0 =C2=A0 citations: { >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 [1] { >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 hash: 0 >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 id: "RFC1149" >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 mode: "AuthorInText" >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 note_num: 1 >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 prefix: {} >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 suffix: {} >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 } >=20 > =C2=A0 =C2=A0 =C2=A0 } >=20 > =C2=A0 =C2=A0 =C2=A0 content: { >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 [1] Str text: "@RFC1149" >=20 > =C2=A0 =C2=A0 =C2=A0 } >=20 > =C2=A0 =C2=A0 } >=20 > =C2=A0 } >=20 > } >=20 > [WARNING] Citeproc: citation RFC1149 not found >=20 > (#) meta {} >=20 > (#) blocks { >=20 > =C2=A0 [1] content: Para { >=20 > =C2=A0 =C2=A0 [1] Cite { >=20 > =C2=A0 =C2=A0 =C2=A0 citations: { >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 [1] { >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 hash: 0 >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 id: "RFC1149" >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 mode: "AuthorInText" >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 note_num: 1 >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 prefix: {} >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 suffix: {} >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 } >=20 > =C2=A0 =C2=A0 =C2=A0 } >=20 > =C2=A0 =C2=A0 =C2=A0 content: { >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 [1] Str text: "(" >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 [2] content: Strong { >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [1] Str text: "RFC1149?" >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 } >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 [3] Str text: ")" >=20 > =C2=A0 =C2=A0 =C2=A0 } >=20 > =C2=A0 =C2=A0 } >=20 > =C2=A0 } >=20 > } >=20 >

(RFC1149?<= /strong>) >

>=20 >=20 > On Fri, 20 Aug 2021 at 17:14, Leena Murgai wrote= : >=20 > I'm running it after citeproc since I need the citation values. >=20 > On Friday, 20 August 2021 at 09:12:06 UTC-7 Leena Murgai wrote: >=20 > Maybe the order I run the filters in matters? >=20 > On Friday, 20 August 2021 at 09:07:24 UTC-7 Leena Murgai wrot= e: >=20 > Yeah, I tried looking there, I couldn't find what I wante= d. I'm > sure I'm missing something. >=20 > The question is how to access it? As in what's the code? = For > example, each citation ([1]https://pandoc.org/lua-filters= .html# > type-citation) has the fields=C2=A0id,=C2=A0mode,=C2=A0pr= efix,=C2=A0suffix,=C2=A0 > note_num,=C2=A0hash. Which one contains the text I want? = What's the > code to get the list of inlines I want (corresponding to = the > text in the citation)? > On Friday, 20 August 2021 at 08:59:52 UTC-7 William Lupto= n > wrote: >=20 > Do you mean the citations themselves? These are in > el.citations. See=C2=A0[2]https://pandoc.org/lua-filt= ers.html# > type-cite and=C2=A0[3]https://pandoc.org/lua-filters.= html# > type-citation. >=20 > On Fri, 20 Aug 2021 at 16:36, Leena Murgai < > leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >=20 > So far I have the following, which puts the > [linked_item_number] in the passage and in the > marginnote but I'm missing the rest of the > text_that_goes_in_the_bibliography. >=20 > function Cite(el) > =C2=A0 return {=C2=A0 > =C2=A0 =C2=A0=C2=A0pandoc.Span(el.content), > =C2=A0 =C2=A0 pandoc.RawInline('html5', ' "marginnote">'), > =C2=A0 =C2=A0 pandoc.Span(el.content), > =C2=A0 =C2=A0 pandoc.RawInline('html5', ' = ') > =C2=A0 =C2=A0 } > end >=20 > On Thursday, 19 August 2021 at 20:32:11 UTC-7 Lee= na > Murgai wrote: >=20 > Hi there, >=20 > I'm converting from LaTeX to HTML5. I'd like = to put > my citations in 'sidenote's rather than at th= e end > of the doc. In practice, this just means I wa= nt the > output html: to look like >=20 > [linked_item_number] > text_that_goes_in_the_bibliography >=20 > How do I access the element that goes into th= e > citation, i.e. text_that_goes_in_the_bibliogr= aphy? >=20 > Any advice appreciated. >=20 >=20 >=20 > -- > You received this message because you are subscri= bed to > the Google Groups "pandoc-discuss" group. > To unsubscribe from this group and stop receiving > emails from it, send an email to=20 > pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit [4]https= :// > groups.google.com/d/msgid/pandoc-discuss/ > eda3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegro= ups.com > . >=20 > -- > You received this message because you are subscribed to the Googl= e > Groups "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it,= send > an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >=20 > To view this discussion on the web visit [5]https://groups.google= .com/d > /msgid/pandoc-discuss/ > 3106cf1d-5ae3-411f-b92a-c14153d58e49n%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= email > to [6]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit [7]https://groups.google.com/d/m= sgid/ > pandoc-discuss/7b758cdd-70d7-4c86-b08a-de891ff10ca2n%40googlegroups.com. >=20 > References: >=20 > [1] https://pandoc.org/lua-filters.html#type-citation > [2] https://pandoc.org/lua-filters.html#type-cite > [3] https://pandoc.org/lua-filters.html#type-citation > [4] https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9= 455-8a37373d33a6n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > [5] https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b= 92a-c14153d58e49n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > [6] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [7] https://groups.google.com/d/msgid/pandoc-discuss/7b758cdd-70d7-4c86-b= 08a-de891ff10ca2n%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/YR/faQH%2Bx47p5P9j%40localhost.