public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Help with a filter converting citations to sidenotes
@ 2021-08-20  3:32 Leena Murgai
       [not found] ` <0f2d14e3-a86e-4fa1-b98c-52f540fe82b9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 26+ messages in thread
From: Leena Murgai @ 2021-08-20  3:32 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 819 bytes --]

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

[linked_item_number] <span class=marginnote>
text_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?

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-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/0f2d14e3-a86e-4fa1-b98c-52f540fe82b9n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 1348 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found] ` <0f2d14e3-a86e-4fa1-b98c-52f540fe82b9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-08-20 15:36   ` Leena Murgai
       [not found]     ` <eda3d7b4-befd-4f42-9455-8a37373d33a6n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2021-08-21 17:00   ` John MacFarlane
  1 sibling, 1 reply; 26+ messages in thread
From: Leena Murgai @ 2021-08-20 15:36 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1291 bytes --]

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', ' <span class = "marginnote">'), 
    pandoc.Span(el.content),
    pandoc.RawInline('html5', ' </span>')
    }
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
>
> [linked_item_number] <span class=marginnote>
> text_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?
>
> 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-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.

[-- Attachment #1.2: Type: text/html, Size: 2832 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]     ` <eda3d7b4-befd-4f42-9455-8a37373d33a6n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-08-20 15:59       ` William Lupton
       [not found]         ` <CAEe_xxgvt+VaEQHA52ARktgU5LtDc5CvSwGpGEmi7iB61r-KFQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 26+ messages in thread
From: William Lupton @ 2021-08-20 15:59 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 2188 bytes --]

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 <leenamurgai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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', ' <span class = "marginnote">'),
>     pandoc.Span(el.content),
>     pandoc.RawInline('html5', ' </span>')
>     }
> 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
>>
>> [linked_item_number] <span class=marginnote>
>> text_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?
>>
>> 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-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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
> <https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAEe_xxgvt%2BVaEQHA52ARktgU5LtDc5CvSwGpGEmi7iB61r-KFQ%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 4277 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]         ` <CAEe_xxgvt+VaEQHA52ARktgU5LtDc5CvSwGpGEmi7iB61r-KFQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2021-08-20 16:07           ` Leena Murgai
       [not found]             ` <a50c77e1-4112-43ba-bfb1-fc716a474be8n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 26+ messages in thread
From: Leena Murgai @ 2021-08-20 16:07 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2716 bytes --]

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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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', ' <span class = "marginnote">'), 
>>     pandoc.Span(el.content),
>>     pandoc.RawInline('html5', ' </span>')
>>     }
>> 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
>>>
>>> [linked_item_number] <span class=marginnote>
>>> text_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?
>>>
>>> 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-4f42-9455-8a37373d33a6n%40googlegroups.com 
>> <https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/a50c77e1-4112-43ba-bfb1-fc716a474be8n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 6183 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]             ` <a50c77e1-4112-43ba-bfb1-fc716a474be8n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-08-20 16:12               ` Leena Murgai
       [not found]                 ` <93663960-bbfe-40a1-b3ba-25fefe58e7e0n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 26+ messages in thread
From: Leena Murgai @ 2021-08-20 16:12 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2893 bytes --]

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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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', ' <span class = "marginnote">'), 
>>>     pandoc.Span(el.content),
>>>     pandoc.RawInline('html5', ' </span>')
>>>     }
>>> 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
>>>>
>>>> [linked_item_number] <span class=marginnote>
>>>> text_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?
>>>>
>>>> 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-4f42-9455-8a37373d33a6n%40googlegroups.com 
>>> <https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
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/93663960-bbfe-40a1-b3ba-25fefe58e7e0n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 6697 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]                 ` <93663960-bbfe-40a1-b3ba-25fefe58e7e0n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-08-20 16:14                   ` Leena Murgai
       [not found]                     ` <3106cf1d-5ae3-411f-b92a-c14153d58e49n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 26+ messages in thread
From: Leena Murgai @ 2021-08-20 16:14 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 3086 bytes --]

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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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', ' <span class = "marginnote">'), 
>>>>     pandoc.Span(el.content),
>>>>     pandoc.RawInline('html5', ' </span>')
>>>>     }
>>>> 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
>>>>>
>>>>> [linked_item_number] <span class=marginnote>
>>>>> text_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?
>>>>>
>>>>> 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-4f42-9455-8a37373d33a6n%40googlegroups.com 
>>>> <https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>

-- 
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/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 7035 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]                     ` <3106cf1d-5ae3-411f-b92a-c14153d58e49n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-08-20 16:37                       ` William Lupton
       [not found]                         ` <CAEe_xxjcvzan-To3UUApcszFJS1tAj2TC7NH2bTW38TykJstxg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 26+ messages in thread
From: William Lupton @ 2021-08-20 16:37 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 5044 bytes --]

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 changed. I suspect that your problem is something else.

*% *cat cite.md

@RFC1149


*% *LUA_PATH=../?.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: ")"

      }

    }

  }

}

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

On Fri, 20 Aug 2021 at 17:14, Leena Murgai <leenamurgai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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', ' <span class = "marginnote">'),
>>>>>     pandoc.Span(el.content),
>>>>>     pandoc.RawInline('html5', ' </span>')
>>>>>     }
>>>>> 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
>>>>>>
>>>>>> [linked_item_number] <span class=marginnote>
>>>>>> text_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?
>>>>>>
>>>>>> 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-4f42-9455-8a37373d33a6n%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
> 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/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAEe_xxjcvzan-To3UUApcszFJS1tAj2TC7NH2bTW38TykJstxg%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 21539 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]                         ` <CAEe_xxjcvzan-To3UUApcszFJS1tAj2TC7NH2bTW38TykJstxg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2021-08-20 16:41                           ` Leena Murgai
       [not found]                             ` <7b758cdd-70d7-4c86-b08a-de891ff10ca2n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2021-08-20 16:44                           ` Pedro P. Palazzo
  1 sibling, 1 reply; 26+ messages in thread
From: Leena Murgai @ 2021-08-20 16:41 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 5654 bytes --]

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.

Any other ideas?

On Friday, 20 August 2021 at 09:37:55 UTC-7 William Lupton wrote:

> 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 changed. I suspect that your problem is something else.
>
> *% *cat cite.md 
>
> @RFC1149
>
>
> *% *LUA_PATH=../?.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: ")"
>
>       }
>
>     }
>
>   }
>
> }
>
> <p><span class="citation" 
> data-cites="RFC1149">(<strong>RFC1149?</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 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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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', ' <span class = "marginnote">'), 
>>>>>>     pandoc.Span(el.content),
>>>>>>     pandoc.RawInline('html5', ' </span>')
>>>>>>     }
>>>>>> 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
>>>>>>>
>>>>>>> [linked_item_number] <span class=marginnote>
>>>>>>> text_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?
>>>>>>>
>>>>>>> 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-4f42-9455-8a37373d33a6n%40googlegroups.com 
>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> -- 
>> 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 
>> <https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/7b758cdd-70d7-4c86-b08a-de891ff10ca2n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 20261 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]                             ` <7b758cdd-70d7-4c86-b08a-de891ff10ca2n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-08-20 16:44                               ` William Lupton
  2021-08-20 16:59                               ` Bastien DUMONT
  1 sibling, 0 replies; 26+ messages in thread
From: William Lupton @ 2021-08-20 16:44 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 6608 bytes --]

Do you have a really simple example that shows the problem? Do you have
other filters?

On Fri, 20 Aug 2021 at 17:41, Leena Murgai <leenamurgai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> 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.
>
> Any other ideas?
>
> On Friday, 20 August 2021 at 09:37:55 UTC-7 William Lupton wrote:
>
>> 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 changed. I suspect that your problem is something else.
>>
>> *% *cat cite.md
>>
>> @RFC1149
>>
>>
>> *% *LUA_PATH=../?.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: ")"
>>
>>       }
>>
>>     }
>>
>>   }
>>
>> }
>>
>> <p><span class="citation"
>> data-cites="RFC1149">(<strong>RFC1149?</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 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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>>> 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', ' <span class = "marginnote">'),
>>>>>>>     pandoc.Span(el.content),
>>>>>>>     pandoc.RawInline('html5', ' </span>')
>>>>>>>     }
>>>>>>> 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
>>>>>>>>
>>>>>>>> [linked_item_number] <span class=marginnote>
>>>>>>>> text_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?
>>>>>>>>
>>>>>>>> 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-4f42-9455-8a37373d33a6n%40googlegroups.com
>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> --
>>> 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
>>> <https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> 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/7b758cdd-70d7-4c86-b08a-de891ff10ca2n%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/7b758cdd-70d7-4c86-b08a-de891ff10ca2n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAEe_xxjm-%2BzWrAMoUB5sQdWFW-%3DUZKHXe_qRh3jFwz%3D00cukkg%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 20260 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]                         ` <CAEe_xxjcvzan-To3UUApcszFJS1tAj2TC7NH2bTW38TykJstxg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2021-08-20 16:41                           ` Leena Murgai
@ 2021-08-20 16:44                           ` Pedro P. Palazzo
       [not found]                             ` <0fd903f3-e52d-44bd-a1b2-50bccfc9b66cn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  1 sibling, 1 reply; 26+ messages in thread
From: Pedro P. Palazzo @ 2021-08-20 16:44 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 5864 bytes --]

Jake Zimmerman’s pandoc-sidenote filter just takes every footnote as a 
whole and converts it to a sidenote <span>. Unless you want separate 
streams for regular footnotes and citation sidenotes, it might be useful: 
https://github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/SideNote.hs

Em sexta-feira, 20 de agosto de 2021 às 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 changed. I suspect that your problem is something else.
>
> *% *cat cite.md 
>
> @RFC1149
>
>
> *% *LUA_PATH=../?.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: ")"
>
>       }
>
>     }
>
>   }
>
> }
>
> <p><span class="citation" 
> data-cites="RFC1149">(<strong>RFC1149?</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 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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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', ' <span class = "marginnote">'), 
>>>>>>     pandoc.Span(el.content),
>>>>>>     pandoc.RawInline('html5', ' </span>')
>>>>>>     }
>>>>>> 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
>>>>>>>
>>>>>>> [linked_item_number] <span class=marginnote>
>>>>>>> text_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?
>>>>>>>
>>>>>>> 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-4f42-9455-8a37373d33a6n%40googlegroups.com 
>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> -- 
>> 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 
>> <https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/0fd903f3-e52d-44bd-a1b2-50bccfc9b66cn%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 20232 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]                             ` <7b758cdd-70d7-4c86-b08a-de891ff10ca2n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2021-08-20 16:44                               ` William Lupton
@ 2021-08-20 16:59                               ` Bastien DUMONT
  1 sibling, 0 replies; 26+ messages in thread
From: Bastien DUMONT @ 2021-08-20 16:59 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

If I've understood correctly what you want to achieve, you only need to construct one span:

```
function Cite(el)
  marginnote = pandoc.Span(el.content)
  marginnote.classes[1] = 'marginnote'
  return marginnote
end
```

Le Friday 20 August 2021 à 09:41:18AM, Leena Murgai a écrit :
> 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.
> 
> Any other ideas?
> 
> On Friday, 20 August 2021 at 09:37:55 UTC-7 William Lupton wrote:
> 
>     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 changed. I suspect that your problem is something else.
> 
> 
>     % cat cite.md 
> 
>     @RFC1149
> 
>    
>     % LUA_PATH=../?.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: ")"
> 
>           }
> 
>         }
> 
>       }
> 
>     }
> 
>     <p><span class="citation" data-cites="RFC1149">(<strong>RFC1149?</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 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 ([1]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 [2]https://pandoc.org/lua-filters.html#
>                     type-cite and [3]https://pandoc.org/lua-filters.html#
>                     type-citation.
> 
>                     On Fri, 20 Aug 2021 at 16:36, Leena Murgai <
>                     leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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', ' <span class =
>                         "marginnote">'),
>                             pandoc.Span(el.content),
>                             pandoc.RawInline('html5', ' </span>')
>                             }
>                         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
> 
>                             [linked_item_number] <span class=marginnote>
>                             text_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?
> 
>                             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 [4]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 "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 [5]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 [6]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit [7]https://groups.google.com/d/msgid/
> pandoc-discuss/7b758cdd-70d7-4c86-b08a-de891ff10ca2n%40googlegroups.com.
> 
> References:
> 
> [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-9455-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer
> [5] https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com?utm_medium=email&utm_source=footer
> [6] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [7] https://groups.google.com/d/msgid/pandoc-discuss/7b758cdd-70d7-4c86-b08a-de891ff10ca2n%40googlegroups.com?utm_medium=email&utm_source=footer

-- 
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/YR/faQH%2Bx47p5P9j%40localhost.


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]                             ` <0fd903f3-e52d-44bd-a1b2-50bccfc9b66cn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-08-20 17:00                               ` Leena Murgai
       [not found]                                 ` <206b26c5-32b2-408d-80f6-cf851c9c8cb9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 26+ messages in thread
From: Leena Murgai @ 2021-08-20 17:00 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 7236 bytes --]

Thanks  William.

These are the filters I'm using:

1. tex2html/filters/date.lua            # Replace date with today's date 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-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] (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’s pandoc-sidenote filter just takes every footnote as a 
> whole and converts it to a sidenote <span>. Unless you want separate 
> streams for regular footnotes and citation sidenotes, it might be useful: 
> https://github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/SideNote.hs
>
> Em sexta-feira, 20 de agosto de 2021 às 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 changed. I suspect that your problem is something else.
>>
>> *% *cat cite.md 
>>
>> @RFC1149
>>
>>
>> *% *LUA_PATH=../?.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: ")"
>>
>>       }
>>
>>     }
>>
>>   }
>>
>> }
>>
>> <p><span class="citation" 
>> data-cites="RFC1149">(<strong>RFC1149?</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 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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 
>>>>>> 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', ' <span class = "marginnote">'), 
>>>>>>>     pandoc.Span(el.content),
>>>>>>>     pandoc.RawInline('html5', ' </span>')
>>>>>>>     }
>>>>>>> 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
>>>>>>>>
>>>>>>>> [linked_item_number] <span class=marginnote>
>>>>>>>> text_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?
>>>>>>>>
>>>>>>>> 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-4f42-9455-8a37373d33a6n%40googlegroups.com 
>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> -- 
>>> 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 
>>> <https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
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/206b26c5-32b2-408d-80f6-cf851c9c8cb9n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 22670 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]                                 ` <206b26c5-32b2-408d-80f6-cf851c9c8cb9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-08-20 17:06                                   ` Leena Murgai
       [not found]                                     ` <7df79e6f-cb35-4ca5-8bc3-f089e3bc9199n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 26+ messages in thread
From: Leena Murgai @ 2021-08-20 17:06 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 7852 bytes --]

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 date 
> 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-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] (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’s pandoc-sidenote filter just takes every footnote as a 
>> whole and converts it to a sidenote <span>. Unless you want separate 
>> streams for regular footnotes and citation sidenotes, it might be useful: 
>> https://github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/SideNote.hs
>>
>> Em sexta-feira, 20 de agosto de 2021 às 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 changed. I suspect that your problem is something else.
>>>
>>> *% *cat cite.md 
>>>
>>> @RFC1149
>>>
>>>
>>> *% *LUA_PATH=../?.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: ")"
>>>
>>>       }
>>>
>>>     }
>>>
>>>   }
>>>
>>> }
>>>
>>> <p><span class="citation" 
>>> data-cites="RFC1149">(<strong>RFC1149?</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 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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 
>>>>>>> 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', ' <span class = "marginnote">'), 
>>>>>>>>     pandoc.Span(el.content),
>>>>>>>>     pandoc.RawInline('html5', ' </span>')
>>>>>>>>     }
>>>>>>>> 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
>>>>>>>>>
>>>>>>>>> [linked_item_number] <span class=marginnote>
>>>>>>>>> text_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?
>>>>>>>>>
>>>>>>>>> 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-4f42-9455-8a37373d33a6n%40googlegroups.com 
>>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>>
>>>>>>> -- 
>>>> 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 
>>>> <https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>

