inukshuk / citeproc-ruby

A Citation Style Language (CSL) Cite Processor
103 stars 23 forks source link

Processing one field through citeproc-ruby #11

Closed ghost closed 10 years ago

ghost commented 12 years ago

Is it possible to get only one field processed through the citation style. For example, suppose I want only the author names being processed ...

inukshuk commented 12 years ago

It should be relatively easy to remove all items except the one's you need from a given CSL style.

If you want to format the names in particular, you could also look at the new citeproc API we're working on for the citeproc-ruby relaunch. That library contains classes that model individual ames and lists of names and can be formatted using the formatting options defined in the CSL standard. Therefore, if you take the options of a given style it should be very easy to reproduce that style's name formatting. So yes, if you're looking for name formatting let me know so we can take a look if this approach works.

ghost commented 12 years ago

I see. I feel that it would be good to allow users to extract formatted contents other than the names too. AFAIK, I can only access the fully converted string with citeproc, but I find the need to get formatted titles, names, or page numbers. So, perhaps a general approach may be possible?

And, yes, right now I'm looking for name formatting. Do you need me to provide you with something?

inukshuk commented 12 years ago

That's exactly one of the main reasons why we're currently rewriting citeproc-ruby – we want the processor to be flexible enough to support this sort of thing (i.e., register callbacks that are triggered for specific nodes or items or fields).

The new citeproc-ruby will be split into three separate components: input data, csl, and the processor proper. The input data component is already fairly advanced and provides an API to manage names – so you might want to see if that can solve your problem.

There is a caveat though: the new citeproc shares a namespace with the old citeproc, therefore you can't load them at the same time (thus, if you're using this with jekyll-scholar we should probably wait); sorry about that, but this is being actively developed at the moment, so the best thing to do is to checkout the repository and update frequently:

https://github.com/inukshuk/citeproc

Also, I'm working on this all week, so let me know if you have any questions.

ghost commented 12 years ago

It's great that you are reworking it. I will try out citeproc and wait for the development to go ahead. Thanks.