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

Better default for add-folder-name #843

Open
alexfikl opened this issue May 4, 2024 · 2 comments
Open

Better default for add-folder-name #843

alexfikl opened this issue May 4, 2024 · 2 comments

Comments

@alexfikl
Copy link
Collaborator

alexfikl commented May 4, 2024

Right now, add-folder-name defaults to an empty string. This makes it fallback to a hash-based name that looks like

b752ab6a1728f68a5152191319820bb3-some-author-maybe

A value based on the document data would be friendlier, e.g. {data[author]}-{data[title:.5S]} (authors + first 5 words of the title).

xref: @jghauser suggested a nicer jinja2 format in #842 (comment)

@jghauser
Copy link
Member

jghauser commented May 9, 2024

I think this would be a good thing to change. I don't think the hash serves much purpose in filenames (except ensuring uniqueness, and that can be achieve better in other ways, e.g. with a suffix or by adding the time-added).

When it comes to concrete proposals I think adding the year in would be nice (e.g. author-year-title). Would data[author] include the whole author? That could be veeery long. It would be nice to just use surnames, but those might not be available? And it would also be nice to fall back to editor if author isn't available, but I don't think this can be achieved with the default formatter. We'd also need to handle missing fields in some sensible manner.

EDIT: If we added jinja2 as normal dependency, we could supply sophisticated/flexible defaults. Especially once we sort out #711, this could be quite a neat solution.

@supersambo
Copy link

supersambo commented Jun 11, 2024

I currently use something like this {doc[author_list][0][family]}{doc[year]}__{doc[papis_id]} where the id solely serves to ensure uniqueness. Of course it is very long for that purpose. An optional suffix (a-z) would be great instead. One that gets appended only if the resulting string is not unique.

The editor-if-no-author option sounds great as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants