-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
add coauthor annotation #175
add coauthor annotation #175
Conversation
@ziruizhuang Awesome! I'm going to take a closer look and make some comments shortly. |
@ziruizhuang I think we're on the right track here! I looked at your code and think it is fairly clean/elegant. It is always tricky business to deal with names, and the perfect information model for it might not exist (without a tree-structured design, which also adds complexity). Names are always a challenge, and if I am understanding correctly, you'd be able to handle a case like For example:
I'll do some testing and let you know, but it looks like this would be good to go as a big step forward! |
@gkthiruvathukal Thank you for your feedback, and yes, current implementation can handle combinations by adding the middle names / initials into the As for the code, there are two major issues that I haven't find out a good way to mitigate.
|
@ziruizhuang I did a bit of testing on a fairly lengthy list of co-authors. If you want, you can take a look at my site at https://github.com/gkthiruvathukal/gkthiruvathukal.github.io, which deploys to https://thiruvathukal.com. I do agree it is a bit less than optimal to recompute the same information again and again (yes, I'm pretty sure this template is called for each bib item). But in my testing, the build time did not go up dramatically. The entire build time for my site about 5 seconds on my MacBook Air. There is one minor thing. Before this change, when my own name was listed in a publication, it would be underlined. But now, I am not seeing underlining. I thought maybe I need to add myself in the coauthors.yml file, but that results in a full hyperlink. (That's how I left things for now.) I didn't see anything in your code that would cause this to happen.....but I will look at the diffs more carefully to see if that code somehow got deleted/disabled to underline the site author's name when it shows up as an author in a publication. In any event, I think going to the flat format is the right way to go, and it's pretty amazing you were able to build this based on the way I described it earlier. I hope this pull request can be approved by @alshedivat, since it will help many users. Even though I didn't write the code, it was nice helping to figure out a good information model for it. Thanks for doing the work, because I was super busy getting ready for the upcoming semester. |
@ziruizhuang Update: I was missing I do wonder, however, whether this line of code has potential to cause trouble:
Is |
@gkthiruvathukal Thank you for your effort in testing the code. As for |
@gkthiruvathukal I see that the code in your repo uses |
@ziruizhuang I follow. That makes complete sense, actually. So This is what I have right now:
So
This would actually be good. I think I have at least one publication where my middle name is not listed.... Happy to help update the docs a bit, once we get this PR finalized. |
@ziruizhuang, @gkthiruvathukal, this is awesome! Thanks for drafting and discussing the best way to go about co-author annotation! I looked through the code changes and your discussion and have a couple of thoughts:
The above solution would also avoid the preprocessing of |
@alshedivat I like this proposed structure. In fact, it kind of brings my two original thoughts together all in one! :) Just so you know, I agree it's rare, but in some fields, it's becoming less rare. This is especially true when there's a large author list (a phenomenon known as hyperauthorship!) See https://www.nature.com/news/physics-paper-sets-record-with-more-than-5-000-authors-1.17567. This doesn't apply to me, but I have a couple of papers where there are many authors. I also have a collaborator with last name Lu and, sure enough, we had someone work with us on a paper who also had Lu as a last name. :) There is kind of a "pain paint" though when it comes to certain names as keys, and I think we need to document it. One of my collaborators has the last name "O'Connell". To make this work, I had to put quotes around it, if I recall correctly. With the new syntax where last_name is a key/value pair, it's easier to manage!! |
@gkthiruvathukal, got it, makes sense. I'm definitely in favor to support proper co-author identification based on full names. Re: having to put quotation marks around last names with special characters -- how about we put all last names in quotation marks as a safe default that should work for all last names? |
@alshedivat Yes, I think that would be a good idea. This helps in many situations. I have co-authors with hyphenated last names, special characters (e.g. Läufer), and the one I already mentioned (O'Connell). Looks like we are converging on something awesome!! I also like your amendment because it will mostly preserve the "simplicity" of the original syntax. If there is no ambiguity, you basically use the last name key and hash containing just the url. |
Coauthors are grouped by their last names. Within each group, using flat format (array of {firstnames, url}).
@gkthiruvathukal @alshedivat Wonderful. I updated the implementation based on your discussion. Please have a look. |
@ziruizhuang I was about to ping you to see if you wanted me to work on it! I finally was able to spend some time to read the liquid docs and feel more confident with it now. Thanks for working on this update! I'm going to test it now but might not report back until morning my time (based in Chicago USA here). |
@ziruizhuang, everything is working nicely! You can see the build status here: https://travis-ci.com/github/gkthiruvathukal/gkthiruvathukal.github.io. I manually copied in I think we should declare this PR good to go, especially since you've already tested using the "Bach" example I provided earlier, with J.S. included for good measure! 👍🏾. |
@gkthiruvathukal , If everything goes well, think it's time to check whether the doc / tutorial is easy to follow. (P.S. I have traveled to Chicago a few years back and I do love the city : ) ) And thank you all for the discussion, ideas, code reviewing, and testing. |
I think this PR is a great example of how iterating toward a good solution benefits from addressing requirements, coding, documentation, and testing! I'm actually glad I wasn't coding so I could independently test the code. By the way, @ziruizhuang, you'll be pleased to know that the last name support also works correctly on my end with two different authors. @alshedivat I think this PR is good to go, pending your final approval. |
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 great! Thanks again for this contribution.
I suggested a few stylistic changes. Please double check that everything works again, and we'll be ready to merge.
@alshedivat For the changes you suggested, are those in your repo or @ziruizhuang's fork? It looks like they are approved already but I would like to do some final testing on my site. |
stylistic changes Co-authored-by: Maruan <[email protected]>
stylistic changes Co-authored-by: Maruan <[email protected]>
stylistic changes Co-authored-by: Maruan <[email protected]>
stylistic changes Co-authored-by: Maruan <[email protected]>
@gkthiruvathukal I committed the suggestions from @alshedivat just now. The code should be available at https://github.com/ziruizhuang/al-folio/tree/dev-author-annotation |
@ziruizhuang Thanks! I will incorporate these changes on my site and follow up. |
@gkthiruvathukal, did you get a chance to test the final changes? If all looks good, I'll go ahead and merge. |
@alshedivat Yes, I have incorporated the latest version of Nice working with you and @ziruizhuang on this PR. I'll try to help out with future changes. (I actually did a bit of liquid on my regular page content, so I know how to use it now.) |
* add coauthor annotation * fix typo in coauthors.yml * add brief author annotation tutorial in README.md * change to combined data structure Coauthors are grouped by their last names. Within each group, using flat format (array of {firstnames, url}). * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> Co-authored-by: Maruan <[email protected]> [ci skip]
* add coauthor annotation * fix typo in coauthors.yml * add brief author annotation tutorial in README.md * change to combined data structure Coauthors are grouped by their last names. Within each group, using flat format (array of {firstnames, url}). * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> Co-authored-by: Maruan <[email protected]>
* add coauthor annotation * fix typo in coauthors.yml * add brief author annotation tutorial in README.md * change to combined data structure Coauthors are grouped by their last names. Within each group, using flat format (array of {firstnames, url}). * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> Co-authored-by: Maruan <[email protected]>
* add coauthor annotation * fix typo in coauthors.yml * add brief author annotation tutorial in README.md * change to combined data structure Coauthors are grouped by their last names. Within each group, using flat format (array of {firstnames, url}). * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> Co-authored-by: Maruan <[email protected]>
* add coauthor annotation * fix typo in coauthors.yml * add brief author annotation tutorial in README.md * change to combined data structure Coauthors are grouped by their last names. Within each group, using flat format (array of {firstnames, url}). * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> * Update _layouts/bib.html stylistic changes Co-authored-by: Maruan <[email protected]> Co-authored-by: Maruan <[email protected]>
@gkthiruvathukal , I have added coauthor annotation using your suggested
flat
format. Since the author name parsing from bibtex is handled by upstream jekyll-scholar, only first name and last name is processed here.The code is not very elegant, but since the code is only used to generate static web pages, it might be okay for now.
And @alshedivat , do you have any suggestions?
We can have more discussion on the implementation here.
Related issue #100