Bibtex is not a simple format, especially if you support it fully (which
you probably wouldn't).
Internally, for kcite, I use PhP objects and a JSON format from
citeproc.js. The PhP objects were useful because I can initialize
sensible defaults and are good for debugging. However, I am not
convinced that this is a good enough reason, and may move to passing
around JSON.
> Any thoughts on that? At this stage the code would simply convert between
> bibtex and the internal representation we have for references (and
> ultimately to HTML when viewing an article and XML when exporting to
> NLM-dtd).
>
> I have looked at the various plugins available and read discussions of
> different formats, but I'd be interested in any suggestions or other
> feedback about this approach. Should we consider some other format for
> internal storage? Any issues with bibtex that would make this approach
> unworkable?
We are in need of a PhP library which encapsulates all of this. I took
my approach because kcite recieves its references in XML (obviously in
two totally unrelated schema, because otherwise it would be too easy)
and outputs in HTML or JSON for citeproc. This sort of thing should be
sharable.
Phil
> We are in need of a PhP library which encapsulates all of this. I took
> my approach because kcite recieves its references in XML (obviously in
> two totally unrelated schema, because otherwise it would be too easy)
> and outputs in HTML or JSON for citeproc. This sort of thing should be
> sharable.
>
> Phil
Do we really need a PHP solution for _all_ of this? What if the PHP
took care of an agreed declarative way of representing citations, and
serving citation data, and we used Javascript for the UI part - ie
displayin refernences in different formats etc. This would make it
easier to get stuff that worked across all the different CMS and
repository systems.
--
-------------------------------
Peter Sefton +61410326955 p...@ptsefton.com http://ptsefton.com
Gmail, Twitter & Skype name: ptsefton
> A quick comment from me without really thinking about it.
>
>> We are in need of a PhP library which encapsulates all of this. I took
>> my approach because kcite recieves its references in XML (obviously in
>> two totally unrelated schema, because otherwise it would be too easy)
>> and outputs in HTML or JSON for citeproc. This sort of thing should be
>> sharable.
>>
>> Phil
>
> Do we really need a PHP solution for _all_ of this? What if the PHP
> took care of an agreed declarative way of representing citations, and
> serving citation data, and we used Javascript for the UI part - ie
> displayin refernences in different formats etc. This would make it
> easier to get stuff that worked across all the different CMS and
> repository systems.
Yes, I agree, and this is what I am working on. The idea for kcite is
this....
1) article has DOI/PMID/URL
2) PhP queries PM, crossref, URL gets back, er, something.
3) PhP reconciles and integrates something into JSON
4) PhP serves blogpost and JSON
5) Citeproc generates bibliography and in-text citation client-side.
In the ideal world, of course, PM, crossref or a URL would all return
JSON or better still JSONP. Step 2 would happen in the browser, Steps 3
and 4 would disappear, and issues like caching of query results would
become someone elses problem (which is surely the best kind of problem).
Having said this, doing lots of cleverness in javascript has its
drawbacks. It requires a proper browser client-side (which is going to
make ePuB or PDF export hard), and it's even going to cause issues for
archiving.
So, as far as I can see, the data integration layer at least is stuck
server side for the moment.
Phil
This is true, and I did think about this. The disadvantage as you say is
needing the service to do this. Again, if something is provided, I would
leap at the opportunity of using it.
Phil