-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Serialization failure when PersonRole::Unknown is involved #266
Comments
I think this was probably added to ensure persons with unknown roles wouldn't be serialized back into the hayagriva yaml format, but I think this might have been inappropriately handled. In theory, that bibliography cannot be turned into valid hayagriva, as there is a fixed list of allowed roles in the format specification, but maybe we could just flexibilize this restriction, at the cost of breaking some forwards-compatibility. Thoughts? cc @reknih |
I'd rather not allow any value in Hayagriva person roles. I think that the error message that your person was not in the list is valuable, because CSL styles will not select or format arbitrary roles. I also see the need for a generic, catch-all role. Hence, I'd propose changing |
Well, that could be an initial improvement. However, I think the problem for this particular case might be different: |
I'm open to allow scriptwriter in interop - is there any prior art for this? |
Found this long thread here: retorquere/zotero-better-bibtex#2802 However, what I can tell for this is that the real "standards" in reference management are very fragmented... and here this is mostly due to how Zotero exports things, if I understood correctly. Maybe we can add a quick hack around this in interop, even if temporarily. But, more generally, it seems that |
This fixes issue #266. Other than what the title of the issue suggests, `PersonRole::Unknown` can still not be serialized, deciding [on this](#266 (comment)) is left to a later PR. Instead, the PR adds some conversions for editor types the biblatex manual does not specify. Support for the `scriptwriter` type is justified by [zotero-better-biblatex's output](https://github.com/retorquere/zotero-better-bibtex/blob/c617185750df065f597a54b447a5b71f690777e4/test/fixtures/export/Exporting%20item%20type%20film%20merges%20scriptwriter%20with%20other%20contributors%20%232802.biblatex#L8). Support for the `producer` type is based on use in both [`biblatex-chicago`](https://markov.htwsaar.de/tex-archive/macros/latex/contrib/biblatex-contrib/biblatex-chicago/doc/biblatex-chicago.pdf) and [`biblatex-apa`](https://ctan.net/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test-references.bib). `biblatex-apa` uses `writer` instead of `screenwriter`, so that's supported instead. A peculiarity is that `biblatex-chicago` gives the value `none` the semantic meaning of performers within `video` and `music` entries (see e.g. its manual p. 27). This value is chosen to hack BibLaTeX into not printing any label.
This fixes issue #266. Other than what the title of the issue suggests, `PersonRole::Unknown` can still not be serialized, deciding [on this](#266 (comment)) is left to a later PR. Instead, the PR adds some conversions for editor types the biblatex manual does not specify. Support for the `scriptwriter` type is justified by [zotero-better-biblatex's output](https://github.com/retorquere/zotero-better-bibtex/blob/c617185750df065f597a54b447a5b71f690777e4/test/fixtures/export/Exporting%20item%20type%20film%20merges%20scriptwriter%20with%20other%20contributors%20%232802.biblatex#L8). Support for the `producer` type is based on use in both [`biblatex-chicago`](https://markov.htwsaar.de/tex-archive/macros/latex/contrib/biblatex-contrib/biblatex-chicago/doc/biblatex-chicago.pdf) and [`biblatex-apa`](https://ctan.net/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test-references.bib). `biblatex-apa` uses `writer` instead of `screenwriter`, so that's supported instead. A peculiarity is that `biblatex-chicago` gives the value `none` the semantic meaning of performers within `video` and `music` entries (see e.g. its manual p. 27). This value is chosen to hack BibLaTeX into not printing any label.
The following code
errors out with:
I believe this is caused by a wrong use of
#serde(skip)
in thePersonRole
enum.https://github.com/chenlijun99/hayagriva/blob/af5c146265b797a74edcb0c760e52e41834a037a/src/types/persons.rs#L83-L85
A similar issue was raised in serde: serde-rs/serde#2217 (comment).
The gist seems that the value itself cannot decide to be ignored.
Can be reproduced using the following biblatex entry.
The text was updated successfully, but these errors were encountered: