Skip to content
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

suppress-author and friends #114

Closed
adomasven opened this issue May 20, 2021 · 9 comments · Fixed by #117
Closed

suppress-author and friends #114

adomasven opened this issue May 20, 2021 · 9 comments · Fixed by #117
Labels
A-core Area: affects all builds of citeproc-rs enhancement New feature or request

Comments

@adomasven
Copy link
Member

Testing with the current build none of the custom item fields like suppress-author, prefix, suffix, locator and others appear to be working. The produced citations have the default output.

@cormacrelf
Copy link
Collaborator

cormacrelf commented May 21, 2021

To be clear are these supposed to be fields on a (citeproc-rs terminology) reference? That are meant to provide a default value for those things that would normally be provided by a cite? If so that's not implemented. I haven't seen it in any spec anywhere.

Also by custom do you mean fields on the "custom" object you can provide in CSL-JSON? (This entire object is ignored. I'm not sure what's supposed to be done with it. Custom variables? I thought CSL was very against that!)

@dstillman
Copy link
Member

dstillman commented May 21, 2021

@adomasven
Copy link
Member Author

I was pretty sure these worked already in a previous version, but perhaps I am wrong.

@cormacrelf
Copy link
Collaborator

Well that's different. The prefix and suffix and locator on a cite are working still. A large slice of the suite doesn't pass without them. I just sanity checked the JavaScript API by adding a quick js-tests test for affixes, and they definitely haven't gone anywhere. So I'm not sure what's gone wrong, except that the various APIs look a bit similar and maybe you're putting them on a Cluster instead, which doesn't support them.

It doesn't do suppress-author though. It's been planned but I can make the suppression system a priority.

@adomasven
Copy link
Member Author

Sorry, this was indeed my bad re prefix and suffix. suppress-author, however indeed doesn't work, but is a blocker. author-only can wait longer, although I imagine once you have one of the options the other is trivial to provide.

@adomasven
Copy link
Member Author

@cormacrelf Any update on this? Is this difficult to add? What timeline should we expect?

@cormacrelf
Copy link
Collaborator

I'm just about done, probably tomorrow or Sunday!

@cormacrelf cormacrelf changed the title Custom citation item fields not working suppress-author and friends Jun 18, 2021
@cormacrelf
Copy link
Collaborator

That turned out not to be quite true, sorry; I found some more edge cases in cluster mode and given the assembly of rendered cites into a cluster is some of the most finicky code in there, I went for a refactor. I know the base requirement is suppress-author & author-only on a per-cite basis but I think it's worth having a full implementation of zotero/zotero#1580 (see Frank's documentation link) and it's best to do all of it while my head's in that code. I think I can safely promise I'll be done this weekend.

Specifically, implementation-wise, now it has to handle composite clusters writing to two different <layout> element streams with different delimiters and affixes, and that hits grouping and collapsing since you want to be able to collapse the author in Same Author, composite infix (2008, 2010a-c) (I believe using the <intext> element's output for name collapsing if available). That code was a little too fragile to adapt directly. I have changed it to use some custom iterators for grouping + collapsing and a fun type called Partial which is like an Option but comparing anything with the None value results in a!=b. Use that as a group-by key and you have a much simpler way to express "group together runs of the same year" that works in the face of some cites not having a year at all. Anyway, it's better.

@cormacrelf
Copy link
Collaborator

Available in @citeproc-rs/wasm@0.0.0-canary-0157c4b.

@cormacrelf cormacrelf added A-core Area: affects all builds of citeproc-rs enhancement New feature or request labels Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: affects all builds of citeproc-rs enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

3 participants