From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/29101 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Leena Murgai Newsgroups: gmane.text.pandoc Subject: Re: Help with a filter converting citations to sidenotes Date: Fri, 20 Aug 2021 11:53:59 -0700 (PDT) Message-ID: <4c177bdf-f369-4e9b-bdc6-36e0e38cf496n@googlegroups.com> References: <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> <5866a845-e0bd-48b1-835d-189e40ef94f5n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1638_713886611.1629485639809" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5601"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCIMDCM26AARBSHU76EAMGQEVWYUHFY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Aug 20 20:54:04 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f55.google.com ([209.85.161.55]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mH9eV-0001Ce-Ni for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 20 Aug 2021 20:54:03 +0200 Original-Received: by mail-oo1-f55.google.com with SMTP id w9-20020a4aca09000000b0028b7adc5bd2sf4858874ooq.11 for ; Fri, 20 Aug 2021 11:54:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=7IVH0asQ+NaH97tACO/RPi54pKeKXvoGYYmgN4CW0ck=; b=dHoLoWQxUsQL4k9eP1BY50uYy12kI1Z1vcOR3NPbXXoSi+rdjYCECvVaWTW5TSezhE mmKohZWMGz2jyl3qagRbodAXhBdug/ku4DEHht28XiSI7e58APwCrtxDpLuKLZVdoEtw kkfWAvBhQtR8wfGh0LVJpQFBHdxAEJInVt7ScjEjVBLctnjKQEL0gSlpi9RVcBpPC8Yi 6kQLdEKfedAeWxRJl3JEehGrt/msbWZzE6Hea8LY8V9BbdQsbFsEi7pp7mNQjc5k1PYq rYbHEFQl0HL1bufmlfBKy8VDXLr4pFJ2P6m9MrwXZgqpTezg3epe6m7VjVn3d8JQ3Bnk 5nbg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=7IVH0asQ+NaH97tACO/RPi54pKeKXvoGYYmgN4CW0ck=; b=PChl/OxCWGzW45aIYk5124pl7O1KXGpOsnT16V27XLy3ZLJqqoFG62a68IHRKee9zo Uwu6N+syFmGXOgP0lFlnxuJsvSS1PtQ6joCQPcORurvX75KbeOzj1JizwwnwPeP4bc/V CJ9E9w5RRDNqh88gRBntpsXoGfCIFCZeb8wbBnbNlo02Ms8Dh6fNDxoYF0Jc2NvSG76m LWOY0hyOOyFBz9FCQPMqkFprr88Va9MJ4znMLTcds0N8ugQiXfB/ziZmhgoxT7Es27tL WvbuczCsNm1t52OvsahBDsgAyEwwXX9cxTbUg624no5kO2KAyKm3NjKk1w9Bwv5lmU6Y HO/A== 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:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=7IVH0asQ+NaH97tACO/RPi54pKeKXvoGYYmgN4CW0ck=; b=FkIeFQ6jYve1Bv+5Ae6ziRcforyNfFv0qkAt+4VwBbBDCw9oyBgKU9qWaXjIoFDeMT TVe2I7JTfHDW/vGYdz2oeoG34JjteELdBte4eK7vJBzj+CzSEg/crOp5+nTH+dgSWblh rvC3bH5HWvS/NFrjz8EArJrSqF890AieP5mtbMnQ+DglWcIM8DNPWeRBH2/FZpematO1 YXx6Om0ChWyVWWG4+3x5Gs0hZxTNY7ud7diORfDdmIFbwb+vzX71t8DfvqdV55cwZbGL pv98sgEOmGv4mceGWFIOctEO5HjQxBiKSxJRzSqCXpo4FZ6jR41xU9dMwIUVLBYo2wyJ t3ZQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM5313qg35O9R++w7scwMDvdFED5I+/AgzqhS1BXZ7fnfwEdeTVRSL qSURpGmpXk3W4WKoiayLxhU= X-Google-Smtp-Source: ABdhPJwx6z3YEM/LaAFqicmKeBJnSYxEmOiv/b9I5iwacz689LNCAM4ePxo5InCud6vyjThDysXMUA== X-Received: by 2002:a9d:bf0:: with SMTP id 103mr14239305oth.212.1629485642046; Fri, 20 Aug 2021 11:54:02 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6808:20a7:: with SMTP id s39ls2589281oiw.11.gmail; Fri, 20 Aug 2021 11:54:00 -0700 (PDT) X-Received: by 2002:aca:1109:: with SMTP id 9mr4130337oir.109.1629485640445; Fri, 20 Aug 2021 11:54:00 -0700 (PDT) In-Reply-To: <5866a845-e0bd-48b1-835d-189e40ef94f5n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: leenamurgai-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:29101 Archived-At: ------=_Part_1638_713886611.1629485639809 Content-Type: multipart/alternative; boundary="----=_Part_1639_1337242293.1629485639809" ------=_Part_1639_1337242293.1629485639809 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sorry, I wish I could write this message in an editable markdown window!=20 I'll try again... Hi Bastien, Good questions, thx. As I said I am converting from latex to html5, so no markdown to share. I shared my filter above but here it is for convenience: function Cite(el) marginnote =3D pandoc.Span(el.content) marginnote.classes[1] =3D 'marginnote' return {pandoc.Span(el.content), marginnote} end Here's the reference block html in the references section:
[1]
D.= =20 Ingold and S. Soper, =E2=80=9CAmazon doesn=E2=80=99t consider the rac= e of its=20 customers. Should it?=E2=80=9D Bloomberg, 2016.
I want the following in my marginnote [1] [1] D.=20 Ingold and S. Soper, =E2=80=9CAmazon doesn=E2=80=99t consider the rac= e of its=20 customers. Should it?=E2=80=9D Bloomberg, 2016. Note, I want to replace the divs with spans, but just getting the divs for= =20 now would be progress. At the moment all I get in my marginnote is [1][1] I think William's idea is promising so will try that approach. Happy for=20 other suggestions if they come to mind. On Friday, 20 August 2021 at 11:34:11 UTC-7 Leena Murgai wrote: > Hi Bastien, > > All good questions, thx. > > As I said I am converting from latex to html5, so no markdown to share. > > Here's the reference block html in the references section: >
>
[1]
= D.=20 > Ingold and S. Soper, =E2=80=9CAmazon doesn=E2=80=99t consider the r= ace of its=20 > customers. Should it?=E2=80=9D Bloomberg, 2016.
>
> > I want the following in my marginnote > [1] > > > [1] D.=20 > Ingold and S. Soper, =E2=80=9CAmazon doesn=E2=80=99t consider the r= ace of its=20 > customers. Should it?=E2=80=9D Bloomberg, 2016. > > At the moment all I get in my marginnote is > > [1] class=3D"marginnote">[1] > On Friday, 20 August 2021 at 11:09:54 UTC-7 Bastien Dumont wrote: > >> Sorry, but is very difficult to help you efficiently from incomplete=20 >> descriptions and screenshots. Could you please send the following?=20 >> >> * A very small Markdown chunk with only one citation;=20 >> * The corresponding HTML code with the desired output;=20 >> * The HTML code you actually get;=20 >> * Your CSL stylesheet (if other than the default one);=20 >> * The bibliography entry used in your example;=20 >> * Your filter.=20 >> >> Without that, nobody can guess what is going on.=20 >> >> Le Friday 20 August 2021 =C3=A0 10:41:07AM, Leena Murgai a =C3=A9crit := =20 >> > No problem William,=20 >> >=20 >> > in the example screenshots, the text I'm referring to is specifically= =20 >> >=20 >> > D. Ingold and S. Soper, =E2=80=9CAmazon doesn=E2=80=99t consider the r= ace of its=20 >> customers.=20 >> > Should it?=E2=80=9D Bloomberg, 2016.=20 >> >=20 >> > I assume it's a list of inlines in the AST, possibly a block, as I sai= d=20 >> I don't=20 >> > know where it's stored. I assumed in citations, as did you, but I don'= t=20 >> know=20 >> > how to access it. Anyway, I want that text to be in my marginnote alon= g=20 >> side=20 >> > the (lonely looking) [1].=20 >> >=20 >> > Actually, I'm not interested in having the references at the end at=20 >> all, I'd=20 >> > rather just have the linked reference in marginnote.=20 >> > On Friday, 20 August 2021 at 10:31:57 UTC-7 William Lupton wrote:=20 >> >=20 >> > Sorry, you've probably already answered this along the way, but I'm=20 >> > confused about the "text" that you refer to. Perhaps you could attach = a=20 >> > JSON AST that includes a citation with all the desired information fro= m=20 >> a=20 >> > run that DOESN'T use your filter? I'm unclear where in the AST to find= =20 >> the=20 >> > information that you want (and is missing). I had assumed that it must= =20 >> be=20 >> > in cite.citations but apparently not.=20 >> >=20 >> > On Fri, 20 Aug 2021 at 18:25, Leena Murgai wrote:= =20 >> >=20 >> > So I've attached some screenshots in case it helps. You can see that= =20 >> > the marginnote contains only the [linked_item_number] of the citation,= =20 >> > the rest is missing. Here's the filter I used:=20 >> >=20 >> > function Cite(el)=20 >> > marginnote =3D pandoc.Span(el.content)=20 >> > marginnote.classes[1] =3D 'marginnote'=20 >> > return {pandoc.Span(el.content), marginnote}=20 >> > end=20 >> >=20 >> >=20 >> >=20 >> > On Friday, 20 August 2021 at 10:06:30 UTC-7 Leena Murgai wrote:=20 >> >=20 >> > Hello again Bastien,=20 >> >=20 >> > I just tried your code, it does something similar to mine (but=20 >> > clearly you code is nicer :). It's missing the text that makes up=20 >> > the citation block in the bibligraphy. To be clear I want the whole=20 >> > block (or inline?) that appears in the bibliography in my=20 >> > marginnote.=20 >> >=20 >> > Cheers!=20 >> >=20 >> > On Friday, 20 August 2021 at 10:00:56 UTC-7 Leena Murgai wrote:=20 >> >=20 >> > Thanks William.=20 >> >=20 >> > These are the filters I'm using:=20 >> >=20 >> > 1. tex2html/filters/date.lua # Replace date with=20 >> > today's date if it's empty above #=20 >> > 2. tex2html/filters/texref.lua # Cleanup pandoc and=20 >> > pandoc-crossref conflicts #=20 >> > 3. pandoc-crossref # [1]https://github.com=20 >> > /lierdakil/pandoc-crossref #=20 >> > 4. citeproc # If you need control=20 >> > over when the citeproc processing #=20 >> > 5. pandoc-sidenote # [2]https://github.com=20 >> > /jez/pandoc-sidenote #=20 >> > 6. tex2html/filters/margincitations.lua # put citations in=20 >> > marginnotes #=20 >> >=20 >> > Thanks Pedro.=20 >> >=20 >> > I'm already using pandoc-sidenote :). What I actually want is a=20 >> > marginnote. If I turn them into footnotes before running=20 >> > pandoc-sidenote, I end up with a sidenote rather than a=20 >> > marginnote which gets a superscript label. This isn't what I=20 >> > want. I want to keep the [linked_item_number] (provided by=20 >> > citeproc) and put that in the (unnumbered) marginnote (with the=20 >> > rest of the ). RawInline let's me do that. I just can't access=20 >> > the text.=20 >> > On Friday, 20 August 2021 at 09:44:46 UTC-7 pedro....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org=20 >> > wrote:=20 >> >=20 >> > Jake Zimmerman=E2=80=99s pandoc-sidenote filter just takes every=20 >> > footnote as a whole and converts it to a sidenote .=20 >> > Unless you want separate streams for regular footnotes and=20 >> > citation sidenotes, it might be useful: [3]https://=20 >> > github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/=20 >> > SideNote.hs=20 >> >=20 >> > Em sexta-feira, 20 de agosto de 2021 =C3=A0s 17:37:55 UTC+1,=20 >> > William Lupton escreveu:=20 >> >=20 >> > Not sure if this helps, but here's a simple example=20 >> > showing a somewhat readable dump of the AST before and=20 >> > after citeproc. I think only cite.content has changed.=20 >> > I suspect that your problem is something else.=20 >> >=20 >> >=20 >> > % cat cite.md =20 >> >=20 >> > @RFC1149=20 >> >=20 >> >=20 >> > % LUA_PATH=3D../?.lua pandoc -L rep.lua --citeproc -L=20 >> > rep.lua cite.md =20 >> >=20 >> > (#) meta {}=20 >> >=20 >> > (#) blocks {=20 >> >=20 >> > [1] content: Para {=20 >> >=20 >> > [1] Cite {=20 >> >=20 >> > citations: {=20 >> >=20 >> > [1] {=20 >> >=20 >> > hash: 0=20 >> >=20 >> > id: "RFC1149"=20 >> >=20 >> > mode: "AuthorInText"=20 >> >=20 >> > note_num: 1=20 >> >=20 >> > prefix: {}=20 >> >=20 >> > suffix: {}=20 >> >=20 >> > }=20 >> >=20 >> > }=20 >> >=20 >> > content: {=20 >> >=20 >> > [1] Str text: "@RFC1149"=20 >> >=20 >> > }=20 >> >=20 >> > }=20 >> >=20 >> > }=20 >> >=20 >> > }=20 >> >=20 >> > [WARNING] Citeproc: citation RFC1149 not found=20 >> >=20 >> > (#) meta {}=20 >> >=20 >> > (#) blocks {=20 >> >=20 >> > [1] content: Para {=20 >> >=20 >> > [1] Cite {=20 >> >=20 >> > citations: {=20 >> >=20 >> > [1] {=20 >> >=20 >> > hash: 0=20 >> >=20 >> > id: "RFC1149"=20 >> >=20 >> > mode: "AuthorInText"=20 >> >=20 >> > note_num: 1=20 >> >=20 >> > prefix: {}=20 >> >=20 >> > suffix: {}=20 >> >=20 >> > }=20 >> >=20 >> > }=20 >> >=20 >> > content: {=20 >> >=20 >> > [1] Str text: "("=20 >> >=20 >> > [2] content: Strong {=20 >> >=20 >> > [1] Str text: "RFC1149?"=20 >> >=20 >> > }=20 >> >=20 >> > [3] Str text: ")"=20 >> >=20 >> > }=20 >> >=20 >> > }=20 >> >=20 >> > }=20 >> >=20 >> > }=20 >> >=20 >> >

=20 >> > (RFC1149?)

=20 >> >=20 >> >=20 >> > On Fri, 20 Aug 2021 at 17:14, Leena Murgai <=20 >> > leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:=20 >> >=20 >> > I'm running it after citeproc since I need the=20 >> > citation values.=20 >> >=20 >> > On Friday, 20 August 2021 at 09:12:06 UTC-7 Leena=20 >> > Murgai wrote:=20 >> >=20 >> > Maybe the order I run the filters in matters?=20 >> >=20 >> > On Friday, 20 August 2021 at 09:07:24 UTC-7=20 >> > Leena Murgai wrote:=20 >> >=20 >> > Yeah, I tried looking there, I couldn't=20 >> > find what I wanted. I'm sure I'm missing=20 >> > something.=20 >> >=20 >> > The question is how to access it? As in=20 >> > what's the code? For example, each citation=20 >> > ([4]https://pandoc.org/lua-filters.html#=20 >> > type-citation) has the fields id, mode, =20 >> > prefix, suffix, note_num, hash. Which one=20 >> > contains the text I want? What's the code=20 >> > to get the list of inlines I want=20 >> > (corresponding to the text in the=20 >> > citation)?=20 >> > On Friday, 20 August 2021 at 08:59:52 UTC-7=20 >> > William Lupton wrote:=20 >> >=20 >> > Do you mean the citations themselves?=20 >> > These are in el.citations. See [5]=20 >> > https://pandoc.org/lua-filters.html#=20 >> > type-cite and [6]https://pandoc.org/=20 >> > lua-filters.html#type-citation.=20 >> >=20 >> > On Fri, 20 Aug 2021 at 16:36, Leena=20 >> > Murgai wrote:=20 >> >=20 >> > So far I have the following, which puts=20 >> > the [linked_item_number] in the passage=20 >> > and in the marginnote but I'm missing=20 >> > the rest of the=20 >> > text_that_goes_in_the_bibliography.=20 >> >=20 >> > function Cite(el)=20 >> > return { =20 >> > pandoc.Span(el.content),=20 >> > pandoc.RawInline('html5', ' > > class =3D "marginnote">'),=20 >> > pandoc.Span(el.content),=20 >> > pandoc.RawInline('html5', '
=20 >> > ')=20 >> > }=20 >> > end=20 >> >=20 >> > On Thursday, 19 August 2021 at 20:32:11=20 >> > UTC-7 Leena Murgai wrote:=20 >> >=20 >> > Hi there,=20 >> >=20 >> > I'm converting from LaTeX to HTML5. I'd=20 >> > like to put my citations in 'sidenote's=20 >> > rather than at the end of the doc. In=20 >> > practice, this just means I want the=20 >> > output html: to look like=20 >> >=20 >> > [linked_item_number] > > marginnote>=20 >> > text_that_goes_in_the_bibliography> > span>=20 >> >=20 >> > How do I access the element that goes=20 >> > into the citation, i.e.=20 >> > text_that_goes_in_the_bibliography?=20 >> >=20 >> > Any advice appreciated.=20 >> >=20 >> >=20 >> >=20 >> > --=20 >> > You received this message because you=20 >> > are subscribed to the Google Groups=20 >> > "pandoc-discuss" group.=20 >> > To unsubscribe from this group and stop=20 >> > receiving emails from it, send an email=20 >> > to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org=20 >> > To view this discussion on the web=20 >> > visit [7]https://groups.google.com/d/=20 >> > msgid/pandoc-discuss/=20 >> > eda3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegroups.com=20 >> > .=20 >> >=20 >> > --=20 >> > You received this message because you are=20 >> > subscribed to the Google Groups "pandoc-discuss"=20 >> > group.=20 >> > To unsubscribe from this group and stop receiving=20 >> > emails from it, send an email to=20 >> > pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org=20 >> >=20 >> > To view this discussion on the web visit [8]https:/=20 >> > /groups.google.com/d/msgid/pandoc-discuss/=20 >> > 3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com=20 >> > .=20 >> >=20 >> > --=20 >> > You received this message because you are subscribed to the Google=20 >> > Groups "pandoc-discuss" group.=20 >> > To unsubscribe from this group and stop receiving emails from it, send= =20 >> > an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org=20 >> >=20 >> > To view this discussion on the web visit [9]https://groups.google.com/= d=20 >> > /msgid/pandoc-discuss/=20 >> > eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n%40googlegroups.com.=20 >> >=20 >> > --=20 >> > You received this message because you are subscribed to the Google=20 >> Groups=20 >> > "pandoc-discuss" group.=20 >> > To unsubscribe from this group and stop receiving emails from it, send= =20 >> an email=20 >> > to [10]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org=20 >> > To view this discussion on the web visit [11] >> https://groups.google.com/d/msgid/=20 >> > pandoc-discuss/b548772c-269e-45c7-9ff6-9aec6014f024n%40googlegroups.co= m.=20 >> >> >=20 >> > References:=20 >> >=20 >> > [1] https://github.com/lierdakil/pandoc-crossref=20 >> > [2] https://github.com/jez/pandoc-sidenote=20 >> > [3]=20 >> https://github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/SideN= ote.hs=20 >> > [4] https://pandoc.org/lua-filters.html#type-citation=20 >> > [5] https://pandoc.org/lua-filters.html#type-cite=20 >> > [6] https://pandoc.org/lua-filters.html#type-citation=20 >> > [7]=20 >> https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9455= -8a37373d33a6n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter=20 >> > [8]=20 >> https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a= -c14153d58e49n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter=20 >> > [9]=20 >> https://groups.google.com/d/msgid/pandoc-discuss/eb59834b-d3e8-4dc4-9a66= -0eb8c0f3e225n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter=20 >> > [10] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org=20 >> > [11]=20 >> https://groups.google.com/d/msgid/pandoc-discuss/b548772c-269e-45c7-9ff6= -9aec6014f024n%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 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/4c177bdf-f369-4e9b-bdc6-36e0e38cf496n%40googlegroups.com. ------=_Part_1639_1337242293.1629485639809 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sorry, I wish I could write this message in an editable markdown window! I'= ll try again...

Hi Bastien,

Good questions, = thx.

As I said I am converting from latex to html5, = so no markdown to share.
I shared my filter above but here it is = for convenience:
function Cite(el= )
  marginnote =3D pandoc.= Span(el.content)
  marginn= ote.classes[1] =3D 'marginnote'
  return {pandoc.Span(el.content), marginnote}
<= span style=3D"font-family: "Courier New";">end

Here's the reference block html in the references s= ection:
<div id=3D"ref-Am= azonSameDayPrime" class=3D"csl-entry" role=3D"doc-biblioentry">
<div class=3D"csl-left-margin">[1= ] </div><div class=3D"csl-right-inline">D. Ingold and S. Soper,= <span>=E2=80=9CAmazon doesn=E2=80=99t consider the race of its custo= mers. Should it?=E2=80=9D</span> <em>Bloomberg</em>, 2016= .</div>
</div>

I want the following in my marginnote
<span><a href=3D"#ref-= AmazonSameDayPrime">[1]</a></span>
<span class=3D"marginnote">
<span id=3D"ref-AmazonSameDayPrime" class=3D"csl-e= ntry" role=3D"doc-biblioentry">
<span class=3D"csl-left-margin">[1] </span><span class= =3D"csl-right-inline">D. Ingold and S. Soper, <span>=E2=80=9CAmazo= n doesn=E2=80=99t consider the race of its customers. Should it?=E2=80=9D&l= t;/span> <em>Bloomberg</em>, 2016.</span></span>= </span>
Note, I want to replace the divs= with spans, but just getting the divs for now would be progress.

At the moment all I get in my marginnote is
<span><a href=3D"#ref-= AmazonSameDayPrime">[1]</a></span><span class=3D"marginno= te"><a href=3D"#ref-AmazonSameDayPrime">[1]</a></span>=

I think William's idea i= s promising so will try that approach. Happy for other suggestions if they = come to mind.
On Friday, 20 August 2021 at 11:34:11 UTC-7 Leena Murgai wr= ote:
Hi Basti= en,

All good questions, thx.

As I= said I am converting from latex to html5, so no markdown to share.

Here's the reference block html in the references sec= tion:
<div id=3D"ref= -AmazonSameDayPrime" class=3D"csl-entry" role=3D"doc-bi= blioentry">
<div cla= ss=3D"csl-left-margin">[1] </div><div class=3D"c= sl-right-inline">D. Ingold and S. Soper, <span>=E2=80=9CAmazo= n doesn=E2=80=99t consider the race of its customers. Should it?=E2=80=9D&l= t;/span> <em>Bloomberg</em>, 2016.</div>
<= div></div>

I want the following in my marginnote
<span&g= t;<a href=3D"#ref-AmazonSameDayPrime">[1]</a></spa= n>
<span class=3D"marginnote">
<s= pan id=3D"ref-AmazonSameDayPrime" class=3D"csl-entry" r= ole=3D"doc-biblioentry">
<span class=3D"csl-= left-margin">[1] </span><span class=3D"csl-right-inli= ne">D. Ingold and S. Soper, <span>=E2=80=9CAmazon doesn=E2=80= =99t consider the race of its customers. Should it?=E2=80=9D</span> &= lt;em>Bloomberg</em>, 2016.</span></span></span>=

At the moment all I get in my marginn= ote is

<span><a href=3D"#= ref-AmazonSameDayPrime">[1]</a></span><span class=3D= "marginnote"><a href=3D"#ref-AmazonSameDayPrime"&= gt;[1]</a></span>
<= div dir=3D"auto" class=3D"gmail_attr">On Friday, 20 August 2021 at 11:09:54= UTC-7 Bastien Dumont wrote:
Sorry, but is very difficult to help you efficiently from incomplete= descriptions and screenshots. Could you please send the following?

* A very small Markdown chunk with only one citation;
* The corresponding HTML code with the desired output;
* The HTML code you actually get;
* Your CSL stylesheet (if other than the default one);
* The bibliography entry used in your example;
* Your filter.

Without that, nobody can guess what is going on.

Le Friday 20 August 2021 =C3=A0 10:41:07AM, Leena Murgai a =C3=A9crit :
> No problem William,
>=20
> in the example screenshots, the text I'm referring to is speci= fically
>=20
> D. Ingold and S. Soper, =E2=80=9CAmazon doesn=E2=80=99t consider t= he race of its customers.
> Should it?=E2=80=9D Bloomberg, 2016.
>=20
> I assume it's a list of inlines in the AST, possibly a block, = as I said I don't
> know where it's stored. I assumed in citations, as did you, bu= t I don't know
> how to access it. Anyway, I want that text to be in my marginnote = along side
> the (lonely looking) [1].
>=20
> Actually, I'm not interested in having the references at the e= nd at all, I'd
> rather just have the linked reference in marginnote.
> On Friday, 20 August 2021 at 10:31:57 UTC-7 William Lupton wrote:
>=20
> 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 informa= tion 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.
>=20
> On Fri, 20 Aug 2021 at 18:25, Leena Murgai <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>=20
> So I've attached some screenshots in case it helps. Yo= u can see that
> the marginnote contains only the [linked_item_number] of t= he citation,
> the rest is missing. Here's the filter I used:
>=20
> function Cite(el)
> =C2=A0 marginnote =3D pandoc.Span(el.content)
> =C2=A0 marginnote.classes[1] =3D 'marginnote'
> =C2=A0 return {pandoc.Span(el.content), marginnote}
> end
>=20
>=20
>=20
> On Friday, 20 August 2021 at 10:06:30 UTC-7 Leena Murgai w= rote:
>=20
> Hello again Bastien,
>=20
> I just tried your code, it does something similar to m= ine (but
> clearly you code is nicer :). It's missing the tex= t that makes up
> the citation block in the bibligraphy. To be clear I w= ant the whole
> block (or inline?) that appears in the bibliography in= my
> marginnote.
>=20
> Cheers!
>=20
> On Friday, 20 August 2021 at 10:00:56 UTC-7 Leena Murg= ai wrote:
>=20
> Thanks=C2=A0 William.
>=20
> These are the filters I'm using:
>=20
> 1. tex2html/filters/date.lua=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 # Replace date with
> today's date 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 # [1]ht= tps://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 processing #
> 5. pandoc-sidenote=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # [2]ht= tps://github.com
> /jez/pandoc-sidenote #
> 6. tex2html/filters/margincitations.lua # put cita= tions in
> marginnotes #
>=20
> Thanks Pedro.
>=20
> I'm already using pandoc-sidenote :). What I a= ctually want is a
> marginnote. If I turn them into footnotes before r= unning
> pandoc-sidenote, I end up with a sidenote rather t= han a
> marginnote which gets a superscript label. This is= n't what I
> want. I want to keep the [linked_item_number]=C2= =A0(provided by
> citeproc) and put that in the (unnumbered) marginn= ote (with the
> rest of the ). RawInline let's me do that. I j= ust can't access
> the text.
> On Friday, 20 August 2021 at 09:44:46 UTC-7 pedro....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> wrote:
>=20
> Jake Zimmerman=E2=80=99s pandoc-sidenote filte= r just takes every
> footnote as a whole and converts it to a siden= ote <span>.
> Unless you want separate streams for regular f= ootnotes and
> citation sidenotes, it might be useful: [3]htt= ps://
> git= hub.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/
> SideNote.hs
>=20
> Em sexta-feira, 20 de agosto de 2021 =C3=A0s 1= 7:37:55 UTC+1,
> William Lupton escreveu:
>=20
> Not sure if this helps, but here's a s= imple example
> showing a somewhat readable dump of the AS= T before and
> after citeproc. I think only cite.content = has changed.
> I suspect that your problem is something e= lse.
>=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: &qu= ot;RFC1149"
>=20
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 mode: &= quot;AuthorInText"
>=20
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 note_nu= m: 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 f= ound
>=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: &qu= ot;RFC1149"
>=20
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 mode: &= quot;AuthorInText"
>=20
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 note_nu= m: 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: S= trong {
>=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
> <p><span class=3D"citation&q= uot; data-cites=3D"RFC1149">
> (<strong>RFC1149?</strong>)<= ;/span></p>
>=20
>=20
> On Fri, 20 Aug 2021 at 17:14, Leena Murgai= <
> leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org= > wrote:
>=20
> I'm running it after citeproc sinc= e 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 wrote:
>=20
> Yeah, I tried looking there, I= couldn't
> find what I wanted. I'm su= re I'm missing
> something.
>=20
> The question is how to access = it? As in
> what's the code? For examp= le, each citation
> ([4]https://pandoc.org/lua-filters.html#
> type-citation) has the fields= =C2=A0id,=C2=A0mode,=C2=A0
> prefix,=C2=A0suffix,=C2=A0note= _num,=C2=A0hash. Which one
> contains the text I want? What= 's the code
> to get the list of inlines I w= ant
> (corresponding to the text in = the
> citation)?
> On Friday, 20 August 2021 at 0= 8:59:52 UTC-7
> William Lupton wrote:
>=20
> Do you mean the citations = themselves?
> These are in el.citations.= See=C2=A0[5]
> https://pandoc.org/lua-filters.html#
> type-cite and=C2=A0[6]https://pandoc.org/
> lua-filters.html#type-cita= tion.
>=20
> On Fri, 20 Aug 2021 at 16:= 36, Leena
> Murgai <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>=20
> So far I have the followin= g, which puts
> the [linked_item_number] i= n the passage
> and in the marginnote but = I'm missing
> the rest of the
> text_that_goes_in_the_bibl= iography.
>=20
> function Cite(el)
> =C2=A0 return {=C2=A0
> =C2=A0 =C2=A0=C2=A0pandoc.= Span(el.content),
> =C2=A0 =C2=A0 pandoc.RawIn= line('html5', ' <span
> class =3D "marginnote= ">'),
> =C2=A0 =C2=A0 pandoc.Span(= el.content),
> =C2=A0 =C2=A0 pandoc.RawIn= line('html5', ' </span>
> ')
> =C2=A0 =C2=A0 }
> end
>=20
> On Thursday, 19 August 202= 1 at 20:32:11
> UTC-7 Leena Murgai wrote:
>=20
> Hi there,
>=20
> I'm converting from La= TeX to HTML5. I'd
> like to put my citations i= n 'sidenote's
> rather than at the end of = the doc. In
> practice, this just means = I want the
> output html: to look like
>=20
> [linked_item_number] <s= pan class=3D
> marginnote>
> text_that_goes_in_the_bibl= iography</
> span>
>=20
> How do I access the elemen= t that goes
> into the citation, i.e.
> text_that_goes_in_the_bibl= iography?
>=20
> Any advice appreciated.
>=20
>=20
>=20
> --
> You received this message = because you
> are subscribed to the Goog= le Groups
> "pandoc-discuss"= group.
> To unsubscribe from this g= roup and stop
> receiving emails from it, = send an email
> to pan= doc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on= the web
> visit [7]https://groups.google.com/d/
> msgid/pandoc-discuss/
> eda3d7b4-befd-4f42-9455-8a= 37373d33a6n%40googlegroups.com
> .
>=20
> --
> You received this message because you = are
> subscribed to the Google Groups "= pandoc-discuss"
> group.
> To unsubscribe from this group and sto= p receiving
> emails from it, send an email to=20
> pandoc-discus...@g= ooglegroups.com.
>=20
> To view this discussion on the web vis= it [8]https:/
> /groups.google.com/d/msgid/pand= oc-discuss/
> 3106cf1d-5ae3-411f-b92a-c14153d58e49n%= 40googlegroups.com
> .
>=20
> --
> You received this message because you are subscribed to th= e Google
> Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails f= rom it, send
> an email to pandoc-discus...@googlegro= ups.com.
>=20
> To view this discussion on the web visit [9]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 email
> to [10]pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit [11]https://groups.google.com/d/msgid/
> pandoc-discuss/b548772c-269e-45c7-9ff6-9aec6014f024n%40googlegroups.com.
>=20
> References:
>=20
> [1] https://github.com/lierdakil/pandoc-crossref
> [2] = https://github.com/jez/pandoc-sidenote
> [3] https://github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/S= ideNote.hs
> [4] https://pandoc.org/lua-filters.html#type-citation
> [5]
https://pandoc.org/lua-filters.html#type-cite
> [6] https://pandoc.org/lua-filters.html#type-citation
> [7]
https= ://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9455-8a37373= d33a6n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter
> [8] https= ://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a-c14153d= 58e49n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter
> [9] https= ://groups.google.com/d/msgid/pandoc-discuss/eb59834b-d3e8-4dc4-9a66-0eb8c0f= 3e225n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter
> [10] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<= /a>
> [11]
http= s://groups.google.com/d/msgid/pandoc-discuss/b548772c-269e-45c7-9ff6-9aec60= 14f024n%40googlegroups.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/4c177bdf-f369-4e9b-bdc6-36e0e38cf496n%40googlegroups.= com.
------=_Part_1639_1337242293.1629485639809-- ------=_Part_1638_713886611.1629485639809--