From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/29083 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Pedro P. Palazzo" Newsgroups: gmane.text.pandoc Subject: Re: Help with a filter converting citations to sidenotes Date: Fri, 20 Aug 2021 09:44:46 -0700 (PDT) Message-ID: <0fd903f3-e52d-44bd-a1b2-50bccfc9b66cn@googlegroups.com> References: <0f2d14e3-a86e-4fa1-b98c-52f540fe82b9n@googlegroups.com> <93663960-bbfe-40a1-b3ba-25fefe58e7e0n@googlegroups.com> <3106cf1d-5ae3-411f-b92a-c14153d58e49n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_3238_1665576061.1629477886204" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11454"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDKN7FGN4YNRB75X76EAMGQECY2NQIY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Aug 20 18:44:49 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f55.google.com ([209.85.210.55]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mH7dR-0002mw-Br for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 20 Aug 2021 18:44:49 +0200 Original-Received: by mail-ot1-f55.google.com with SMTP id c88-20020a9d27e1000000b0051abe1bcbb9sf3627378otb.1 for ; Fri, 20 Aug 2021 09:44:49 -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=v7l+W0Ma4FZhn1tcSLBrlITKvowbNVlaup8zfjKsIF4=; b=YqFKMIM8mtRh27euf/dXYjWicLwZ9e3u9KeqTVob3JWZgfTaFcqsQqWBxFdPQpVSgX dUgM41VHDcNRS5ssIRjvJfcA/+SsYXr8sWIuHjnWDSMPB/jVkx7yJMpQJOQkPGpE7IKA BKz8nHPT9s0eJL9N5SbI/TxQtVIeL477pQ6zdYpEV+r0F19dsZFkWVl8QdTASUXXbzRw 4JyG3HhQyE2RkTYXQK4U+6Hv43Z+0nJnJDntPHvoJyqr7E/RyrSbhvG5rI3aGrkx4Dfq CfIUyw3zLFtWv5xN2cBuIeu20QrEeXqTiE2yLkgRgO/idQibiUOaOrADENvbGIMdDphO cQhA== 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=v7l+W0Ma4FZhn1tcSLBrlITKvowbNVlaup8zfjKsIF4=; b=pbEoXgiMwkOigTmlWqIyK0EKrExWUrnKH1PHxlUaaIXYUVVJL0akEpV407EShGO2pk mQZTbIdwlx5XiWMpe+K08ixTE/hYCXUVAVFbFwVPOXLaBWd7tRd4rSepPu02MnG1cOOD hnrNi12fjReZDSf/T+SLEOGMV0zktELgIf1dC3nXE4BWdf6IdCEVd40SRcyanc4Z6Dlm ttuQiBXqJIzVk8sD3BIVpA3fjLEKQCEaO0QlBRCciNxy1aRTZM0zPEeZ58S7A3y1pROQ X4Vv3pr34YRzleztriC2WyYCMohPbRRsoDvLL5HuoGZaXSO1i5YdxVev5xZKaPtmlOWH 1+sQ== 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=v7l+W0Ma4FZhn1tcSLBrlITKvowbNVlaup8zfjKsIF4=; b=PB51fd2Gb38CY2N+CvtL0M2J3zzjPpX3saeaHa8kyDKijIFhi4SOwVXuehfXcsqWSX c26Cq3wrwQNYlmgMc7Xi+S+YX+suLSRAIgJgyTpbsJ9NXgd1PIzYfnS0+3ghFWhHdy/I sosOFYqeB0JhzicXe6oV5pJGd6qw/NmuYNq39rQ/a5YJdcoJ+6zGufeuBn+W/kkhkrLi USKdpYZ6M7xvw5reDynI/vEq+N3dt6mavcARinOQWjAW3BHC/oaj2ULiPvIpJX0xTZpW soCpTn1x/gXZ9NwvD4RpO6pAa5RzY6NbnTjQkYZQQwjNyzea3gFbFI67d3PI3UICW9aU 8stA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM533WmQvrfZhuyW+GZQuUyiU9Vk5VwFS1S/VGUI9Ftrxz+lIsLhwN FeQzX4HYZs1moXAZzAKgcuE= X-Google-Smtp-Source: ABdhPJztQQw/NpsQJNLT9T6ZB4kkfv2OHBhj/+sG9REMpjt7YEZXgDKvZP0RwBeFTW2K1s3sh+TXNQ== X-Received: by 2002:aca:1b0d:: with SMTP id b13mr3542951oib.162.1629477888342; Fri, 20 Aug 2021 09:44:48 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6808:2186:: with SMTP id be6ls2509875oib.8.gmail; Fri, 20 Aug 2021 09:44:47 -0700 (PDT) X-Received: by 2002:a54:4804:: with SMTP id j4mr3650879oij.85.1629477886828; Fri, 20 Aug 2021 09:44:46 -0700 (PDT) In-Reply-To: X-Original-Sender: pedro.palazzo-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:29083 Archived-At: ------=_Part_3238_1665576061.1629477886204 Content-Type: multipart/alternative; boundary="----=_Part_3239_3688389.1629477886204" ------=_Part_3239_3688389.1629477886204 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Jake Zimmerman=E2=80=99s pandoc-sidenote filter just takes every footnote a= s a=20 whole and converts it to a sidenote . Unless you want separate=20 streams for regular footnotes and citation sidenotes, it might be useful:= =20 https://github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/SideNote= .hs Em sexta-feira, 20 de agosto de 2021 =C3=A0s 17:37:55 UTC+1, William Lupton= =20 escreveu: > Not sure if this helps, but here's a simple example showing a somewhat=20 > readable dump of the AST before and after citeproc. I think only=20 > cite.content has changed. I suspect that your problem is something else. > > *% *cat cite.md=20 > > @RFC1149 > > > *% *LUA_PATH=3D../?.lua pandoc -L rep.lua --citeproc -L rep.lua cite.md= =20 > > (#) 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= =20 >>>> I'm missing something. >>>> >>>> The question is how to access it? As in what's the code? For example,= =20 >>>> each citation (https://pandoc.org/lua-filters.html#type-citation) has= =20 >>>> the fields id, mode, prefix, suffix, note_num, hash. Which one=20 >>>> contains the text I want? What's the code to get the list of inlines I= want=20 >>>> (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= =20 >>>>> https://pandoc.org/lua-filters.html#type-cite and=20 >>>>> 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= =20 >>>>>> the passage and in the marginnote but I'm missing the rest of the=20 >>>>>> text_that_goes_in_the_bibliography. >>>>>> >>>>>> function Cite(el) >>>>>> return {=20 >>>>>> pandoc.Span(el.content), >>>>>> pandoc.RawInline('html5', ' '),=20 >>>>>> 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 citations in= =20 >>>>>>> 'sidenote's rather than at the end of the doc. In practice, this ju= st means=20 >>>>>>> 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.=20 >>>>>>> text_that_goes_in_the_bibliography? >>>>>>> >>>>>>> Any advice appreciated. >>>>>>> >>>>>>> >>>>>>> --=20 >>>>>> You received this message because you are subscribed to the Google= =20 >>>>>> Groups "pandoc-discuss" group. >>>>>> To unsubscribe from this group and stop receiving emails from it,=20 >>>>>> send an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>>> To view this discussion on the web visit=20 >>>>>> https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-= 9455-8a37373d33a6n%40googlegroups.com=20 >>>>>> >>>>>> . >>>>>> >>>>> --=20 >> You received this message because you are subscribed to the Google Group= s=20 >> "pandoc-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send a= n=20 >> email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> > To view this discussion on the web visit=20 >> https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a= -c14153d58e49n%40googlegroups.com=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/0fd903f3-e52d-44bd-a1b2-50bccfc9b66cn%40googlegroups.com. ------=_Part_3239_3688389.1629477886204 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Jake Zimmerman=E2=80=99s pandoc-sidenote filter just takes every footnote a= s a whole and converts it to a sidenote <span>. Unless you want separ= ate streams for regular footnotes and citation sidenotes, it might be usefu= l: https://github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/SideN= ote.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 ex= ample showing a somewhat readable dump of the AST before and after citeproc= . I think only cite.content has changed. I suspect that your problem is som= ething 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 running it after citeproc since I need the citation valu= es.

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? A= s in what's the code? For example, each citation (https://pando= c.org/lua-filters.html#type-citation) has the fields=C2=A0id,=C2=A0mode,=C2=A0prefix,=C2=A0suffix,=C2=A0note_num,=C2=A0hash. Which = one contains the text I want? What's the code to get the list of inline= s 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 themsel= ves? These are in el.citations. See=C2=A0https://pandoc.org/lua-filters.htm= l#type-cite and=C2=A0https://pandoc.org/lua-filters.html#type-c= itation.

