[NTG-context] Citeproc-lua

denis.maier at unibe.ch denis.maier at unibe.ch
Sat May 7 00:33:02 CEST 2022

> -----Urspr√ľngliche Nachricht-----
> Von: ntg-context <ntg-context-bounces at ntg.nl> Im Auftrag von Hans Hagen
> via ntg-context
> Gesendet: Freitag, 6. Mai 2022 23:45
> An: Denis Maier via ntg-context <ntg-context at ntg.nl>
> Cc: Hans Hagen <j.hagen at xs4all.nl>
> Betreff: Re: [NTG-context] Citeproc-lua
> [...]
> For the record: i don't think you should write something to the tuc file that
> doesn't come from context itself because you can mess it up (also
> performaance wise). 

Really? But what about that stuff? Anyway, even better if the data coming from context itself can be used. 

Of course you could have another file (just like a bib file
> is independent). One problem could be that you need to make some extra
> installation to make it work as we're not going to add all kind of code to the
> distribution (we tend to go smaller) and someone needs to maintain that
> moduie then because users depend in it working.
> Did you look into what pandoc provides? It might be easier to take that
> output and include it. Some kind of html? That's easy to render.

Pandoc can output context as well, so we can just take that.

> A bit like this:
> - Convert the whole bibliography database to html using pandoc in the
> preferred cs rendering. That should be fast.

Using the whole bibliography might give problems with regards to disambiguation.

> - Use the normal context commands for referencing a citation (the cite part
> is normally easy as there is not much variation in that; if needed one can
> cheat and also pregenerate that). That's then just some relatively small
> plugin mode.
> - When placing the bibliography, filter the right entries from that html file
> (easy) using info that got stored in the tuc.

As said above, that might create problems with regards to disambiguation. Better just use the right entries.

> It is also fast. The only depdency then is pandoc but that is widely available
> (irr). But I would need to see an example of that kind of out first. We
> basically treat the (formatted) bibliography as an external resource but in
> some format that we can easily parse (and if needed tweak).

So, that would work a bit like Aditya's filter module: https://github.com/adityam/filter

Another option would be to just use pandoc's citeproc directly, as described here: https://github.com/jgm/citeproc/blob/master/man/citeproc.1.md

We'd have to pass a list of citations as a JSON object to that citeproc and use the results. 
The results will include citations as well as the bibliography (all as JSON, content can be HTML formatted).


More information about the ntg-context mailing list