ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen via ntg-context <ntg-context@ntg.nl>
To: Denis Maier via ntg-context <ntg-context@ntg.nl>
Cc: Hans Hagen <j.hagen@xs4all.nl>
Subject: Re: Citeproc-lua
Date: Fri, 6 May 2022 23:44:38 +0200	[thread overview]
Message-ID: <ff135397-2edb-fa2a-2f93-ab5bcbaeab6f@xs4all.nl> (raw)
In-Reply-To: <b542dfd93bd644f3bdeeec4f8efcc3c1@unibe.ch>

On 5/6/2022 11:02 PM, Denis Maier via ntg-context wrote:

> I also have the impression that extending citeproc-formats.lua should be the easiest part. As an aside, I think the HTML is in there because that is needed for the test suite, but for ConTeXt we should be able to copy the LaTeX mapping and tweak a few things here and there.

> The LaTeX package is hard to understand, at least if you're not used to the "new" latex3 programming syntax and style. I also can only guess what that stuff does. But as you say this is rather isolated from the citeproc processing, so I guess the main task would be to come up with an equivalent ConTeXt module that writes the citations to the tuc file, calls the citeproc engine, and uses the results for the output. Right? (I.e., AFAICS, everything that lives under https://github.com/zepinglee/citeproc-lua/tree/main/citeproc should pretty much just work, while https://github.com/zepinglee/citeproc-lua/tree/main/latex must be adapted.)

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

A bit like this:

- Convert the whole bibliography database to html using pandoc in the 
preferred cs rendering. That should be fast.

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

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

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2022-05-06 21:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-03 20:00 Citeproc-lua Denis Maier via ntg-context
2022-05-06 12:57 ` Citeproc-lua Taco Hoekwater via ntg-context
2022-05-06 13:20   ` Citeproc-lua Hans Hagen via ntg-context
2022-05-06 21:02   ` Citeproc-lua Denis Maier via ntg-context
2022-05-06 21:09     ` Citeproc-lua Aditya Mahajan via ntg-context
2022-05-06 21:26       ` Citeproc-lua Hans Hagen via ntg-context
2022-05-06 21:44     ` Hans Hagen via ntg-context [this message]
2022-05-06 22:04       ` Citeproc-lua Denis Maier via ntg-context
2022-05-06 22:33       ` Citeproc-lua Denis Maier via ntg-context
2022-05-06 23:15         ` Citeproc-lua Hans Hagen via ntg-context
2022-05-07 10:22           ` Citeproc-lua Denis Maier via ntg-context
2022-05-06 22:56       ` Citeproc-lua Rik Kabel via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ff135397-2edb-fa2a-2f93-ab5bcbaeab6f@xs4all.nl \
    --to=ntg-context@ntg.nl \
    --cc=j.hagen@xs4all.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).