-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Added option to export in CFF (Citation File Format) #10917
Conversation
Thanks for the contribution! For date, you could checkout the dateformatter, howeer I don't know how it behaves with missing info. Maybe you can add some more test strings for that (DateFormatterTest)
https://docs.jabref.org/collaborative-work/export/customexports |
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 good to me now, I'm okay with the pragmatic date approach
A bit out of scope, but if you ever need to parse more complicated date formats you can see Jabref's Date class which contains some more crazy formats |
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.
Thank you for the contribution.
Some small comments.
Do you have time to craft a roundtrip test? We now have an exporter and an importer.
* Bump org.apache.lucene:lucene-queries from 9.9.1 to 9.10.0 Bumps org.apache.lucene:lucene-queries from 9.9.1 to 9.10.0. --- updated-dependencies: - dependency-name: org.apache.lucene:lucene-queries dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * introduce var for lucene --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Siedlerchr <[email protected]>
* Implemented the feature that deleting files which linked to selected entries when user select deletion, and keeping files unchanged when user select cut * The following features are implemented: 1.Initializes a pop-up dialog box to confirm whether the user wants to delete attached files from selected entry. 2.Keep track of user preference: if the user prefers always delete attached files, delete the files without displaying the dialog box. 3. Add preference options in File>Preference>Linked Files>Attached files so that users can manage preferences * update CHANGELOG.md * Add language keys to english language file * restore files in src/main/resources/csl-locales and src/main/resources/csl-styles * Removed unnecessary comments and finxed some requested changes. Added new features: 1. When deleting attached files, the name of files to be deleted will be displayed. 2. Solved the access error caused by repeated deletion of files when one file is attached to multiple entries. * Add language keys to english language file * Modify language keys to english language file * made deleteFileFromDisk method static * update comment of method deleteFileFromDisk * fixed coding styles * restored unexpected code changes * fix logic * try null * todo * Unify dialogs that confirmation deleting files * Get around LinkedFile in LIbraryTab, Encapsulate LinkedFile into LinkedFileViewModel * fix style * restore files * Unified the different dialogs when deleting entries, removerd unnecessary dialogs * fix csl-styles * try to fix csl-styles * try to fix csl-styles again * try to fix csl-styles again 2 * try to fix csl-styles again 3 * Update prompts in en.properties * New features - Add to Trash - Group file-related language strings together * Fix architecture tests * Introduce list of files to delete * Streamline 1 vs. many files * Fix openRewrite * Discard changes to src/test/resources/org/jabref/logic/search/test-library-with-attached-files.bib * Adapt true/false logic according to expectations * Add "Trash" to CHANGELOG.md * Fix localization * Fix JabRef_en.properties * Add some debug statements * Fix preferences * Separate log entries by empty line * More refined dialog --------- Co-authored-by: Siedlerchr <[email protected]> Co-authored-by: Oliver Kopp <[email protected]> Co-authored-by: Carl Christian Snethlage <[email protected]>
#10914) * Fix duplicate check/merge entries dialog not triggered on import from browser Refs #5858 * changelog * remove double duplicate check * remove l10n * add icon, downloading is also handled in import entries * changelog * fix l10n * Update JabRef_en.properties * Update ImportEntriesDialog.java --------- Co-authored-by: Oliver Kopp <[email protected]>
Made a class comment in CffDate.java Replaced System.lineseparator() with OS.NEWLINE in CffDate.java Added a final newline in cff.layout file
I do not have much time to implement a roundtrip test, but I think this is more complicated than it seems. In fact, the importer only handles two types of entries, |
I'm okay with that for the moment. Then we create a new task for roundtrip test. jabref/src/main/java/org/jabref/model/entry/AuthorList.java Lines 165 to 172 in 79a7756
|
Hey, I am Jean's friend, I can work on crafting a round-trip test! Please let me know if that's fine. |
@Raahitya-14 Sure, go ahead! Maybe the importer has to be improved, too. As first test https://github.com/JabRef/jabref/blob/main/CITATION.cff Should be imported. Maybe, your work turns out to improve the importer... |
@Raahitya-14 I suggest you create a new PR for this then |
Sure, I will create a new PR |
This PR adds the possibility to export BibEntries in CFF format, as requested in #10661. It supports several entries per .cff file, but I don't know if this is permitted by the CFF format. This is hard to solve since the export process in the code is intended for several entries. Also, since the CFF format is primarily intended for pieces of software, this exporter uses credit redirection with the line
preferred-citation
to specify another type of document.The fields supported are entry type, author's name, abstract, DOI, volume and URL.
The date is quite complicated since CFF forces date to be of the form "yyyy-mm-dd". This causes problems if only month and year are specified, i.e. 2021-03. It can be solved using a DateFormatter specifically for the CFF exporter and using a default day number, but I did not know if that was necessary, hence I did not implement this.
Documentation is not up-to-date, CFF as export format must be documented.
Closes #10661
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)