-- 
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/7df79e6f-cb35-4ca5-8bc3-f089e3bc9199n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 23721 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]                                     ` <7df79e6f-cb35-4ca5-8bc3-f089e3bc9199n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-08-20 17:25                                       ` Leena Murgai
       [not found]                                         ` <eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 26+ messages in thread
From: Leena Murgai @ 2021-08-20 17:25 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 8516 bytes --]

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 = pandoc.Span(el.content)
  marginnote.classes[1] = '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 date 
>> 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-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] (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’s pandoc-sidenote filter just takes every footnote as a 
>>> whole and converts it to a sidenote <span>. Unless you want separate 
>>> streams for regular footnotes and citation sidenotes, it might be useful: 
>>> https://github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/SideNote.hs
>>>
>>> Em sexta-feira, 20 de agosto de 2021 às 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 changed. I suspect that your problem is something else.
>>>>
>>>> *% *cat cite.md 
>>>>
>>>> @RFC1149
>>>>
>>>>
>>>> *% *LUA_PATH=../?.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: ")"
>>>>
>>>>       }
>>>>
>>>>     }
>>>>
>>>>   }
>>>>
>>>> }
>>>>
>>>> <p><span class="citation" 
>>>> data-cites="RFC1149">(<strong>RFC1149?</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 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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 
>>>>>>>> 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', ' <span class = "marginnote">'), 
>>>>>>>>>     pandoc.Span(el.content),
>>>>>>>>>     pandoc.RawInline('html5', ' </span>')
>>>>>>>>>     }
>>>>>>>>> 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
>>>>>>>>>>
>>>>>>>>>> [linked_item_number] <span class=marginnote>
>>>>>>>>>> text_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?
>>>>>>>>>>
>>>>>>>>>> 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-4f42-9455-8a37373d33a6n%40googlegroups.com 
>>>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>> .
>>>>>>>>>
>>>>>>>> -- 
>>>>> 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 
>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>

-- 
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.

[-- Attachment #1.2: Type: text/html, Size: 24670 bytes --]

[-- Attachment #2: marginnote.png --]
[-- Type: image/png, Size: 241275 bytes --]

[-- Attachment #3: BibliographyEntry.png --]
[-- Type: image/png, Size: 39377 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]                                         ` <eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-08-20 17:31                                           ` William Lupton
       [not found]                                             ` <CAEe_xxjLevSn7YgLpg4LTdmjD_duxwm+Z3qXEGM+zSuwHUT3fg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 26+ messages in thread
