github-young / zotero-better-authors

Customize the displayed authors list
GNU Affero General Public License v3.0
77 stars 1 forks source link

Add a separator for omitted authors within a list of authors #27

Closed mjthoraval closed 11 months ago

mjthoraval commented 11 months ago

As discussed in a previous issue, I would like to be able to identify quickly if some authors have been omitted within a list of authors.

For example, let's uses these settings, showing only the last name of the first and last author: image

If I have two items with the following authors list:

  1. Smith1 / SmithLast
  2. Smith1 / Smith2 / SmithLast

In the current configuration, both of them will be displayed as Smith1; SmithLast:

  1. Smith1 / SmithLast -> Smith1; SmithLast
  2. Smith1 / Smith2 / SmithLast -> Smith1; SmithLast

I would like to be able to distinguish these two items. For example with:

  1. Smith1 / SmithLast -> Smith1; SmithLast
  2. Smith1 / Smith2 / SmithLast -> Smith1; …SmithLast

This is still fairly compact and it adds useful information on the authors list.

I think that this was already implemented by @jstzwj in his PRs:

        const lastAuthorDisplayed: string = this.displayAuthorName(authors, authors.length - 1, sep);
        if (firstN < authors.length - 1) {
          return authorList.join(", ") + ", ..., " + lastAuthorDisplayed;
        } else if (firstN == authors.length - 1) {
          return authorList.join(", ") + ", " + lastAuthorDisplayed;
        } else {
          return authorList.join(", ");
        }

https://github.com/github-young/zotero-better-authors/blob/185890815740a539b6fb2dd90da6ac702a6b04db/src/modules/lastauthor.ts

But it slowly got rremoved over the iterations.

github-young commented 11 months ago

closed in v3.4.0

mjthoraval commented 11 months ago

It seems to work if you display at least one middle author: image

But not if you show only the first and last authos: image

Not to be too greedy, but a user defined separator on this would be nice also :).

github-young commented 11 months ago

But not if you show only the first and last authors

~Is this not correct?~ Do you mean you want a special separator and for only two authors case?

Not to be too greedy, but a user defined separator on this would be nice also :).

OK noted.

mjthoraval commented 11 months ago

Do you mean you want a special separator and for only two authors case?

No.

The first example framed in the second situation has 6 authors. It is currently displaying: Abate, A. R.; Weitz, D. A. It should be: Abate, A. R.; ...; Weitz, D. A. to reflect that some authors have been omitted.

The second example framed is correct.

github-young commented 11 months ago

fixed in v3.5.1 and closed.

During implementing this issue, I just realized that I don't have to separate the first author and middle authors as the former can be merged into the latter. The original code from PR #9 #13 already did this but was changed by me. I just restored it.