-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add citation element #120
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is still a draft, so take my comments more like hints and suggestions.
Summary:
- Added some remarks to reduce possible panics.
- Suggested using more functionality provided by serde
- Suggested workaround to get a HashMap for clap + serde
… add logs when it fails
This reverts commit 2746775.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good.
One minor change to use Option<String>
to prevent "" from being used as None
.
I tried to check the JS part, but I am not too familiar with JS.
Could not find any obvious errors, and the tests are passing, so I assume that its ok.
This PR adds the citation element, and CSL handling to render citations according to a given CSL style.
Relevant decisions you made in this PR
Storing citation IDs in parser contexts
According to CSL, citations of the same IDs may differ depending on the citation order.
To correctly handle this, all citations are first stored in a citation list
that is stored in the
BlockContext
of the block parser.Before rendering to an output format, the parsed citations are processed in-order by
citeproc-js
to get the correct citation content.
The rendered citations are then passed as list to the respective renderer for the output format.
CSL locale files in preamble
CSL processors need locale information to correctly render citations.
The official CSL repository provides some locales, but not every locale is covered.
Therefore, the parameter
citation_locales
was added to allow adding custom locale files.