From: William Lupton @ 2021-08-20 17:31 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 9832 bytes --]

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 <leenamurgai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 = pandoc.Span(el.content)
>   marginnote.classes[1] = '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 date
>>> 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-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] (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’s pandoc-sidenote filter just takes every footnote as a
>>>> whole and converts it to a sidenote <span>. Unless you want separate
>>>> streams for regular footnotes and citation sidenotes, it might be useful:
>>>> https://github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/SideNote.hs
>>>>
>>>> Em sexta-feira, 20 de agosto de 2021 às 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 changed. I suspect that your problem is something else.
>>>>>
>>>>> *% *cat cite.md
>>>>>
>>>>> @RFC1149
>>>>>
>>>>>
>>>>> *% *LUA_PATH=../?.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: ")"
>>>>>
>>>>>       }
>>>>>
>>>>>     }
>>>>>
>>>>>   }
>>>>>
>>>>> }
>>>>>
>>>>> <p><span class="citation"
>>>>> data-cites="RFC1149">(<strong>RFC1149?</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 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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>>>>>> 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', ' <span class = "marginnote">'),
>>>>>>>>>>     pandoc.Span(el.content),
>>>>>>>>>>     pandoc.RawInline('html5', ' </span>')
>>>>>>>>>>     }
>>>>>>>>>> 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
>>>>>>>>>>>
>>>>>>>>>>> [linked_item_number] <span class=marginnote>
>>>>>>>>>>> text_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?
>>>>>>>>>>>
>>>>>>>>>>> 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-4f42-9455-8a37373d33a6n%40googlegroups.com
>>>>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>>> .
>>>>>>>>>>
>>>>>>>>> --
>>>>>> 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
>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> --
> 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
> <https://groups.google.com/d/msgid/pandoc-discuss/eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAEe_xxjLevSn7YgLpg4LTdmjD_duxwm%2BZ3qXEGM%2BzSuwHUT3fg%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 24415 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]                                             ` <CAEe_xxjLevSn7YgLpg4LTdmjD_duxwm+Z3qXEGM+zSuwHUT3fg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2021-08-20 17:38                                               ` William Lupton
  2021-08-20 17:41                                               ` Leena Murgai
  1 sibling, 0 replies; 26+ messages in thread
From: William Lupton @ 2021-08-20 17:38 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 11139 bytes --]

Just a thought, but perhaps also attach the HTML5 (or fragment thereof),
just in case some CSS magic is inadvertently hiding part of the citation.
The actual generated HTML (and the classes used) will I think be quite a
strong function of the corresponding CSL.

This might be completely the wrong tree (to bark up) but I am using a very
simple CSL style with display set to "left-margin" and it generates HTML
like this for each citation. As you can see, the citation number (which you
do see in your output) is in a separate div with a different CSS class.

<div id="ref-RFC2119" class="csl-entry" role="doc-biblioentry">

<div class="csl-left-margin">[3] </div><div class="csl-right-inline">RFC
2119, <em>Key words for use in RFCs to Indicate Requirement Levels</em>,
IETF, 1997, <a href="https://tools.ietf.org/html/rfc2119">
https://tools.ietf.org/html/rfc2119</a></div>

</div>

On Fri, 20 Aug 2021 at 18:31, William Lupton <wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org>
wrote:

> 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 <leenamurgai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 = pandoc.Span(el.content)
>>   marginnote.classes[1] = '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
>>>> date 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-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] (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’s pandoc-sidenote filter just takes every footnote as a
>>>>> whole and converts it to a sidenote <span>. Unless you want separate
>>>>> streams for regular footnotes and citation sidenotes, it might be useful:
>>>>> https://github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/SideNote.hs
>>>>>
>>>>> Em sexta-feira, 20 de agosto de 2021 às 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 changed. I suspect that your problem is something else.
>>>>>>
>>>>>> *% *cat cite.md
>>>>>>
>>>>>> @RFC1149
>>>>>>
>>>>>>
>>>>>> *% *LUA_PATH=../?.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: ")"
>>>>>>
>>>>>>       }
>>>>>>
>>>>>>     }
>>>>>>
>>>>>>   }
>>>>>>
>>>>>> }
>>>>>>
>>>>>> <p><span class="citation"
>>>>>> data-cites="RFC1149">(<strong>RFC1149?</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 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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>>>>>>> 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', ' <span class = "marginnote">'),
>>>>>>>>>>>     pandoc.Span(el.content),
>>>>>>>>>>>     pandoc.RawInline('html5', ' </span>')
>>>>>>>>>>>     }
>>>>>>>>>>> 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
>>>>>>>>>>>>
>>>>>>>>>>>> [linked_item_number] <span class=marginnote>
>>>>>>>>>>>> text_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?
>>>>>>>>>>>>
>>>>>>>>>>>> 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-4f42-9455-8a37373d33a6n%40googlegroups.com
>>>>>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>>>> .
>>>>>>>>>>>
>>>>>>>>>> --
>>>>>>> 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
>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> --
>> 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
>> <https://groups.google.com/d/msgid/pandoc-discuss/eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/CAEe_xxjOoNQ7FiafrgZn86y9P-%3DSVSDBeEjk%2B5gznNP9fa5uFg%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 26968 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]                                             ` <CAEe_xxjLevSn7YgLpg4LTdmjD_duxwm+Z3qXEGM+zSuwHUT3fg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2021-08-20 17:38                                               ` William Lupton
@ 2021-08-20 17:41                                               ` Leena Murgai
       [not found]                                                 ` <b548772c-269e-45c7-9ff6-9aec6014f024n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  1 sibling, 1 reply; 26+ messages in thread
From: Leena Murgai @ 2021-08-20 17:41 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 10838 bytes --]

No problem William,

in the example screenshots, the text I'm referring to is specifically

D. Ingold and S. Soper, “Amazon doesn’t consider the race of its customers. 
Should it?” *Bloomberg*, 2016.

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, but I 
don't know how to access it. Anyway, I want that text to be in my 
marginnote along side the (lonely looking) [1].

Actually, I'm not interested in having the references at the end 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:

> 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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 = pandoc.Span(el.content)
>>   marginnote.classes[1] = '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 
>>>> date 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-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] (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’s pandoc-sidenote filter just takes every footnote as a 
>>>>> whole and converts it to a sidenote <span>. Unless you want separate 
>>>>> streams for regular footnotes and citation sidenotes, it might be useful: 
>>>>> https://github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/SideNote.hs
>>>>>
>>>>> Em sexta-feira, 20 de agosto de 2021 às 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 changed. I suspect that your problem is something else.
>>>>>>
>>>>>> *% *cat cite.md 
>>>>>>
>>>>>> @RFC1149
>>>>>>
>>>>>>
>>>>>> *% *LUA_PATH=../?.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: ")"
>>>>>>
>>>>>>       }
>>>>>>
>>>>>>     }
>>>>>>
>>>>>>   }
>>>>>>
>>>>>> }
>>>>>>
>>>>>> <p><span class="citation" 
>>>>>> data-cites="RFC1149">(<strong>RFC1149?</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 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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 
>>>>>>>>>> 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', ' <span class = "marginnote">'), 
>>>>>>>>>>>     pandoc.Span(el.content),
>>>>>>>>>>>     pandoc.RawInline('html5', ' </span>')
>>>>>>>>>>>     }
>>>>>>>>>>> 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
>>>>>>>>>>>>
>>>>>>>>>>>> [linked_item_number] <span class=marginnote>
>>>>>>>>>>>> text_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?
>>>>>>>>>>>>
>>>>>>>>>>>> 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-4f42-9455-8a37373d33a6n%40googlegroups.com 
>>>>>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>>>> .
>>>>>>>>>>>
>>>>>>>>>> -- 
>>>>>>> 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 
>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> -- 
>> 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/eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n%40googlegroups.com 
>> <https://groups.google.com/d/msgid/pandoc-discuss/eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/b548772c-269e-45c7-9ff6-9aec6014f024n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 27656 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]                                                 ` <b548772c-269e-45c7-9ff6-9aec6014f024n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-08-20 17:49                                                   ` William Lupton
       [not found]                                                     ` <CAEe_xxggM6-5=pTkMVxFFZSht75Sr=R_iQ8kXpq9nX+2kfKh8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2021-08-20 18:08                                                   ` Bastien DUMONT
  1 sibling, 1 reply; 26+ messages in thread
From: William Lupton @ 2021-08-20 17:49 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 12074 bytes --]

Oh this triggered a thought. The _rendered_ references are associated with
a div with id 'refs'. See
https://pandoc.org/MANUAL.html#placement-of-the-bibliography. Is that's
what going on here?

If so, I feel pretty silly, because I have a filter that processes this
output!

On Fri, 20 Aug 2021 at 18:41, Leena Murgai <leenamurgai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> No problem William,
>
> in the example screenshots, the text I'm referring to is specifically
>
> D. Ingold and S. Soper, “Amazon doesn’t consider the race of its
> customers. Should it?” *Bloomberg*, 2016.
>
> 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, but I
> don't know how to access it. Anyway, I want that text to be in my
> marginnote along side the (lonely looking) [1].
>
> Actually, I'm not interested in having the references at the end 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:
>
>> 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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 = pandoc.Span(el.content)
>>>   marginnote.classes[1] = '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
>>>>> date 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-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] (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’s pandoc-sidenote filter just takes every footnote as
>>>>>> a whole and converts it to a sidenote <span>. Unless you want separate
>>>>>> streams for regular footnotes and citation sidenotes, it might be useful:
>>>>>> https://github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/SideNote.hs
>>>>>>
>>>>>> Em sexta-feira, 20 de agosto de 2021 às 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 changed. I suspect that your problem is something else.
>>>>>>>
>>>>>>> *% *cat cite.md
>>>>>>>
>>>>>>> @RFC1149
>>>>>>>
>>>>>>>
>>>>>>> *% *LUA_PATH=../?.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: ")"
>>>>>>>
>>>>>>>       }
>>>>>>>
>>>>>>>     }
>>>>>>>
>>>>>>>   }
>>>>>>>
>>>>>>> }
>>>>>>>
>>>>>>> <p><span class="citation"
>>>>>>> data-cites="RFC1149">(<strong>RFC1149?</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 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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>>>>>>>> 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', ' <span class = "marginnote">'),
>>>>>>>>>>>>     pandoc.Span(el.content),
>>>>>>>>>>>>     pandoc.RawInline('html5', ' </span>')
>>>>>>>>>>>>     }
>>>>>>>>>>>> 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
>>>>>>>>>>>>>
>>>>>>>>>>>>> [linked_item_number] <span class=marginnote>
>>>>>>>>>>>>> text_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?
>>>>>>>>>>>>>
>>>>>>>>>>>>> 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-4f42-9455-8a37373d33a6n%40googlegroups.com
>>>>>>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>>>>> .
>>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>> 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
>>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>>
>>>>>>> --
>>> 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/eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/pandoc-discuss/eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> 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/b548772c-269e-45c7-9ff6-9aec6014f024n%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/b548772c-269e-45c7-9ff6-9aec6014f024n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAEe_xxggM6-5%3DpTkMVxFFZSht75Sr%3DR_iQ8kXpq9nX%2B2kfKh8w%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 27070 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]                                                     ` <CAEe_xxggM6-5=pTkMVxFFZSht75Sr=R_iQ8kXpq9nX+2kfKh8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2021-08-20 18:06                                                       ` Leena Murgai
       [not found]                                                         ` <8d4c4320-4a85-4363-8789-8bebcd21d329n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 26+ messages in thread
From: Leena Murgai @ 2021-08-20 18:06 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 12674 bytes --]

Interesting, so does this mean that what I want is the last element of a 
pandoc.Div with the identifier refs? How do I access that?

On Friday, 20 August 2021 at 10:49:36 UTC-7 William Lupton wrote:

> Oh this triggered a thought. The _rendered_ references are associated with 
> a div with id 'refs'. See 
> https://pandoc.org/MANUAL.html#placement-of-the-bibliography. Is that's 
> what going on here?
>
> If so, I feel pretty silly, because I have a filter that processes this 
> output!
>
> On Fri, 20 Aug 2021 at 18:41, Leena Murgai <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>> No problem William,
>>
>> in the example screenshots, the text I'm referring to is specifically
>>
>> D. Ingold and S. Soper, “Amazon doesn’t consider the race of its 
>> customers. Should it?” *Bloomberg*, 2016.
>>
>> 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, but I 
>> don't know how to access it. Anyway, I want that text to be in my 
>> marginnote along side the (lonely looking) [1].
>>
>> Actually, I'm not interested in having the references at the end 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:
>>
>>> 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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 = pandoc.Span(el.content)
>>>>   marginnote.classes[1] = '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 
>>>>>> date 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-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] (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’s pandoc-sidenote filter just takes every footnote as 
>>>>>>> a whole and converts it to a sidenote <span>. Unless you want separate 
>>>>>>> streams for regular footnotes and citation sidenotes, it might be useful: 
>>>>>>> https://github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/SideNote.hs
>>>>>>>
>>>>>>> Em sexta-feira, 20 de agosto de 2021 às 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 changed. I suspect that your problem is something else.
>>>>>>>>
>>>>>>>> *% *cat cite.md 
>>>>>>>>
>>>>>>>> @RFC1149
>>>>>>>>
>>>>>>>>
>>>>>>>> *% *LUA_PATH=../?.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: ")"
>>>>>>>>
>>>>>>>>       }
>>>>>>>>
>>>>>>>>     }
>>>>>>>>
>>>>>>>>   }
>>>>>>>>
>>>>>>>> }
>>>>>>>>
>>>>>>>> <p><span class="citation" 
>>>>>>>> data-cites="RFC1149">(<strong>RFC1149?</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 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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 
>>>>>>>>>>>> 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', ' <span class = "marginnote">'), 
>>>>>>>>>>>>>     pandoc.Span(el.content),
>>>>>>>>>>>>>     pandoc.RawInline('html5', ' </span>')
>>>>>>>>>>>>>     }
>>>>>>>>>>>>> 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
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> [linked_item_number] <span class=marginnote>
>>>>>>>>>>>>>> text_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?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> 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-4f42-9455-8a37373d33a6n%40googlegroups.com 
>>>>>>>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>>>>>> .
>>>>>>>>>>>>>
>>>>>>>>>>>> -- 
>>>>>>>>> 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 
>>>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>> .
>>>>>>>>>
>>>>>>>> -- 
>>>> 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/eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n%40googlegroups.com 
>>>> <https://groups.google.com/d/msgid/pandoc-discuss/eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> 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/b548772c-269e-45c7-9ff6-9aec6014f024n%40googlegroups.com 
>> <https://groups.google.com/d/msgid/pandoc-discuss/b548772c-269e-45c7-9ff6-9aec6014f024n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/8d4c4320-4a85-4363-8789-8bebcd21d329n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 30227 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]                                                 ` <b548772c-269e-45c7-9ff6-9aec6014f024n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2021-08-20 17:49                                                   ` William Lupton
@ 2021-08-20 18:08                                                   ` Bastien DUMONT
  2021-08-20 18:34                                                     ` Leena Murgai
  1 sibling, 1 reply; 26+ messages in thread
