typst / hayagriva

Rusty bibliography management.
Apache License 2.0
336 stars 54 forks source link

JSONschema for bibliography file #33

Open clbarnes opened 1 year ago

clbarnes commented 1 year ago

Somewhat related to #32; it would be much easier to interact with the YAML file from other languages if there were a programmatic schema for it.

nichtich commented 1 year ago

A JSON Schema would also help to formalize the partly vague File Format specification. By now some parts are not strictly defined but only shown as examples. This is not related to #32 - JSON Schema just happens to be common with implementations in several programming language to validate both JSON and YAML files.

bdarcus commented 1 year ago

And you can write and maintain the schema in YAML, which is much nicer, given it's support for comments and such, and just run a CI process to create a JSON version.

        institution:
          title: Literal name text; should not be parsed
          # comment
          description: Use for institutional creator names; e.g. 'National Institutes of Health'
          type: string

In general, the additional metadata on the properties will allow editors with support for this to provide auto-completion tooltips and such.

BTW, presumably this means you don't really support corporate names in these author lists?

    author:  ["Doe, Jane", "Some org, Some subunit"]

How would you deal with that?

We've struggled with these questions in CSL.

MKDJr commented 3 months ago

Hey y'all, I've created a JSON specification for Hayagriva in PR https://github.com/typst/hayagriva/pull/192. Please provide your feedback!