public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* How to retrieve doi/ url from citeproc with lua filter ?
@ 2021-10-22 21:26 'sebastien rey-coyrehourcq' via pandoc-discuss
       [not found] ` <126d5d2c-335d-45a9-8976-14ded00cc735n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: 'sebastien rey-coyrehourcq' via pandoc-discuss @ 2021-10-22 21:26 UTC (permalink / raw)
  To: pandoc-discuss


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

Hi there,

I'm a little lost in lua filters.

If i want url and doi in my bibtex appearing in the AST Json #ref div i 
suppose the only way was to change default CSL. But after that, without 
regex ? is there a way to retrieve the url and the doi from elem? I said 
that because i need to push these information into my database after 
resolving.

The workflow is :

docs.md  -> pandoc --citeproc docs.bib + lua filter -> save key/doi/url of 
citation into a database for another usage

Best regards


-- 
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/126d5d2c-335d-45a9-8976-14ded00cc735n%40googlegroups.com.

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

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

* Re: How to retrieve doi/ url from citeproc with lua filter ?
       [not found] ` <126d5d2c-335d-45a9-8976-14ded00cc735n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-10-23 20:35   ` 'sebastien rey-coyrehourcq' via pandoc-discuss
       [not found]     ` <0d5dfe75-c2e2-494d-9f86-caf29eba40fen-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: 'sebastien rey-coyrehourcq' via pandoc-discuss @ 2021-10-23 20:35 UTC (permalink / raw)
  To: pandoc-discuss


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

Finally, with some efforts, and lot of googling (tutorial, stackoverflow, 
this mailling list) to find different pieces of explanation (i found the 
documentation of pandoc / lua filters really hard for newcomers ...) ,i 
found a solution to catch url from <div> generated by citeproc.

I'm interested by some feedback because my lua "skills" are really new :)

https://gist.github.com/reyman/12e31a533499790547179a2d40d7e021

Json Output and lib penlight to dump really help me to understand what 
happen : 
local pretty_dump = require"pl.pretty".dump

Best
Le vendredi 22 octobre 2021 à 23:26:28 UTC+2, sebastien rey-coyrehourcq a 
écrit :

> Hi there,
>
> I'm a little lost in lua filters.
>
> If i want url and doi in my bibtex appearing in the AST Json #ref div i 
> suppose the only way was to change default CSL. But after that, without 
> regex ? is there a way to retrieve the url and the doi from elem? I said 
> that because i need to push these information into my database after 
> resolving.
>
> The workflow is :
>
> docs.md  -> pandoc --citeproc docs.bib + lua filter -> save key/doi/url of 
> citation into a database for another usage
>
> Best regards
>
>
>

-- 
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/0d5dfe75-c2e2-494d-9f86-caf29eba40fen%40googlegroups.com.

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

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

* Re: How to retrieve doi/ url from citeproc with lua filter ?
       [not found]     ` <0d5dfe75-c2e2-494d-9f86-caf29eba40fen-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-10-24  4:19       ` John MacFarlane
  0 siblings, 0 replies; 3+ messages in thread
From: John MacFarlane @ 2021-10-24  4:19 UTC (permalink / raw)
  To: 'sebastien rey-coyrehourcq' via pandoc-discuss, pandoc-discuss


Congrats on figuring out a solution!

Here's a shorter way to do the same thing:

```
function Div(el)
  if el.identifier == "refs" then
    pandoc.walk_block(el, { Link = function (e) print(e.target) end })
  end
end

function Pandoc(el)
  return pandoc.Pandoc({})
end
```

Just be sure to run this filter AFTER --citeproc on the command
line.


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

end of thread, other threads:[~2021-10-24  4:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-22 21:26 How to retrieve doi/ url from citeproc with lua filter ? 'sebastien rey-coyrehourcq' via pandoc-discuss
     [not found] ` <126d5d2c-335d-45a9-8976-14ded00cc735n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-10-23 20:35   ` 'sebastien rey-coyrehourcq' via pandoc-discuss
     [not found]     ` <0d5dfe75-c2e2-494d-9f86-caf29eba40fen-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-10-24  4:19       ` John MacFarlane

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