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

Support for exporting to YAML format #7007

Merged
merged 16 commits into from
Oct 22, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
small updates
  • Loading branch information
joethei committed Oct 21, 2020
commit a1107ed890bb562ca6f5b64f26ae7aecceb6f92d
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.jabref.logic.exporter;

/**
this enum represents the behaviour for blank lines in {@link TemplateExporter}
* This enum represents the behaviour for blank lines in {@link TemplateExporter}
*/
public enum BlankLineBehaviour {
KEEP_BLANKS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public class TemplateExporter extends Exporter {
private static final String BEGIN_INFIX = ".begin";
private static final String END_INFIX = ".end";


private static final Logger LOGGER = LoggerFactory.getLogger(TemplateExporter.class);

private final String lfFileName;
Expand Down
22 changes: 9 additions & 13 deletions src/main/java/org/jabref/logic/layout/format/CSLType.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
package org.jabref.logic.layout.format;

import java.util.Map;

import org.jabref.logic.layout.LayoutFormatter;
import org.jabref.model.entry.types.StandardEntryType;

public class CSLType implements LayoutFormatter {

@Override
public String format(String value) {
Map<String, String> map = Map.of(StandardEntryType.Article.getDisplayName(), "article",
StandardEntryType.Book.getDisplayName(), "book",
StandardEntryType.Conference.getDisplayName(), "paper-conference",
StandardEntryType.Report.getDisplayName(), "report",
StandardEntryType.Thesis.getDisplayName(), "thesis",
StandardEntryType.MastersThesis.getDisplayName(), "thesis",
StandardEntryType.PhdThesis.getDisplayName(), "thesis",
StandardEntryType.WWW.getDisplayName(), "webpage",
StandardEntryType.TechReport.getDisplayName(), "report",
StandardEntryType.Online.getDisplayName(), "webpage");
return switch (StandardEntryType.valueOf(value)) {
case Article -> "article";
case Book -> "book";
case Conference -> "paper-conference";
case Report, TechReport -> "report";
case Thesis, MastersThesis, PhdThesis -> "thesis";
case WWW, Online -> "webpage";

return map.getOrDefault(value, "no-type");
default -> "no-type";
};
}
}