-
Notifications
You must be signed in to change notification settings - Fork 37
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
ebib-import-file
file rename
#294
Comments
Hi, the user option You can retrieve the title from the database with the function
Check the doc string for |
I know very little about Elisp. According to your opinion, the following code is written by ChatGPT.
|
Well, let me just say that ChatGPT isn't much of an Elisp programmer... 😆 I'll take a look later today or tomorrow and come up with something better. 🙂 |
If you want to create a file name based on year, title and publisher, you can use something like this: (defun my/ebib-name-transform-function (key)
"Generate a filename based on the year, title, and publisher of the entry."
(let ((year (ebib-get-field-value "year" key ebib--cur-db "XXXX" t))
(title (ebib-get-field-value "title" key ebib--cur-db "No_Title" t))
(publisher (ebib-get-field-value "publisher" key ebib--cur-db "No_Publisher" t)))
(format "%s-%s-%s" year title publisher))) This way you'll get default strings if year, title or publisher are not available. If, on the other hand, you want to get an error if one of these is missing, you can use the following: (defun my/ebib-name-transform-function (key)
"Generate a filename based on the year, title, and publisher of the entry."
(let ((year (ebib-get-field-value "year" key ebib--cur-db nil t))
(title (ebib-get-field-value "title" key ebib--cur-db nil t))
(publisher (ebib-get-field-value "publisher" key ebib--cur-db nil t)))
(format "%s-%s-%s" year title publisher))) |
Other variations are possible, of course, depending on your exact preferences. |
thanks~It's good |
Hello, I just started switching from zotero to ebib
When I use
ebib-import-file
, the pdf is imported into the database and renamed toentry key.pdf
, which is great. But I'm confused, is there a function how to customize the pdf name todate-titile.pdf
? Thanks.The text was updated successfully, but these errors were encountered: