OK, so Johan is working on a python port of citeproc.
I was thinking that I could help him with the unit tests and help set a
kind of framework for where we want to be with an API.
The question is, what’s the best way to set up citeproc-py (or the ruby
version) for smooth integration with different code?
My thought is that it’s really clear (to me!) that we need a
ReferenceList class. User then creates it like so:
list = ReferenceList()
… loads it up with Reference objects (which is mostly a
dictionary/hash to store the variables, probably based on a list of
citation ids), and then can just do:
list.to_xhtml
list.to_rtf
… etc.
Right?
In the Ruby version I have, I also have a CitationStyle class, where
the objects are created from the CSL file.
I had originally thought of that as separately generated, but it seems
to me it makes sense to have the CSL object as an attribute of
ReferenceList.
So you’d do:
ReferenceList(style="apa")
By default that would be empty I guess (because sometime you might not
want to output formatted references). If the option is there, the
CitationStyle object gets generated there.
What I suggest, then, following David Wilson’s suggestion, is that the
Reference objects can also return two different kinds of citations:
full (default)
short (for subsequent citations, say)
ibid
[not sure how to deal with local citation modifications like
suppressing author names]
In other words, whatever other code is dealing with citations is
responsible for knowing what kind of output it needs at any given point
in a document (because it’s contextual, so something that citeproc
can’t really know about).
Does this all sound right?
Bruce