On Fri, 20 Aug 2021 at 16:36, = Leena Murgai <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
<= /div>
So far I have the following, which puts the [linked_item_number] in the passage and in the marginnote b= ut I'm missing the rest of the text_that_goe= s_in_the_bibliography.

function Cite(el)
=C2=A0 = =C2=A0=C2=A0pand= oc.Span(el.content),
=C2=A0 =C2=A0 pandoc.RawInline('html5', ' <span class =3D &= quot;marginnote">'),
=C2=A0 =C2=A0 pandoc.Span(el.content),
=C2=A0 =C2=A0 pandoc.RawInline('html5', ' </span&= gt;')
=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 like to put my citations = in 'sidenote's rather than at the end of the doc. In practice, this= just means I want the output html: to look like

<= font face=3D"Courier New">[linked_item_number] <span class=3Dmarginnote&= gt;
text_that_goes_in_the_bibli= ography</span>

How do I access the el= ement that goes into the citation, i.e. text_tha= t_goes_in_the_bibliography?

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/eda3d7= b4-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...@googleg= roups.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://groups.google.com/d= /msgid/pandoc-discuss/0fd903f3-e52d-44bd-a1b2-50bccfc9b66cn%40googlegroups.= com.
------=_Part_3239_3688389.1629477886204-- ------=_Part_3238_1665576061.1629477886204--