From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/29090 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: William Lupton Newsgroups: gmane.text.pandoc Subject: Re: Help with a filter converting citations to sidenotes Date: Fri, 20 Aug 2021 18:31:42 +0100 Message-ID: References: <0f2d14e3-a86e-4fa1-b98c-52f540fe82b9n@googlegroups.com> <93663960-bbfe-40a1-b3ba-25fefe58e7e0n@googlegroups.com> <3106cf1d-5ae3-411f-b92a-c14153d58e49n@googlegroups.com> <0fd903f3-e52d-44bd-a1b2-50bccfc9b66cn@googlegroups.com> <206b26c5-32b2-408d-80f6-cf851c9c8cb9n@googlegroups.com> <7df79e6f-cb35-4ca5-8bc3-f089e3bc9199n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000017464b05ca010b4a" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1340"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCS4HJ6WSAHBBCWO76EAMGQEEFORJDI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Aug 20 19:31:57 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ej1-f58.google.com ([209.85.218.58]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mH8N3-0000AK-8M for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 20 Aug 2021 19:31:57 +0200 Original-Received: by mail-ej1-f58.google.com with SMTP id s11-20020a170906060b00b005be824f15dasf3997449ejb.2 for ; Fri, 20 Aug 2021 10:31:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1629480716; cv=pass; d=google.com; s=arc-20160816; b=UyEpZvhW7E8mQLAj5o5Di0tSqH80Mjg47uppAzBLkVOnzNxmPXRsyxEhwR2REdRHd8 ayABgmO0syX2CwTSuF42tSX8MmD+nsiOc0WFaaVhjdgpWptH/2RUp3ZvS5sFW3WnHATo buBZiY1urXJ+P1B3KgPYcY7tuSqxFcUzlef4GPwJteuu5gbNfERZMKsyY6dlMgSADskh 4AlfIJasF/8Q7e1GvrFWc0/3AOG5PVohqcm3dy+FwAN+HmXcQ9Kj119iKDfI1rhdrVLr qKnDBtf0l4MwtuBx0UjE6kE11tgz7Sd4M7xLCw1HnyBd/Ab4MmQ/vxGbQl1urCsRiCdP Ii2w== 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:to:subject:message-id:date :from:in-reply-to:references:mime-version:sender:dkim-signature; bh=NluYK7vbLMZIbWY8pjztYdBeB4w3rznsalJN3yhLVIU=; b=xvz96dxK9YtMLbhPMf5kFxzATIyw6MMgWpt/zZYbtdMV1pFwAIkbW0WiaeUD17HpwJ MiCTXWfDblGJ+ulZkW4h3t7qElUt0JYuyCFFGsOn5qBSmdHiUO+8kEivxl8oOP8yiDcO G5TlsIdqFOr2i4cHq8vM1zifdh16tilRVzn/ULuf34Kg7Cwhh42cMtCwVu/1DQfwVyb0 aq6qxZJ3m0FXmocGNbqZ81WaRkaprVQwdj8VWJN4xjl9YrGvxPxAdnlj+osvlTmgM8Jw TrqEr7YhsHdZd+iU/orSFVSd7dg/dmDaz5kRSpYC1fCtL+WnrCOMrfOBhvXeA44x5fKb sKUQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@broadband-forum-org.20150623.gappssmtp.com header.s=20150623 header.b=SH9zZrU0; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::52e as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:mime-version:references:in-reply-to:from:date:message-id :subject: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=NluYK7vbLMZIbWY8pjztYdBeB4w3rznsalJN3yhLVIU=; b=fwGbCEW0CWRtWXVln8mLVHw8an6pJroJC6FFrECS3CcMhFwQpvE6+kNM8GPHXbdOJ1 TzzUeNwVS+K4PoSW7SIdlxuF+QAnaI6YXM/LDnAQE2n5iPEHlXybd3h8QVAHCZNJYl8A ImSrWBE0zM3n9vIq8F+YcJ8tPvoN66DxB9SSEM5BdjQrAGN2hXyq1Hsro4bUlqJuCqyf RTT3dAEHvUf2oE0E0OzCYBH9pCaSB3uaW3+SiPYR8AFg3v74T//BDXPX50FdpOcncuM4 DHZ2Os0gZomIF7ZIY385j+e9tabVYL1znt6GIKpLALfl01e0aGEsi8mhXoaOU3R0ZiJH zUhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:references:in-reply-to:from :date:message-id:subject: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=NluYK7vbLMZIbWY8pjztYdBeB4w3rznsalJN3yhLVIU=; b=Db5ucqki4PJ6O7RFv2KbCrmmUejLqsS99kZVaf4Q60qHjuFxKcgKdEGHxKXLKQGJti yNfAsASTSS3eTagy2gZdDDes0H8M+fhVe7O8KkoYZuz4jqmFeM6kYewU5mae1XULqRQG 9DMMY1+cCy7tKxDHKCnujTAnaqBaRnyY37Vli9VJyVSfzBCWrbcsjhrUo9jC6h7OlBc0 4iNTMD4Cs3Coo1pKOUxzXTBXbo+wxSjwZyNVW0HvD7s5J8E/pMCr2VR8SUAyyfSaW9UA 5M8/pAsrPYV9jbCb/VApEv89DxwgBD+aIYCZGeWtX1MC37TUEUK+WeWAwxPZq/A/ksOy 6hOw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM5308w2VOZ/ST2xQHUYhYifk/avJCD9/V5VgMHheCfvMKB/uwVvLb ihRgSdmBzvY6udf5CGQ1q7k= X-Google-Smtp-Source: ABdhPJxfCptvV9CJ2onE6/Hauqh4cwh3KUgNLfR6F91PJxWD7DXltaZs6KtvPAszZJKOIci1vRKVRw== X-Received: by 2002:a05:6402:27d0:: with SMTP id c16mr1499957ede.78.1629480716349; Fri, 20 Aug 2021 10:31:56 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:907:d1f:: with SMTP id gn31ls4809866ejc.11.gmail; Fri, 20 Aug 2021 10:31:54 -0700 (PDT) X-Received: by 2002:a17:906:4750:: with SMTP id j16mr22060108ejs.26.1629480713928; Fri, 20 Aug 2021 10:31:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629480713; cv=none; d=google.com; s=arc-20160816; b=Oglzgx98uMAPBCnga/DbrT0HoN9+bgy4JL2bbrWPnFaMmTm8TUM/xd6+w0Vgh0uQ0N rCBQayCOLy+G8bHHIXsu20/xjKE/78ain+cnMw8ajlNOiW5dcA61kHiNH2WGoo6BayrV KxDfoili440NFUiU5Bmw64fw4OoqK5oAcMDHF4imZd8mtFpqe2xkqYmeeFApXdC6KsBu GwoPod/yhn0YW7EBb11ww8kC3A9tkRMaJYnAOLha8NcqWyGRmiXr/5FPORI7wwPxmj4l NB6/4v/tGEQhQ894roy1pXvOUnC938stMs7kOwr5PAcvFEDEAbpaYeBqBx4ERhAJiMP7 FObg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=oEPTr6ntabQ4hMViZVky5DjWLMdk7MZ6eT4g4YFyr+4=; b=RQ74zndzpOkr9brNWSMmxB/b5iC7DfYXlQRbKqYZ6SCnDJlGiuEaRondzHhWDwUyTn CZITAfeiPRnawk0DDrpfZIHu1Bs1i+tCwAJ/H6EcVRL1/IYbpfSdU78SOSh6Cl3QF80L rE7CjwunoqZiobsj/ZXTOXKMfShF4lajss8VFCSQQJu3aVis2zhOLFX06UHxB0S/qHqJ KKywKRUnumH0QEkhwP0VdxsiGiZc41RlGTa4wgZ+aBRKhdHGsQmlWwiXlgc6qyEaXeJe 920wdA9ZOToNa2y0uYl79VOYNRLhq8hgKC21FUL93DmkVi3Zg77Bqa41w8FCTmz2NuCq vSqQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@broadband-forum-org.20150623.gappssmtp.com header.s=20150623 header.b=SH9zZrU0; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::52e as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org Original-Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com. [2a00:1450:4864:20::52e]) by gmr-mx.google.com with ESMTPS id w12si713721edj.5.2021.08.20.10.31.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Aug 2021 10:31:53 -0700 (PDT) Received-SPF: pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::52e as permitted sender) client-ip=2a00:1450:4864:20::52e; Original-Received: by mail-ed1-x52e.google.com with SMTP id g21so15040526edw.4 for ; Fri, 20 Aug 2021 10:31:53 -0700 (PDT) X-Received: by 2002:a05:6402:64b:: with SMTP id u11mr24382236edx.4.1629480713398; Fri, 20 Aug 2021 10:31:53 -0700 (PDT) In-Reply-To: X-Original-Sender: wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@broadband-forum-org.20150623.gappssmtp.com header.s=20150623 header.b=SH9zZrU0; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::52e as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@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:29090 Archived-At: --00000000000017464b05ca010b4a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sorry, you've probably already answered this along the way, but I'm confused about the "text" that you refer to. Perhaps you could attach a JSON AST that includes a citation with all the desired information from a run that DOESN'T use your filter? I'm unclear where in the AST to find the information that you want (and is missing). I had assumed that it must be in cite.citations but apparently not. On Fri, 20 Aug 2021 at 18:25, Leena Murgai wrote: > So I've attached some screenshots in case it helps. You can see that the > marginnote contains only the [linked_item_number] of the citation, the > rest is missing. Here's the filter I used: > > function Cite(el) > marginnote =3D pandoc.Span(el.content) > marginnote.classes[1] =3D 'marginnote' > return {pandoc.Span(el.content), marginnote} > end > > > > On Friday, 20 August 2021 at 10:06:30 UTC-7 Leena Murgai wrote: > >> Hello again Bastien, >> >> I just tried your code, it does something similar to mine (but clearly >> you code is nicer :). It's missing the text that makes up the citation >> block in the bibligraphy. To be clear I want the whole block (or inline?= ) >> that appears in the bibliography in my marginnote. >> >> Cheers! >> >> On Friday, 20 August 2021 at 10:00:56 UTC-7 Leena Murgai wrote: >> >>> Thanks William. >>> >>> These are the filters I'm using: >>> >>> 1. tex2html/filters/date.lua # Replace date with today's dat= e >>> if it's empty above # >>> 2. tex2html/filters/texref.lua # Cleanup pandoc and >>> pandoc-crossref conflicts # >>> 3. pandoc-crossref # >>> https://github.com/lierdakil/pandoc-crossref # >>> 4. citeproc # If you need control over when >>> the citeproc processing # >>> 5. pandoc-sidenote # >>> https://github.com/jez/pandoc-sidenote # >>> 6. tex2html/filters/margincitations.lua # put citations in marginnotes = # >>> >>> Thanks Pedro. >>> >>> I'm already using pandoc-sidenote :). What I actually want is a >>> marginnote. If I turn them into footnotes before running pandoc-sidenot= e, I >>> end up with a sidenote rather than a marginnote which gets a superscrip= t >>> label. This isn't what I want. I want to keep the [linked_item_number] = (provided >>> by citeproc) and put that in the (unnumbered) marginnote (with the rest= of >>> the ). RawInline let's me do that. I just can't access the text. >>> On Friday, 20 August 2021 at 09:44:46 UTC-7 pedro....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: >>> >>>> Jake Zimmerman=E2=80=99s pandoc-sidenote filter just takes every footn= ote as a >>>> whole and converts it to a sidenote . Unless you want separate >>>> streams for regular footnotes and citation sidenotes, it might be usef= ul: >>>> https://github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/Sid= eNote.hs >>>> >>>> Em sexta-feira, 20 de agosto de 2021 =C3=A0s 17:37:55 UTC+1, William L= upton >>>> escreveu: >>>> >>>>> 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. >>>>> >>>>> *% *cat cite.md >>>>> >>>>> @RFC1149 >>>>> >>>>> >>>>> *% *LUA_PATH=3D../?.lua pandoc -L rep.lua --citeproc -L rep.lua cite.= md >>>>> >>>>> (#) meta {} >>>>> >>>>> (#) blocks { >>>>> >>>>> [1] content: Para { >>>>> >>>>> [1] Cite { >>>>> >>>>> citations: { >>>>> >>>>> [1] { >>>>> >>>>> hash: 0 >>>>> >>>>> id: "RFC1149" >>>>> >>>>> mode: "AuthorInText" >>>>> >>>>> note_num: 1 >>>>> >>>>> prefix: {} >>>>> >>>>> suffix: {} >>>>> >>>>> } >>>>> >>>>> } >>>>> >>>>> content: { >>>>> >>>>> [1] Str text: "@RFC1149" >>>>> >>>>> } >>>>> >>>>> } >>>>> >>>>> } >>>>> >>>>> } >>>>> >>>>> [WARNING] Citeproc: citation RFC1149 not found >>>>> >>>>> (#) meta {} >>>>> >>>>> (#) blocks { >>>>> >>>>> [1] content: Para { >>>>> >>>>> [1] Cite { >>>>> >>>>> citations: { >>>>> >>>>> [1] { >>>>> >>>>> hash: 0 >>>>> >>>>> id: "RFC1149" >>>>> >>>>> mode: "AuthorInText" >>>>> >>>>> note_num: 1 >>>>> >>>>> prefix: {} >>>>> >>>>> suffix: {} >>>>> >>>>> } >>>>> >>>>> } >>>>> >>>>> content: { >>>>> >>>>> [1] Str text: "(" >>>>> >>>>> [2] content: Strong { >>>>> >>>>> [1] Str text: "RFC1149?" >>>>> >>>>> } >>>>> >>>>> [3] Str text: ")" >>>>> >>>>> } >>>>> >>>>> } >>>>> >>>>> } >>>>> >>>>> } >>>>> >>>>>

>>>> data-cites=3D"RFC1149">(RFC1149?)

>>>>> >>>>> On Fri, 20 Aug 2021 at 17:14, Leena Murgai wrote= : >>>>> >>>>>> I'm running it after citeproc since I need the citation values. >>>>>> >>>>>> On Friday, 20 August 2021 at 09:12:06 UTC-7 Leena Murgai wrote: >>>>>> >>>>>>> Maybe the order I run the filters in matters? >>>>>>> >>>>>>> On Friday, 20 August 2021 at 09:07:24 UTC-7 Leena Murgai wrote: >>>>>>> >>>>>>>> Yeah, I tried looking there, I couldn't find what I wanted. I'm >>>>>>>> sure I'm missing something. >>>>>>>> >>>>>>>> The question is how to access it? As in what's the code? For >>>>>>>> example, each citation ( >>>>>>>> https://pandoc.org/lua-filters.html#type-citation) has the fields >>>>>>>> id, mode, prefix, suffix, note_num, hash. 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 Lupton wrote: >>>>>>>> >>>>>>>>> Do you mean the citations themselves? These are in el.citations. >>>>>>>>> See https://pandoc.org/lua-filters.html#type-cite and >>>>>>>>> https://pandoc.org/lua-filters.html#type-citation. >>>>>>>>> >>>>>>>>> On Fri, 20 Aug 2021 at 16:36, Leena Murgai >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> 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. >>>>>>>>>> >>>>>>>>>> function Cite(el) >>>>>>>>>> return { >>>>>>>>>> pandoc.Span(el.content), >>>>>>>>>> pandoc.RawInline('html5', ' '), >>>>>>>>>> pandoc.Span(el.content), >>>>>>>>>> pandoc.RawInline('html5', ' ') >>>>>>>>>> } >>>>>>>>>> end >>>>>>>>>> >>>>>>>>>> On Thursday, 19 August 2021 at 20:32:11 UTC-7 Leena Murgai wrote= : >>>>>>>>>> >>>>>>>>>>> Hi there, >>>>>>>>>>> >>>>>>>>>>> I'm converting from LaTeX to HTML5. I'd like to put my citation= s >>>>>>>>>>> in 'sidenote's rather than at the end of the doc. In practice, = this just >>>>>>>>>>> means I want the output html: to look like >>>>>>>>>>> >>>>>>>>>>> [linked_item_number] >>>>>>>>>>> text_that_goes_in_the_bibliography >>>>>>>>>>> >>>>>>>>>>> How do I access the element that goes into the citation, i.e. >>>>>>>>>>> text_that_goes_in_the_bibliography? >>>>>>>>>>> >>>>>>>>>>> Any advice 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= , >>>>>>>>>> send an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>>>>>>> To view this discussion on the web visit >>>>>>>>>> https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4= f42-9455-8a37373d33a6n%40googlegroups.com >>>>>>>>>> >>>>>>>>>> . >>>>>>>>>> >>>>>>>>> -- >>>>>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>>> >>>>> To view this discussion on the web visit >>>>>> https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-= b92a-c14153d58e49n%40googlegroups.com >>>>>> >>>>>> . >>>>>> >>>>> -- > 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/msgid/pandoc-discuss/eb59834b-d3e8-4dc4-9a66-= 0eb8c0f3e225n%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 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/CAEe_xxjLevSn7YgLpg4LTdmjD_duxwm%2BZ3qXEGM%2BzSuwHUT3fg%40ma= il.gmail.com. --00000000000017464b05ca010b4a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Sorry, you've probably already answered this along the= way, but I'm confused about the "text" that you refer to. Pe= rhaps you could attach a JSON AST that includes a citation with all the des= ired information from a run that DOESN'T use your filter? I'm uncle= ar where in the AST to find the information that you want (and is missing).= I had assumed that it must be in cite.citations but apparently not.
<= br>
On Fri,= 20 Aug 2021 at 18:25, Leena Murgai <leenamurgai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
So I've attached some screenshots in case it= helps. You can see that the marginnote c= ontains only the [linked_item_number] of = the citation, the rest is missing. Here's the filter I used:

function Cite(el)
=C2=A0 marginnote =3D pandoc.Span(el.conte= nt)
=C2=A0 marginnote.classes[1= ] =3D 'marginnote'
= =C2=A0 return {pandoc.Span(el.content), marginnote}
end



=
On Friday, 20 August 2021 at 10:06:30 UTC-7 Leena Murgai wrote:
Hello again Bastien,
I just tried your code, it does something similar to mine (= but clearly you code is nicer :). It's missing the text that makes up t= he citation block in the bibligraphy. To be clear I want the whole block (o= r inline?) that appears in the bibliography in my marginnote.
Cheers!

On Friday, 20 August 2021 at 10:00:56 UTC-7 Leena M= urgai wrote:
Tha= nks=C2=A0 William.

These are the filters I'm using:<= div>
1. tex2html/filters/date.lua= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Replace date with today's d= ate if it's empty above #
2. tex2html/filters/texref.lua=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 # Cleanup pandoc and pandoc-crossref conflicts #
3. pandoc-crossref=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # https://github.com/lierdakil/pandoc-crossref #
4. citeproc=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0=C2=A0 # If you need control over when the citeproc p= rocessing #
5. pandoc-sid= enote=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 # https://github.com/jez/pandoc-sidenote = #
6. tex2h= tml/filters/margincitations.lua # put citations in marginnotes = #

Thanks Pedro.
=

I'm already using pandoc-sidenote :). What I actual= ly want is a marginnote. If I turn them into footnotes before running pando= c-sidenote, I end up with a sidenote rather than a marginnote which gets a = superscript label. This isn't what I want. I want to keep the [linked_item_number]=C2=A0(provided by citeproc) a= nd put that in the (unnumbered) marginnote (with the rest of the ). RawInli= ne let's me do that. I just can't access the text.
On Friday, 20 = August 2021 at 09:44:46 UTC-7 pedro....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org w= rote:
Jake Zimme= rman=E2=80=99s pandoc-sidenote filter just takes every footnote as a whole = and converts it to a sidenote <span>. Unless you want separate stream= s for regular footnotes and citation sidenotes, it might be useful: https://github.com/jez/pandoc-s= idenote/blob/master/src/Text/Pandoc/SideNote.hs

Em sexta-feira, 20 de ago= sto de 2021 =C3=A0s 17:37:55 UTC+1, William Lupton escreveu:
Not sure= if this helps, but here's a simple example showing a somewhat readable= dump of the AST before and after citeproc. I think only cite.content has c= hanged. I suspect that your problem is something else.

=

% = cat cite.= md=C2=A0

@RFC1149


% LUA_PATH=3D../?.lua pandoc -L rep.lua --citeproc -L rep.lua cite= .md=C2=A0

(#) meta {}

(#) blocks= {

=C2=A0 [1] content: Para {

=C2=A0 =C2=A0 [1] Cite {

=C2=A0 =C2=A0 =C2= =A0 citations: {

=C2=A0 =C2=A0 =C2=A0 =C2=A0 [1] {

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 h= ash: 0

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 id: &= quot;RFC1149"

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = mode: "AuthorInText"

=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 note_num: 1

=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 prefix: {}

=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 suffix: {}

=C2=A0 =C2=A0 = =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 content: {

<= span>=C2=A0 =C2=A0 =C2=A0 =C2=A0 [1] Str text: "@RFC1149"<= /span>

=C2=A0 =C2=A0 =C2=A0 }

=C2= =A0 =C2=A0 }

=C2=A0 }

}

[WARNING] Citeproc: citation RFC1149 not found

(#) meta {}

(#) blocks {

=C2=A0 [1] content: Para {

=C2=A0 =C2=A0 [1] Cite {

=C2=A0 =C2=A0 =C2=A0 citations: {

=C2=A0 =C2=A0 =C2=A0 =C2=A0 [1] {

=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 hash: 0

= =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 id: "RFC1149"

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 mode: "AuthorInText"=

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 note_num: 1=

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 prefix: {}<= /span>

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 suffix: {}

=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 = content: {

=C2=A0 =C2=A0 =C2=A0 =C2=A0 [= 1] Str text: "("

=C2=A0 =C2=A0 =C2=A0 =C2=A0= [2] content: Strong {

=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 [1] Str text: "RFC1149?"

= =C2=A0 =C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2= =A0 =C2=A0 [3] Str text: ")"

=C2=A0 = =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 }

=C2=A0 }

}

<p><span class=3D= "citation" data-cites=3D"RFC1149">(<strong>RFC= 1149?</strong>)</span></p>


On Fri, 20 Aug 2021 at 17:14, Leena Murgai <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
I'm runni= ng it after citeproc since I need the citation values.

On Friday, 20 August 2= 021 at 09:12:06 UTC-7 Leena Murgai wrote:
Maybe the order I run the filters in matters?
=
On Fr= iday, 20 August 2021 at 09:07:24 UTC-7 Leena Murgai wrote:
Yeah, I tried looking there, I c= ouldn't find what I wanted. I'm sure I'm missing something.
The question is how to access it? As in what's the code= ? For example, each citation (https://pandoc.org/lua-= filters.html#type-citation) has the fields=C2=A0id,=C2=A0mode,=C2= =A0prefix,=C2=A0suffix,=C2=A0note_num= ,=C2=A0hash. Which one conta= ins 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 Lupton wrote:
Do you mean the citations themselves? Thes= e are in el.citations. See=C2=A0https://pandoc.org/lua-fi= lters.html#type-cite and=C2=A0https://pandoc.org/= lua-filters.html#type-citation.

On Fri,= 20 Aug 2021 at 16:36, Leena Murgai <leena...@gmail.= com> wrote:
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.

function Cite(el)
=C2=A0 return {=C2=A0
=C2=A0 =C2=A0=C2=A0pandoc.Span(= el.content),
=C2=A0 =C2=A0 pandoc.RawInline('html5', &#= 39; <span class =3D "marginnote">'),
= =C2=A0 =C2=A0 pandoc.Span(el.content),
=C2=A0 =C2=A0 pandoc.RawInline('html= 5', ' </span>')
=C2=A0 =C2=A0 }
end

On Thursday, 19 August 2021 at 20:32:11 UTC-7 Leena Murgai wrote= :
Hi there,=

I'm converting from LaTeX to HTML5. I'd l= ike to put my citations in 'sidenote's rather than at the end of th= e doc. In practice, this just means I want the output html: to look like

[linked_item_number] <= span class=3Dmarginnote>
tex= t_that_goes_in_the_bibliography</span>

How do I access the element that goes into the citation, i.e. text_that_goes_in_the_bibliography?
<= br>
Any advice appreciated.


=

--
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 pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-= 4f42-9455-8a37373d33a6n%40googlegroups.com.

--
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 pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.

--
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 pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https= ://groups.google.com/d/msgid/pandoc-discuss/eb59834b-d3e8-4dc4-9a66-0eb8c0f= 3e225n%40googlegroups.com.

--
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://gro= ups.google.com/d/msgid/pandoc-discuss/CAEe_xxjLevSn7YgLpg4LTdmjD_duxwm%2BZ3= qXEGM%2BzSuwHUT3fg%40mail.gmail.com.
--00000000000017464b05ca010b4a--