larsgw / citation.js

Citation.js converts formats like BibTeX, Wikidata JSON and ContentMine JSON to CSL-JSON to convert to other formats like APA, Vancouver and back to BibTeX.
https://citation.js.org/
MIT License
219 stars 30 forks source link

Retrieve info metadata from CSL style #193

Open haydenyoung opened 4 years ago

haydenyoung commented 4 years ago

According to the citation.js documentation, CSL styles can be loaded dynamically for specifying alternative bibliographies, for example those defined at https://github.com/citation-style-language/styles.

Each style has an info section, for example https://github.com/citation-style-language/styles/blob/master/apa.csl#L3. This info section has title, short title, etc.

Does citation.js provide a method for accessing this info via its api, for example,

config.templates.get("template-name").info.title

larsgw commented 4 years ago

Not yet, citeproc-js might but that I haven't integrated that with citation.js. You can also try csl-js, although it is unstable it may become mature enough at some point to replace citeproc-js, for me at least.