Skip to content

Add preferred-citation field to the top-level. #55

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

Closed
hainesr opened this issue Jul 28, 2021 · 13 comments
Closed

Add preferred-citation field to the top-level. #55

hainesr opened this issue Jul 28, 2021 · 13 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@hainesr
Copy link
Member

hainesr commented Jul 28, 2021

As discussed in #54.

@hainesr hainesr added the enhancement New feature or request label Jul 28, 2021
@hainesr hainesr added this to the 1.0 milestone Jul 28, 2021
@hainesr hainesr self-assigned this Jul 28, 2021
@hainesr
Copy link
Member Author

hainesr commented Jul 29, 2021

So. preferred-citation is now in ruby-cff.

Next question is how to surface it in the BibTeX/APA outputs. If there is a preferred-citation, should that be the one that is output, over the top-level data? It feels like this is the expectation when providing a preferred-citation but would appreciate thoughts from @sdruskat, @jspaaks and indeed others!

@sdruskat
Copy link
Member

Great!

I think that what GitHub want (correct me if I'm wrong, @arfon) is indeed to use the preferred-citation whenever there is one, so as to respect the users' preferences (although this goes against the principles somewhat 😉).

@hainesr
Copy link
Member Author

hainesr commented Jul 29, 2021

You know what? I'll make it configurable, then everyone has options! 🚀

@jspaaks
Copy link
Member

jspaaks commented Jul 29, 2021

You know what? I'll make it configurable, then everyone has options! rocket

But wait isnt the fact that the user added a preferred-citation already the configuration?

@sdruskat
Copy link
Member

I thought that making it configurable would be the best option as well, but didn't want to put the burden on Rob. I do think that having this configurable is good, because then, other users of the Gem (or GitHub in the future!) could choose to either follow the user, or follow best practice (see the principles paper, "always cite the software") or just display both 🙂.

@hainesr
Copy link
Member Author

hainesr commented Jul 29, 2021

I can make it configurable with a default.

What should the default be? Use preferred-citation (for the reasons @jspaaks mentions above)?

@sdruskat
Copy link
Member

Best option for now, defo!

@arfon
Copy link
Collaborator

arfon commented Jul 30, 2021

What should the default be? Use preferred-citation (for the reasons @jspaaks mentions above)?

This makes sense to me. I've been thinking of preferred-citation as an override for any other behavior so I think if it exists, this is what GitHub should use in the UI.

@hainesr
Copy link
Member Author

hainesr commented Aug 7, 2021

I have pushed this to main now, with the following features:

  • When outputting a citation string, honouring preferred-citation is the default, if present, but can be turned off.
  • The BibTeX formatter respects the type of reference being generated and tries to use a sensible corresponding BibTeX type e.g. @misc for software and @book, @article, @inproceedings etc as appropriate.
  • The APA formatter only adds '[Computer software]' if it is indeed software being referenced.
  • The formatters expect validated CFF files as input. I felt that this was better than validating within the formatter so that for e.g. GitHub things aren't being validated multiple times when outputting multiple formats at once.

Happy to have thoughts on these changes and issues raised where I've missed something.

@hainesr hainesr closed this as completed Aug 7, 2021
@arfon
Copy link
Collaborator

arfon commented Aug 7, 2021

⚡ thanks @hainesr. I've taken these changes for a spin and have found a few issues with some of the outputs for articles. I've opened a PR to demonstrate the issues here: #71

@hainesr
Copy link
Member Author

hainesr commented Aug 7, 2021

Thanks @arfon. I'll look at your PR in detail tomorrow. For reference I used the fixtures that @mfenner provided in #67 for the APA format.

@arfon
Copy link
Collaborator

arfon commented Aug 8, 2021

Thanks @arfon. I'll look at your PR in detail tomorrow. For reference I used the fixtures that @mfenner provided in #67 for the APA format.

👍 thanks @hainesr 🙇. From what I can see in #67, the examples are almost (all?) software citations, not articles (i.e., preferred-citation entities).

Ultimately it will be great to switch to CSL for formatting these outputs :-)

@hainesr
Copy link
Member Author

hainesr commented Aug 8, 2021

Hi @arfon, yes now I've had chance to look at your PR properly I see the difference!

Thanks, we do need more test coverage in this area and we're missing some of the useful article level data in the citations at the moment. I'll try and look at this today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants