typst / hayagriva

Rusty bibliography management.
Apache License 2.0
290 stars 44 forks source link

Does Hayagriva use CSL internally? #132

Open retorquere opened 5 months ago

retorquere commented 5 months ago

It looks like Hayagriva uses CSL styles, does that mean it uses CSL as its internal model, and is the yaml format then just syntactic sugar over CSL (since CSL styles won't be able to use anything but what's expressible in CSL)?

I have a user request for Hayagriva YAML support for Zotero, but if Hayagriva uses CSL internally, it seems more productive to have it also accept CSL as a input format, rather than the conversion pipeline Zotero -> CSL -> Hayagriva -> CSL.

laurmaedje commented 5 months ago

The data model is independent, but the formatting is dependant. Supporting CSL as input would be feasible for hayagriva.

retorquere commented 5 months ago

Right, I understand the data model can be independent, but no styles from https://citationstyles.org/ will know what to do with data that cannot be expressed in CSL fields; if that is true there wouldn't be much use in adding non-CSL-conforming data.

janosh commented 5 months ago

not sure if this was clear to others from this thread (wasn't to me) so I just tried to read a YAML file created by zotero-better-bibtex CSL Better YAML export. doesn't work:

error: failed to parse YAML (references: invalid type: sequence, expected struct NakedEntry at line 3 column 1) 78 │ bibliography("refs.yaml")

retorquere commented 5 months ago

The yaml formats aren't the same, they express the same information but in very different ways. The way it seems to me, hayagriva is essentially a preprocessor for CSL-JSON.