jupyter-book / mystmd

Command line tools for working with MyST Markdown.
https://mystmd.org/guide
MIT License
219 stars 64 forks source link

Add support for setting citation and bibliography style #1462

Open agoose77 opened 3 months ago

agoose77 commented 3 months ago

Currently the citations in the auto-generated bibliography on HTML don't have support for multiple styles. For example, changing between the citation styles of different journals. We should expose this functionality so that authors can choose what style they want.

References

agoose77 commented 3 months ago

@fwkoch is my understanding correct here?

rowanc1 commented 3 months ago

We did do a pass on numbered citations at one point!

agoose77 commented 3 months ago

@rowanc1 I'm thinking along the lines of saying "the bib should use APA format". Does that intersect with the work that you're referring to?

fwkoch commented 3 months ago

Numbered citations (e.g. [1] instead of (Koch, 2012)) are available at the theme level, e.g. https://github.com/jupyter-book/myst-theme/blob/main/themes/book/template.yml#L55-L57

However, @agoose77 your assumptions about bibliography style are correct. It exists as an option in citation-js-utils: https://github.com/jupyter-book/mystmd/blob/main/packages/citation-js-utils/src/index.ts#L290 - but that is not consumed anywhere else in myst. The only place we make that render call is here I think: https://github.com/jupyter-book/mystmd/blob/main/packages/myst-cli/src/transforms/citations.ts#L25