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 all 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We changed the color of found text from red to high-contrast colors (background: yellow; font color: purple). [koppor#552](https://github.com/koppor/jabref/issues/552)
- 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)
- We changed the messages after importing unlinked local files to past tense. [koppor#548](https://github.com/koppor/jabref/issues/548)
- We fixed an issue where the wrong icon for a successful import of a bib entry was shown [#9308](https://github.com/JabRef/jabref/pull/9308)

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", "text/markdown", "emacs", "emacs", IconTheme.JabRefIcons.FILE_TEXT);
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