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

Removed BibTeX file type and included HTML and Markdown types #9318

Merged
merged 14 commits into from
Oct 30, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We modified the Directory of Open Access Books (DOAB) fetcher so that it will now also fetch the ISBN when possible. [#8708](https://github.com/JabRef/jabref/issues/8708)
- We modified the "Delete file" dialog and add the full file path to the dialog text. The file path in the title was changed to file name only. [koppor#534](https://github.com/koppor/jabref/issues/534)
- Download from URL now automatically fills with URL from clipboard. [koppor#535](https://github.com/koppor/jabref/issues/535)
- We added HTML and Markdown files to Find Unlinked Files and removed BibTeX.[koppor#547](https://github.com/koppor/jabref/issues/547)

### Fixed

Expand Down Expand Up @@ -770,10 +771,10 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed an issue where some importers used the field `pubstatus` instead of the standard BibTeX field `pubstate`.
- We changed the latex command removal for docbook exporter. [#3838](https://github.com/JabRef/jabref/issues/3838)
- We changed the location of some fields in the entry editor (you might need to reset your preferences for these changes to come into effect)
- Journal/Year/Month in biblatex mode -> Deprecated (if filled)
- DOI/URL: General -> Optional
- Internal fields like ranking, read status and priority: Other -> General
- Moreover, empty deprecated fields are no longer shown
- Journal/Year/Month in biblatex mode -> Deprecated (if filled)
- DOI/URL: General -> Optional
- Internal fields like ranking, read status and priority: Other -> General
- Moreover, empty deprecated fields are no longer shown
- Added server timezone parameter when connecting to a shared database.
- We updated the dialog for setting up general fields.
- URL field formatting is updated. All whitespace chars, located at the beginning/ending of the URL, are trimmed automatically
Expand Down Expand Up @@ -905,12 +906,12 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We removed the coloring of cells in the main table according to whether the field is optional/required.
- We removed the feature to find and resolve duplicate BibTeX keys (as this use case is already covered by the integrity check).
- We removed a few commands from the right-click menu that are not needed often and thus don't need to be placed that prominently:
- Print entry preview: available through entry preview
- All commands related to marking: marking is not yet reimplemented
- Set/clear/append/rename fields: available through Edit menu
- Manage keywords: available through the Edit menu
- Copy linked files to folder: available through File menu
- Add/move/remove from group: removed completely (functionality still available through group interface)
- Print entry preview: available through entry preview
- All commands related to marking: marking is not yet reimplemented
- Set/clear/append/rename fields: available through Edit menu
- Manage keywords: available through the Edit menu
- Copy linked files to folder: available through File menu
- Add/move/remove from group: removed completely (functionality still available through group interface)
- We removed the option to change the column widths in the preferences dialog. [#4546](https://github.com/JabRef/jabref/issues/4546)

## Older versions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ public UnlinkedFilesDialogViewModel(DialogService dialogService,

this.fileFilterList = FXCollections.observableArrayList(
new FileExtensionViewModel(StandardFileType.ANY_FILE, preferences.getFilePreferences()),
new FileExtensionViewModel(StandardFileType.BIBTEX_DB, preferences.getFilePreferences()),
new FileExtensionViewModel(StandardFileType.HTML, preferences.getFilePreferences()),
new FileExtensionViewModel(StandardFileType.MARKDOWN, preferences.getFilePreferences()),
new FileExtensionViewModel(StandardFileType.PDF, preferences.getFilePreferences()));

this.dateFilterList = FXCollections.observableArrayList(DateRange.values());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public enum StandardExternalFileType implements ExternalFileType {
TIFF(Localization.lang("%0 image", "TIFF"), "tiff", "image/tiff", "gimp", "picture", IconTheme.JabRefIcons.PICTURE),
URL("URL", "html", "text/html", "firefox", "www", IconTheme.JabRefIcons.WWW),
MHT("MHT", "mht", "multipart/related", "firefox", "www", IconTheme.JabRefIcons.WWW),
ePUB("ePUB", "epub", "application/epub+zip", "firefox", "www", IconTheme.JabRefIcons.WWW);

ePUB("ePUB", "epub", "application/epub+zip", "firefox", "www", IconTheme.JabRefIcons.WWW),
MARKDOWN("Markdown", "md", "application/x-latex", "emacs", "emacs", IconTheme.JabRefIcons.FILE_TEXT);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://stackoverflow.com/a/25812177/3450689
The mime type needs to adjusted

private final String name;
private final String extension;
private final String mimeType;
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/jabref/logic/util/StandardFileType.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ public enum StandardFileType implements FileType {
CFF("CFF", "cff"),
ANY_FILE("Any", "*"),
CER("SSL Certificate", "cer"),
CITAVI("Citavi", "ctv6bak", "ctv5bak");
CITAVI("Citavi", "ctv6bak", "ctv5bak"),
MARKDOWN("Markdown", "md");




Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/jabref/logic/util/io/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,10 @@ public static boolean isBibFile(Path file) {
}

/**
* Test if the file is a bib file by simply checking the extension to be ".bib"
* Test if the file is a pdf file by simply checking the extension to be ".pdf"
*
* @param file The file to check
* @return True if file extension is ".bib", false otherwise
* @return True if file extension is ".pdf", false otherwise
*/
public static boolean isPDFFile(Path file) {
return getFileExtension(file).filter("pdf"::equals).isPresent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

class ExternalFileTypesTest {
private static final Set<ExternalFileType> TEST_LIST = Set.of(
StandardExternalFileType.MARKDOWN,
StandardExternalFileType.PDF,
StandardExternalFileType.URL,
StandardExternalFileType.JPG,
Expand Down