From: Bastien DUMONT @ 2021-08-20 18:08 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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 à 10:41:07AM, Leena Murgai a écrit :
> No problem William,
> 
> in the example screenshots, the text I'm referring to is specifically
> 
> D. Ingold and S. Soper, “Amazon doesn’t consider the race of its customers.
> Should it?” Bloomberg, 2016.
> 
> 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, but I don't know
> how to access it. Anyway, I want that text to be in my marginnote along side
> the (lonely looking) [1].
> 
> Actually, I'm not interested in having the references at the end 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:
> 
>     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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 = pandoc.Span(el.content)
>           marginnote.classes[1] = '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 date if it's empty above #
>                 2. tex2html/filters/texref.lua          # Cleanup pandoc and
>                 pandoc-crossref conflicts #
>                 3. pandoc-crossref                      # [1]https://github.com
>                 /lierdakil/pandoc-crossref #
>                 4. citeproc                             # If you need control
>                 over when the citeproc processing #
>                 5. pandoc-sidenote                      # [2]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-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] (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....@gmail.com
>                 wrote:
> 
>                     Jake Zimmerman’s pandoc-sidenote filter just takes every
>                     footnote as a whole and converts it to a sidenote <span>.
>                     Unless you want separate streams for regular footnotes and
>                     citation sidenotes, it might be useful: [3]https://
>                     github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/
>                     SideNote.hs
> 
>                     Em sexta-feira, 20 de agosto de 2021 às 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 changed.
>                         I suspect that your problem is something else.
> 
> 
>                         % cat cite.md 
> 
>                         @RFC1149
> 
>                        
>                         % LUA_PATH=../?.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: ")"
> 
>                               }
> 
>                             }
> 
>                           }
> 
>                         }
> 
>                         <p><span class="citation" data-cites="RFC1149">
>                         (<strong>RFC1149?</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 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
>                                     ([4]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 [5]
>                                         https://pandoc.org/lua-filters.html#
>                                         type-cite and [6]https://pandoc.org/
>                                         lua-filters.html#type-citation.
> 
>                                         On Fri, 20 Aug 2021 at 16:36, Leena
>                                         Murgai <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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', ' <span
>                                         class = "marginnote">'),
>                                             pandoc.Span(el.content),
>                                             pandoc.RawInline('html5', ' </span>
>                                         ')
>                                             }
>                                         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
> 
>                                         [linked_item_number] <span class=
>                                         marginnote>
>                                         text_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?
> 
>                                         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...@googlegroups.com.
>                                         To view this discussion on the web
>                                         visit [7]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 "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 [8]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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> 
>         To view this discussion on the web visit [9]https://groups.google.com/d
>         /msgid/pandoc-discuss/
>         eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n%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 [10]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
> 
> References:
> 
> [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/SideNote.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-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer
> [8] https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com?utm_medium=email&utm_source=footer
> [9] https://groups.google.com/d/msgid/pandoc-discuss/eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n%40googlegroups.com?utm_medium=email&utm_source=footer
> [10] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [11] https://groups.google.com/d/msgid/pandoc-discuss/b548772c-269e-45c7-9ff6-9aec6014f024n%40googlegroups.com?utm_medium=email&utm_source=footer

-- 
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/YR/vtYalEmX%2BJjo6%40localhost.


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
  2021-08-20 18:08                                                   ` Bastien DUMONT
@ 2021-08-20 18:34                                                     ` Leena Murgai
       [not found]                                                       ` <5866a845-e0bd-48b1-835d-189e40ef94f5n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 26+ messages in thread
From: Leena Murgai @ 2021-08-20 18:34 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 13131 bytes --]

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:
<div id="ref-AmazonSameDayPrime" class="csl-entry" role="doc-biblioentry">
<div class="csl-left-margin">[1] </div><div class="csl-right-inline">D. 
Ingold and S. Soper, <span>“Amazon doesn’t consider the race of its 
customers. Should it?”</span> <em>Bloomberg</em>, 2016.</div>
</div>

I want the following in my marginnote
<span><a href="#ref-AmazonSameDayPrime">[1]</a></span>
<span class="marginnote">
<span id="ref-AmazonSameDayPrime" class="csl-entry" role="doc-biblioentry">
<span class="csl-left-margin">[1] </span><span class="csl-right-inline">D. 
Ingold and S. Soper, <span>“Amazon doesn’t consider the race of its 
customers. Should it?”</span> <em>Bloomberg</em>, 2016.</span></span></span>

At the moment all I get in my marginnote is

<span><a href="#ref-AmazonSameDayPrime">[1]</a></span><span 
class="marginnote"><a href="#ref-AmazonSameDayPrime">[1]</a></span>
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 à 10:41:07AM, Leena Murgai a écrit :
> > No problem William,
> > 
> > in the example screenshots, the text I'm referring to is specifically
> > 
> > D. Ingold and S. Soper, “Amazon doesn’t consider the race of its 
> customers.
> > Should it?” Bloomberg, 2016.
> > 
> > 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, but I don't 
> know
> > how to access it. Anyway, I want that text to be in my marginnote along 
> side
> > the (lonely looking) [1].
> > 
> > Actually, I'm not interested in having the references at the end 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:
> > 
> > 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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 = pandoc.Span(el.content)
> >   marginnote.classes[1] = '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 date if it's empty above #
> > 2. tex2html/filters/texref.lua          # Cleanup pandoc and
> > pandoc-crossref conflicts #
> > 3. pandoc-crossref                      # [1]https://github.com
> > /lierdakil/pandoc-crossref #
> > 4. citeproc                             # If you need control
> > over when the citeproc processing #
> > 5. pandoc-sidenote                      # [2]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-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] (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’s pandoc-sidenote filter just takes every
> > footnote as a whole and converts it to a sidenote <span>.
> > Unless you want separate streams for regular footnotes and
> > citation sidenotes, it might be useful: [3]https://
> > github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/
> > SideNote.hs
> > 
> > Em sexta-feira, 20 de agosto de 2021 às 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 changed.
> > I suspect that your problem is something else.
> > 
> > 
> > % cat cite.md 
> > 
> > @RFC1149
> > 
> > 
> > % LUA_PATH=../?.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: ")"
> > 
> >       }
> > 
> >     }
> > 
> >   }
> > 
> > }
> > 
> > <p><span class="citation" data-cites="RFC1149">
> > (<strong>RFC1149?</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 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
> > ([4]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 [5]
> > https://pandoc.org/lua-filters.html#
> > type-cite and [6]https://pandoc.org/
> > lua-filters.html#type-citation.
> > 
> > On Fri, 20 Aug 2021 at 16:36, Leena
> > Murgai <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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', ' <span
> > class = "marginnote">'),
> >     pandoc.Span(el.content),
> >     pandoc.RawInline('html5', ' </span>
> > ')
> >     }
> > 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
> > 
> > [linked_item_number] <span class=
> > marginnote>
> > text_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?
> > 
> > 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 [7]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 "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 [8]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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > 
> > To view this discussion on the web visit [9]https://groups.google.com/d
> > /msgid/pandoc-discuss/
> > eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n%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 [10]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
> > 
> > References:
> > 
> > [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/SideNote.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-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer
> > [8] 
> https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com?utm_medium=email&utm_source=footer
> > [9] 
> https://groups.google.com/d/msgid/pandoc-discuss/eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n%40googlegroups.com?utm_medium=email&utm_source=footer
> > [10] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > [11] 
> https://groups.google.com/d/msgid/pandoc-discuss/b548772c-269e-45c7-9ff6-9aec6014f024n%40googlegroups.com?utm_medium=email&utm_source=footer
>
>

-- 
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/5866a845-e0bd-48b1-835d-189e40ef94f5n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 29420 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]                                                         ` <8d4c4320-4a85-4363-8789-8bebcd21d329n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-08-20 18:37                                                           ` William Lupton
  0 siblings, 0 replies; 26+ messages in thread
From: William Lupton @ 2021-08-20 18:37 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 13778 bytes --]

Just filter divs and look for this id. Check the docs though, because there
are some caveats.  Not sure about the "last element" bit.

On Fri, 20 Aug 2021, 19:06 Leena Murgai, <leenamurgai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> Interesting, so does this mean that what I want is the last element of a
> pandoc.Div with the identifier refs? How do I access that?
>
> On Friday, 20 August 2021 at 10:49:36 UTC-7 William Lupton wrote:
>
>> Oh this triggered a thought. The _rendered_ references are associated
>> with a div with id 'refs'. See
>> https://pandoc.org/MANUAL.html#placement-of-the-bibliography. Is that's
>> what going on here?
>>
>> If so, I feel pretty silly, because I have a filter that processes this
>> output!
>>
>> On Fri, 20 Aug 2021 at 18:41, Leena Murgai <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>
>>> No problem William,
>>>
>>> in the example screenshots, the text I'm referring to is specifically
>>>
>>> D. Ingold and S. Soper, “Amazon doesn’t consider the race of its
>>> customers. Should it?” *Bloomberg*, 2016.
>>>
>>> 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, but I
>>> don't know how to access it. Anyway, I want that text to be in my
>>> marginnote along side the (lonely looking) [1].
>>>
>>> Actually, I'm not interested in having the references at the end 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:
>>>
>>>> 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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 = pandoc.Span(el.content)
>>>>>   marginnote.classes[1] = '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
>>>>>>> date 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-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] (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’s pandoc-sidenote filter just takes every footnote
>>>>>>>> as a whole and converts it to a sidenote <span>. Unless you want separate
>>>>>>>> streams for regular footnotes and citation sidenotes, it might be useful:
>>>>>>>> https://github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/SideNote.hs
>>>>>>>>
>>>>>>>> Em sexta-feira, 20 de agosto de 2021 às 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 changed. I suspect that your problem is something else.
>>>>>>>>>
>>>>>>>>> *% *cat cite.md
>>>>>>>>>
>>>>>>>>> @RFC1149
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> *% *LUA_PATH=../?.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: ")"
>>>>>>>>>
>>>>>>>>>       }
>>>>>>>>>
>>>>>>>>>     }
>>>>>>>>>
>>>>>>>>>   }
>>>>>>>>>
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> <p><span class="citation"
>>>>>>>>> data-cites="RFC1149">(<strong>RFC1149?</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 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 <leena...-Re5JQEeQqe8@public.gmane.orgm>
>>>>>>>>>>>>> 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', ' <span class =
>>>>>>>>>>>>>> "marginnote">'),
>>>>>>>>>>>>>>     pandoc.Span(el.content),
>>>>>>>>>>>>>>     pandoc.RawInline('html5', ' </span>')
>>>>>>>>>>>>>>     }
>>>>>>>>>>>>>> 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
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> [linked_item_number] <span class=marginnote>
>>>>>>>>>>>>>>> text_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?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> 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-4f42-9455-8a37373d33a6n%40googlegroups.com
>>>>>>>>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>>>>>>> .
>>>>>>>>>>>>>>
>>>>>>>>>>>>> --
>>>>>>>>>> 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
>>>>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>>> .
>>>>>>>>>>
>>>>>>>>> --
>>>>> 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/eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>> 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/b548772c-269e-45c7-9ff6-9aec6014f024n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/pandoc-discuss/b548772c-269e-45c7-9ff6-9aec6014f024n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> 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/8d4c4320-4a85-4363-8789-8bebcd21d329n%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/8d4c4320-4a85-4363-8789-8bebcd21d329n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAEe_xxhvRuUNtQNGP0ozaUAN3OoJvz1z6ijTBKyXd3M5Yv4Z1w%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 29162 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]                                                       ` <5866a845-e0bd-48b1-835d-189e40ef94f5n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-08-20 18:53                                                         ` Leena Murgai
       [not found]                                                           ` <4c177bdf-f369-4e9b-bdc6-36e0e38cf496n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 26+ messages in thread
From: Leena Murgai @ 2021-08-20 18:53 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 15476 bytes --]

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 = pandoc.Span(el.content)
  marginnote.classes[1] = 'marginnote'
  return {pandoc.Span(el.content), marginnote}
end

Here's the reference block html in the references section:
<div id="ref-AmazonSameDayPrime" class="csl-entry" role="doc-biblioentry">
<div class="csl-left-margin">[1] </div><div class="csl-right-inline">D. 
Ingold and S. Soper, <span>“Amazon doesn’t consider the race of its 
customers. Should it?”</span> <em>Bloomberg</em>, 2016.</div>
</div>

I want the following in my marginnote
<span><a href="#ref-AmazonSameDayPrime">[1]</a></span>
<span class="marginnote">
<span id="ref-AmazonSameDayPrime" class="csl-entry" role="doc-biblioentry">
<span class="csl-left-margin">[1] </span><span class="csl-right-inline">D. 
Ingold and S. Soper, <span>“Amazon doesn’t consider the race of its 
customers. Should it?”</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="#ref-AmazonSameDayPrime">[1]</a></span><span 
class="marginnote"><a href="#ref-AmazonSameDayPrime">[1]</a></span>

I think William's idea is 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 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:
> <div id="ref-AmazonSameDayPrime" class="csl-entry" role="doc-biblioentry">
> <div class="csl-left-margin">[1] </div><div class="csl-right-inline">D. 
> Ingold and S. Soper, <span>“Amazon doesn’t consider the race of its 
> customers. Should it?”</span> <em>Bloomberg</em>, 2016.</div>
> </div>
>
> I want the following in my marginnote
> <span><a href="#ref-AmazonSameDayPrime">[1]</a></span>
> <span class="marginnote">
> <span id="ref-AmazonSameDayPrime" class="csl-entry" role="doc-biblioentry">
> <span class="csl-left-margin">[1] </span><span class="csl-right-inline">D. 
> Ingold and S. Soper, <span>“Amazon doesn’t consider the race of its 
> customers. Should it?”</span> <em>Bloomberg</em>, 2016.</span></span></span>
>
> At the moment all I get in my marginnote is
>
> <span><a href="#ref-AmazonSameDayPrime">[1]</a></span><span 
> class="marginnote"><a href="#ref-AmazonSameDayPrime">[1]</a></span>
> 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 à 10:41:07AM, Leena Murgai a écrit : 
>> > No problem William, 
>> > 
>> > in the example screenshots, the text I'm referring to is specifically 
>> > 
>> > D. Ingold and S. Soper, “Amazon doesn’t consider the race of its 
>> customers. 
>> > Should it?” Bloomberg, 2016. 
>> > 
>> > 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, but I don't 
>> know 
>> > how to access it. Anyway, I want that text to be in my marginnote along 
>> side 
>> > the (lonely looking) [1]. 
>> > 
>> > Actually, I'm not interested in having the references at the end 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: 
>> > 
>> > 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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 = pandoc.Span(el.content) 
>> >   marginnote.classes[1] = '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 date if it's empty above # 
>> > 2. tex2html/filters/texref.lua          # Cleanup pandoc and 
>> > pandoc-crossref conflicts # 
>> > 3. pandoc-crossref                      # [1]https://github.com 
>> > /lierdakil/pandoc-crossref # 
>> > 4. citeproc                             # If you need control 
>> > over when the citeproc processing # 
>> > 5. pandoc-sidenote                      # [2]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-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] (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’s pandoc-sidenote filter just takes every 
>> > footnote as a whole and converts it to a sidenote <span>. 
>> > Unless you want separate streams for regular footnotes and 
>> > citation sidenotes, it might be useful: [3]https:// 
>> > github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/ 
>> > SideNote.hs 
>> > 
>> > Em sexta-feira, 20 de agosto de 2021 às 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 changed. 
>> > I suspect that your problem is something else. 
>> > 
>> > 
>> > % cat cite.md  
>> > 
>> > @RFC1149 
>> > 
>> > 
>> > % LUA_PATH=../?.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: ")" 
>> > 
>> >       } 
>> > 
>> >     } 
>> > 
>> >   } 
>> > 
>> > } 
>> > 
>> > <p><span class="citation" data-cites="RFC1149"> 
>> > (<strong>RFC1149?</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 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 
>> > ([4]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 [5] 
>> > https://pandoc.org/lua-filters.html# 
>> > type-cite and [6]https://pandoc.org/ 
>> > lua-filters.html#type-citation. 
>> > 
>> > On Fri, 20 Aug 2021 at 16:36, Leena 
>> > Murgai <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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', ' <span 
>> > class = "marginnote">'), 
>> >     pandoc.Span(el.content), 
>> >     pandoc.RawInline('html5', ' </span> 
>> > ') 
>> >     } 
>> > 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 
>> > 
>> > [linked_item_number] <span class= 
>> > marginnote> 
>> > text_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? 
>> > 
>> > 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 [7]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 "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 [8]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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 
>> > 
>> > To view this discussion on the web visit [9]https://groups.google.com/d 
>> > /msgid/pandoc-discuss/ 
>> > eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n%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 [10]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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. 
>>
>> > 
>> > References: 
>> > 
>> > [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/SideNote.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-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer 
>> > [8] 
>> https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com?utm_medium=email&utm_source=footer 
>> > [9] 
>> https://groups.google.com/d/msgid/pandoc-discuss/eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n%40googlegroups.com?utm_medium=email&utm_source=footer 
>> > [10] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
>> > [11] 
>> https://groups.google.com/d/msgid/pandoc-discuss/b548772c-269e-45c7-9ff6-9aec6014f024n%40googlegroups.com?utm_medium=email&utm_source=footer 
>>
>>

-- 
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/4c177bdf-f369-4e9b-bdc6-36e0e38cf496n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 32236 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]                                                           ` <4c177bdf-f369-4e9b-bdc6-36e0e38cf496n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-08-21  8:33                                                             ` William Lupton
  0 siblings, 0 replies; 26+ messages in thread
From: William Lupton @ 2021-08-21  8:33 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 18092 bytes --]

A few thoughts on this:

   1. It seems that you want the full details of the reference as part of
   the citation. Is that correct?
   2. I think that pulling the information out of the refs div should work,
   but might not be the optimal approach
   3. I suspect that a better approach may be to adjust the citation style
   so the citation itself (currently just the citation number in square
   brackets) contains the desired information (post-citeproc filters should
   then see this in cite.content)
   4. If you pull all the desired information into the citations then you
   may want just to set suppress-bibliography=true to suppress the bibliography

I created a very simple CSL style that meets our needs. This specifies the
citation:

  <citation>

    <layout delimiter="; ">

      <text variable="title-short" suffix=" "/>

      <group prefix="[" suffix="]">

        <text variable="locator" suffix="/"/>

        <text variable="citation-number"/>

      </group>

    </layout>

  </citation>

and this specifies the bibliography (references):

  <bibliography entry-spacing="0">

    <sort>

      <key variable="citation-number"/>

    </sort>

    <layout>

      <text variable="citation-number" prefix="[" suffix="]"

            display="left-margin"/>

      <group delimiter=", " display="right-inline">

        <text variable="call-number"/>

        <text variable="title" font-style="italic"/>

        <text variable="publisher"/>

        <date date-parts="year" form="text" variable="issued"/>

        <text variable="URL"/>

      </group>

    </layout>

  </bibliography>

I _think_ you could adjust the <citation> layout to include the information
that you need, formatted as you want it.

On Fri, 20 Aug 2021 at 19:54, Leena Murgai <leenamurgai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> 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 = pandoc.Span(el.content)
>   marginnote.classes[1] = 'marginnote'
>   return {pandoc.Span(el.content), marginnote}
> end
>
> Here's the reference block html in the references section:
> <div id="ref-AmazonSameDayPrime" class="csl-entry" role="doc-biblioentry">
> <div class="csl-left-margin">[1] </div><div class="csl-right-inline">D.
> Ingold and S. Soper, <span>“Amazon doesn’t consider the race of its
> customers. Should it?”</span> <em>Bloomberg</em>, 2016.</div>
> </div>
>
> I want the following in my marginnote
> <span><a href="#ref-AmazonSameDayPrime">[1]</a></span>
> <span class="marginnote">
> <span id="ref-AmazonSameDayPrime" class="csl-entry" role="doc-biblioentry">
> <span class="csl-left-margin">[1] </span><span class="csl-right-inline">D.
> Ingold and S. Soper, <span>“Amazon doesn’t consider the race of its
> customers. Should it?”</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="#ref-AmazonSameDayPrime">[1]</a></span><span
> class="marginnote"><a href="#ref-AmazonSameDayPrime">[1]</a></span>
>
> I think William's idea is 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 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:
>> <div id="ref-AmazonSameDayPrime" class="csl-entry" role="doc-biblioentry">
>> <div class="csl-left-margin">[1] </div><div class="csl-right-inline">D.
>> Ingold and S. Soper, <span>“Amazon doesn’t consider the race of its
>> customers. Should it?”</span> <em>Bloomberg</em>, 2016.</div>
>> </div>
>>
>> I want the following in my marginnote
>> <span><a href="#ref-AmazonSameDayPrime">[1]</a></span>
>> <span class="marginnote">
>> <span id="ref-AmazonSameDayPrime" class="csl-entry"
>> role="doc-biblioentry">
>> <span class="csl-left-margin">[1] </span><span
>> class="csl-right-inline">D. Ingold and S. Soper, <span>“Amazon doesn’t
>> consider the race of its customers. Should it?”</span> <em>Bloomberg</em>,
>> 2016.</span></span></span>
>>
>> At the moment all I get in my marginnote is
>>
>> <span><a href="#ref-AmazonSameDayPrime">[1]</a></span><span
>> class="marginnote"><a href="#ref-AmazonSameDayPrime">[1]</a></span>
>> 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 à 10:41:07AM, Leena Murgai a écrit :
>>> > No problem William,
>>> >
>>> > in the example screenshots, the text I'm referring to is specifically
>>> >
>>> > D. Ingold and S. Soper, “Amazon doesn’t consider the race of its
>>> customers.
>>> > Should it?” Bloomberg, 2016.
>>> >
>>> > 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, but I
>>> don't know
>>> > how to access it. Anyway, I want that text to be in my marginnote
>>> along side
>>> > the (lonely looking) [1].
>>> >
>>> > Actually, I'm not interested in having the references at the end 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:
>>> >
>>> > 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 <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>> 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 = pandoc.Span(el.content)
>>> >   marginnote.classes[1] = '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 date if it's empty above #
>>> > 2. tex2html/filters/texref.lua          # Cleanup pandoc and
>>> > pandoc-crossref conflicts #
>>> > 3. pandoc-crossref                      # [1]https://github.com
>>> > /lierdakil/pandoc-crossref #
>>> > 4. citeproc                             # If you need control
>>> > over when the citeproc processing #
>>> > 5. pandoc-sidenote                      # [2]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-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] (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’s pandoc-sidenote filter just takes every
>>> > footnote as a whole and converts it to a sidenote <span>.
>>> > Unless you want separate streams for regular footnotes and
>>> > citation sidenotes, it might be useful: [3]https://
>>> > github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc/
>>> > SideNote.hs
>>> >
>>> > Em sexta-feira, 20 de agosto de 2021 às 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 changed.
>>> > I suspect that your problem is something else.
>>> >
>>> >
>>> > % cat cite.md
>>> >
>>> > @RFC1149
>>> >
>>> >
>>> > % LUA_PATH=../?.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: ")"
>>> >
>>> >       }
>>> >
>>> >     }
>>> >
>>> >   }
>>> >
>>> > }
>>> >
>>> > <p><span class="citation" data-cites="RFC1149">
>>> > (<strong>RFC1149?</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 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
>>> > ([4]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 [5]
>>> > https://pandoc.org/lua-filters.html#
>>> > type-cite and [6]https://pandoc.org/
>>> > lua-filters.html#type-citation.
>>> >
>>> > On Fri, 20 Aug 2021 at 16:36, Leena
>>> > Murgai <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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', ' <span
>>> > class = "marginnote">'),
>>> >     pandoc.Span(el.content),
>>> >     pandoc.RawInline('html5', ' </span>
>>> > ')
>>> >     }
>>> > 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
>>> >
>>> > [linked_item_number] <span class=
>>> > marginnote>
>>> > text_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?
>>> >
>>> > 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 [7]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 "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 [8]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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>> >
>>> > To view this discussion on the web visit [9]
>>> https://groups.google.com/d
>>> > /msgid/pandoc-discuss/
>>> > eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n%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 [10]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
>>> >
>>> > References:
>>> >
>>> > [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/SideNote.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-8a37373d33a6n%40googlegroups.com?utm_medium=email&utm_source=footer
>>> > [8]
>>> https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-411f-b92a-c14153d58e49n%40googlegroups.com?utm_medium=email&utm_source=footer
>>> > [9]
>>> https://groups.google.com/d/msgid/pandoc-discuss/eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n%40googlegroups.com?utm_medium=email&utm_source=footer
>>> > [10] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>>> > [11]
>>> https://groups.google.com/d/msgid/pandoc-discuss/b548772c-269e-45c7-9ff6-9aec6014f024n%40googlegroups.com?utm_medium=email&utm_source=footer
>>>
>>> --
> 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/4c177bdf-f369-4e9b-bdc6-36e0e38cf496n%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/4c177bdf-f369-4e9b-bdc6-36e0e38cf496n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAEe_xximr2LB2Lue-K8Vi3jDkTZ%2BDLp81N5KaLZtOva5_v2AYw%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 40086 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found] ` <0f2d14e3-a86e-4fa1-b98c-52f540fe82b9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2021-08-20 15:36   ` Leena Murgai
@ 2021-08-21 17:00   ` John MacFarlane
       [not found]     ` <m2sfz2n36m.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  1 sibling, 1 reply; 26+ messages in thread
From: John MacFarlane @ 2021-08-21 17:00 UTC (permalink / raw)
  To: Leena Murgai, pandoc-discuss


With this pull request
https://github.com/jgm/pandoc/pull/7461
it will be possible to have side notes next to the paragraphs
in which the notes occur. So you could use that together with
a style like chicago-fullnote-bibliography.csl.

Leena Murgai <leenamurgai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> 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
>
> [linked_item_number] <span class=marginnote>
> text_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?
>
> 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-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/0f2d14e3-a86e-4fa1-b98c-52f540fe82b9n%40googlegroups.com.


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Help with a filter converting citations to sidenotes
       [not found]     ` <m2sfz2n36m.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2021-08-24  3:07       ` Leena Murgai
  0 siblings, 0 replies; 26+ messages in thread
From: Leena Murgai @ 2021-08-24  3:07 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1868 bytes --]

Thanks both!

I'm using ieee.csl and wasn't keen on figuring out how to change it. In the 
end post-processing my HTML was the easiest/fastest approach.

Best,
Leena
On Saturday, 21 August 2021 at 10:00:32 UTC-7 John MacFarlane wrote:

>
> With this pull request
> https://github.com/jgm/pandoc/pull/7461
> it will be possible to have side notes next to the paragraphs
> in which the notes occur. So you could use that together with
> a style like chicago-fullnote-bibliography.csl.
>
> Leena Murgai <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> > 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
> >
> > [linked_item_number] <span class=marginnote>
> > text_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?
> >
> > 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/0f2d14e3-a86e-4fa1-b98c-52f540fe82b9n%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/29ebfa1a-8c65-4af7-a2a7-08d2629fa0een%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 3304 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2021-08-24  3:07 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-20  3:32 Help with a filter converting citations to sidenotes Leena Murgai
     [not found] ` <0f2d14e3-a86e-4fa1-b98c-52f540fe82b9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-08-20 15:36   ` Leena Murgai
     [not found]     ` <eda3d7b4-befd-4f42-9455-8a37373d33a6n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-08-20 15:59       ` William Lupton
     [not found]         ` <CAEe_xxgvt+VaEQHA52ARktgU5LtDc5CvSwGpGEmi7iB61r-KFQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-08-20 16:07           ` Leena Murgai
     [not found]             ` <a50c77e1-4112-43ba-bfb1-fc716a474be8n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-08-20 16:12               ` Leena Murgai
     [not found]                 ` <93663960-bbfe-40a1-b3ba-25fefe58e7e0n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-08-20 16:14                   ` Leena Murgai
     [not found]                     ` <3106cf1d-5ae3-411f-b92a-c14153d58e49n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-08-20 16:37                       ` William Lupton
     [not found]                         ` <CAEe_xxjcvzan-To3UUApcszFJS1tAj2TC7NH2bTW38TykJstxg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-08-20 16:41                           ` Leena Murgai
     [not found]                             ` <7b758cdd-70d7-4c86-b08a-de891ff10ca2n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-08-20 16:44                               ` William Lupton
2021-08-20 16:59                               ` Bastien DUMONT
2021-08-20 16:44                           ` Pedro P. Palazzo
     [not found]                             ` <0fd903f3-e52d-44bd-a1b2-50bccfc9b66cn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-08-20 17:00                               ` Leena Murgai
     [not found]                                 ` <206b26c5-32b2-408d-80f6-cf851c9c8cb9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-08-20 17:06                                   ` Leena Murgai
     [not found]                                     ` <7df79e6f-cb35-4ca5-8bc3-f089e3bc9199n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-08-20 17:25                                       ` Leena Murgai
     [not found]                                         ` <eb59834b-d3e8-4dc4-9a66-0eb8c0f3e225n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-08-20 17:31                                           ` William Lupton
     [not found]                                             ` <CAEe_xxjLevSn7YgLpg4LTdmjD_duxwm+Z3qXEGM+zSuwHUT3fg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-08-20 17:38                                               ` William Lupton
2021-08-20 17:41                                               ` Leena Murgai
     [not found]                                                 ` <b548772c-269e-45c7-9ff6-9aec6014f024n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-08-20 17:49                                                   ` William Lupton
     [not found]                                                     ` <CAEe_xxggM6-5=pTkMVxFFZSht75Sr=R_iQ8kXpq9nX+2kfKh8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-08-20 18:06                                                       ` Leena Murgai
     [not found]                                                         ` <8d4c4320-4a85-4363-8789-8bebcd21d329n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-08-20 18:37                                                           ` William Lupton
2021-08-20 18:08                                                   ` Bastien DUMONT
2021-08-20 18:34                                                     ` Leena Murgai
     [not found]                                                       ` <5866a845-e0bd-48b1-835d-189e40ef94f5n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-08-20 18:53                                                         ` Leena Murgai
     [not found]                                                           ` <4c177bdf-f369-4e9b-bdc6-36e0e38cf496n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-08-21  8:33                                                             ` William Lupton
2021-08-21 17:00   ` John MacFarlane
     [not found]     ` <m2sfz2n36m.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2021-08-24  3:07       ` Leena Murgai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).