CSL Funds & Projects

The “importing” part in my figures was requireing the script (since csl-js is a browserify bundle). The figure for citeproc-js should not have been included, since the browser variant does not have that.

In the meantime I’ve looked at the pre-gen stuff and was thinking a rewrite would be both easier and yield cleaner code – looks like that’s compatible with the discussion that went on here since. I had notifications off for some reason so I missed much of what was going on since my last comment here.

I could have a stab at doing a new pre-gen; I’ve used citeproc before, so this shouldn’t be too hard, but if the re-do of pre-gen more fruitfully folds into csl-js or citeproc-rs, I don’t mind having it done there. I don’t know any rust, so I’ll be of little use there.

While it’s not entirely working (from 21.5k generated I get some 600 errors, a lot of which return false from makeBibliography, some return bibliography_errors in the return value for makeBibliography), but generating these 21.5k samples takes 3.5 minutes. If I generate just one sample per style, 22 seconds.

For the items returning bibliography errors, if you can join the Jurism Test Submissions group, sync down, drop the items into collections named for each style ID stub, and sync up, I can look into the cause. The processor shouldn’t be showing errors on any valid style, there may be a bug in it somewhere.

Are you sure you don’t want to see the code that did this first, before I start adding things to the group? Also, these are in the sample format from src/exampleData.js, which is CSL-JSON (I think/hope), so they’d undergo CSL - Zotero conversion for import.

edit: sample code + CSL items at https://gist.github.com/retorquere/c6c015fc64d877279ad184a4debbb2c6

For the bibliography false, these 54 styles don’t define a bibliography, so false would be correct output:


If I understood you correctly, that’d account for most of the 600 “errors”?

Most, yes; I don’t have mediaeval-studies.csl even after an git submodule update --init --recursive, and I also get false for iso690-note-cs. But I had forgotten the dependent styles earlier – I’m not entirely sure what dependent styles do, but if I add those, I get close to 7.5k bibliographies that are false.

Time for all samples is also 6m30, not 3m30 (and total samples at 103k and change) because I forgot the dependent styles, 41 seconds if I just generate one sample per style.

That leaves 17 that have other errors:

associacao-brasileira-de-normas-tecnicas-unirio-eipp.csl
associacao-brasileira-de-normas-tecnicas-usp-fmvz.csl
ausonius-editions.csl
computer-und-recht.csl
fachhochschule-kiel-fachbereich-medien.csl
gewerblicher-rechtsschutz-und-urheberrecht.csl
guide-pour-la-redaction-et-la-presentation-des-theses-a-lusage-des-doctorants.csl
im-gesprach.csl
iso690-full-note-sk.csl
juristische-schulung.csl
kommunikation-und-recht.csl
mohr-siebeck-recht.csl
neue-juristische-wochenschrift.csl
presses-universitaires-de-paris-nanterre.csl
societe-archeologique-de-bordeaux.csl
springer-basic-note.csl
wirtschaftsuniversitat-wien-unternehmensrechnung-und-controlling.csl

Edit: The 17, including the returned getBibliography results: https://gist.github.com/7b2fe0af5f02b9c7339978d91913467c

Haven’t looked through all of them, but I suspect that’s actually a similar issue.
E.g. associacao-brasileira-de-normas-tecnicas-unirio-eipp.csl simply doesn’t not define the bibliography for patents and newspapers articles (which is bad style but not forbidden by spec and Rintze or I can easily miss it during QA). I suspect this is the same for the other examples.
Citeproc-js then throws an error code that gets printed (“No Printed form for Reference” or something along those lines).
It might be worthwhile just fixing those styles by turning a final else-if into an else or so.

So no dependent style specifies a bibliography? Looking at https://github.com/citation-style-language/styles/wiki/Requesting-Styles I would have expected that a render from a dependent style would just yield the same output as its parent, but most or all don’t yield false for getBibliography.

huh – that’s what I would have expected, too, but I’m not sure if that’s implemented in citeproc-js directly or if it requires the software (Zotero, Mendeley, etc.) to handle some part of this.

No wait - I’m feeding it the CSL style as a xml string, I haven’t told it where to find the parent style. Where do I do that using the citeproc-js api?

citeproc-js doesn’t grok dependent styles. Those could either be recomposed in the script, or the output of the parent could just be cloned to save the overhead.

Recomposed in what sense? I’ve looked at a few and it looks like they just point to the non-dependent style – but then I don’t understand what they do precisely.

Dependent styles are indeed literally just links with metadata, yes. The current csl Editor appears to handle them nicely – did you look what that does?

In any case, I have a working script now that (it seems to me) regenerates generated/preGeneratedExampleCitations.json if I just assume an empty string when I see any kind of error. Code looks a lot better to me, but it will only run in node. From the looks of it, Lars’s script should be tons faster, but mine is there for the taking if you guys want it,

I haven’t looked, no – I am still trying to figure out how the editor hangs together. I took a stab at the pregen because it was isolated.

To be clear – I don’t know squat about CSL, nor of any of the processor. Seems to me Lars is much better equipped to deal with any part of this, but I’ll be glad to help out where I can.

At least in Zotero, dependent styles can also override the parent locale.

Ah yes good point. Not sure if the editor uses that at all, though – I’d suspect not.