@@ -30,6 +30,15 @@ public class AcademicPagesExporter extends Exporter {
3030 private final String directory ;
3131 private final LayoutFormatterPreferences layoutPreferences ;
3232 private final SelfContainedSaveOrder saveOrder ;
33+ <<<<<<< HEAD
34+ =======
35+
36+ private final Replace replaceFormatter = new Replace ();
37+ private final RemoveLatexCommandsFormatter commandsFormatter = new RemoveLatexCommandsFormatter ();
38+ private final HTMLChars htmlFormatter = new HTMLChars ();
39+ private final SafeFileName safeFormatter = new SafeFileName ();
40+
41+ >>>>>>> 100f e95fd2e80d7e86a23d3ade55de7117501700
3342 private TemplateExporter academicPagesTemplate ;
3443
3544 /**
@@ -49,8 +58,9 @@ public AcademicPagesExporter(LayoutFormatterPreferences layoutPreferences, SelfC
4958 @ Override
5059 public void export (@ NonNull final BibDatabaseContext databaseContext ,
5160 @ NonNull final Path exportDirectory ,
52- @ NonNull List <BibEntry > entries ) throws SaveException {
53- export (databaseContext , exportDirectory , entries , List .of (), JournalAbbreviationLoader .loadBuiltInRepository ());
61+ @ NonNull List <BibEntry > entries )
62+ throws SaveException {
63+ export (databaseContext , exportDirectory , entries , List .of (exportDirectory ), JournalAbbreviationLoader .loadBuiltInRepository ());
5464 }
5565
5666 /**
@@ -67,7 +77,8 @@ public void export(@NonNull final BibDatabaseContext databaseContext,
6777 @ NonNull final Path file ,
6878 @ NonNull List <BibEntry > entries ,
6979 List <Path > fileDirForDataBase ,
70- JournalAbbreviationRepository abbreviationRepository ) throws SaveException {
80+ JournalAbbreviationRepository abbreviationRepository )
81+ throws SaveException {
7182 if (entries .isEmpty ()) { // Only export if entries exist
7283 return ;
7384 }
@@ -93,15 +104,23 @@ public void export(@NonNull final BibDatabaseContext databaseContext,
93104 }
94105 }
95106
107+ <<<<<<< HEAD
96108 private static @ NonNull Path getPath (BibEntry entry , Path exportDirectory ) {
97109 Replace replaceFormatter = new Replace ();
98110 replaceFormatter .setArgument (" ,-" ); // expects an expression that has the character to remove and the replacement character separated by a comma.
99111 RemoveLatexCommandsFormatter commandsFormatter = new RemoveLatexCommandsFormatter ();
100112 HTMLChars htmlFormatter = new HTMLChars ();
101113 String title = entry .getTitle ().get ();
114+ =======
115+ private @ NonNull Path getPath (BibEntry entry , Path exportDirectory ) throws SaveException {
116+
117+ replaceFormatter .setArgument (" ,-" ); // The replaceFormatter expects a "-" instead of " " hence the strange argument.
118+
119+ String title = entry .getTitle ().orElseThrow (() -> new SaveException ("Entry does not contain a title" ));
120+ >>>>>>> 100f e95fd2e80d7e86a23d3ade55de7117501700
102121 String formattedTitle = commandsFormatter .format (htmlFormatter .format (replaceFormatter .format (title )));
103- SafeFileName safeFormatter = new SafeFileName ();
104122 String safeTitle = safeFormatter .format (formattedTitle );
123+
105124 return exportDirectory .resolve (safeTitle + ".md" );
106125 }
107126}
0 commit comments