Verified Owner
Top Description Fields Constructors Methods
org.jabref.logic.exporter

public Class AcademicPagesExporter

extends Exporter
Class Inheritance
Annotations
@NullMarked
Imports
java.io.IOException, .InputStream, .InputStreamReader, .Reader, java.nio.charset.StandardCharsets, java.nio.file.Files, .Path, .StandardCopyOption, java.time.DateTimeException, java.time.format.DateTimeFormatter, java.time.temporal.TemporalAccessor, java.util.Comparator, .List, .Map, .Optional, org.jabref.logic.bibtex.FieldPreferences, org.jabref.logic.citationstyle.CSLStyleLoader, .CitationStyleGenerator, .CitationStyleOutputFormat, org.jabref.logic.journals.JournalAbbreviationLoader, .JournalAbbreviationRepository, org.jabref.logic.layout.Layout, .LayoutFormatterPreferences, .LayoutHelper, org.jabref.logic.util.StandardFileType, org.jabref.logic.util.io.FileNameUniqueness, .FileUtil, org.jabref.model.database.BibDatabase, .BibDatabaseContext, .BibDatabaseMode, org.jabref.model.entry.BibEntry, .BibEntryTypesManager, .Date, org.jabref.model.entry.field.StandardField, org.jabref.model.entry.types.EntryType, .StandardEntryType, org.jspecify.annotations.NullMarked

Exports JabRef entries to the academicpages Jekyll template format. Each BibEntry is written as a separate Markdown file under _publications/. YAML front matter is rendered via JabRef's layout engine; file management and computed fields are handled in Java.

Field Summary

Modifier and TypeField and Description
private static final Comparator<BibEntry>
private static final Map<EntryType, Integer>
ENTRY_TYPE_PRIORITY

Orders entries by type priority: book -> article -> incollection -> inproceedings -> others

private final BibEntryTypesManager
private final FieldPreferences
private final LayoutFormatterPreferences
private static final String

Constructor Summary

AccessConstructor and Description
public
AcademicPagesExporter(LayoutFormatterPreferences layoutPreferences, FieldPreferences fieldPreferences, BibEntryTypesManager entryTypesManager)

Method Summary

Modifier and TypeMethod and Description
private String
buildMarkdown(BibEntry entry, Path filesDir, BibDatabaseContext databaseContext, List<Path> fileDirForDatabase, JournalAbbreviationRepository abbreviationRepository)

Builds the full Markdown file: YAML front matter (layout + computed fields) + optional abstract body

private Optional<String>
copyPdfAndGetUrl(BibEntry entry, Path outputDir, String key, List<Path> fileDirForDatabase)

Copies the first attached PDF to the files directory and returns its filename.

public void
export(BibDatabaseContext databaseContext, Path outputFile, List<BibEntry> entries)

public void
export(BibDatabaseContext databaseContext, Path outputFile, List<BibEntry> entries, List<Path> fileDirForDatabase, JournalAbbreviationRepository abbreviationRepository)

Overrides org.jabref.logic.exporter.Exporter.export.

private String
private String
private String
generateFileName(BibEntry entry, Path targetDir)

private Optional<Layout>
loadLayout(String resourcePath, List<Path> fileDirForDatabase, JournalAbbreviationRepository abbreviationRepository)

private Optional<String>
renderLayout(BibEntry entry, BibDatabase database, List<Path> fileDirForDatabase, JournalAbbreviationRepository abbreviationRepository)

Renders entry-type-specific YAML fields using a layout file Falls back to the default layout if no type-specific layout exists

private Optional<String>
private Optional<String>
writeBibFile(BibEntry entry, Path outputDir, String key)

Writes a .bib file for the entry to the files directory and returns its filename.

Inherited from org.jabref.logic.exporter.Exporter:
exportexportToAllFilesOfEntryexportToFileByPathgetFileTypegetIdgetNametoString

Field Detail

ENTRY_TYPE_ORDERback to summary
private static final Comparator<BibEntry> ENTRY_TYPE_ORDER
ENTRY_TYPE_PRIORITYback to summary
private static final Map<EntryType, Integer> ENTRY_TYPE_PRIORITY

Orders entries by type priority: book -> article -> incollection -> inproceedings -> others

entryTypesManagerback to summary
private final BibEntryTypesManager entryTypesManager
fieldPreferencesback to summary
private final FieldPreferences fieldPreferences
layoutPreferencesback to summary
private final LayoutFormatterPreferences layoutPreferences
PUBLICATION_PATHback to summary
private static final String PUBLICATION_PATH

Constructor Detail

AcademicPagesExporterback to summary
public AcademicPagesExporter(LayoutFormatterPreferences layoutPreferences, FieldPreferences fieldPreferences, BibEntryTypesManager entryTypesManager)

Method Detail

buildMarkdownback to summary
private String buildMarkdown(BibEntry entry, Path filesDir, BibDatabaseContext databaseContext, List<Path> fileDirForDatabase, JournalAbbreviationRepository abbreviationRepository)

Builds the full Markdown file: YAML front matter (layout + computed fields) + optional abstract body

copyPdfAndGetUrlback to summary
private Optional<String> copyPdfAndGetUrl(BibEntry entry, Path outputDir, String key, List<Path> fileDirForDatabase)

Copies the first attached PDF to the files directory and returns its filename.

exportback to summary
public void export(BibDatabaseContext databaseContext, Path outputFile, List<BibEntry> entries) throws SaveException
Annotations
@Override
exportback to summary
public void export(BibDatabaseContext databaseContext, Path outputFile, List<BibEntry> entries, List<Path> fileDirForDatabase, JournalAbbreviationRepository abbreviationRepository) throws SaveException

Overrides org.jabref.logic.exporter.Exporter.export.

Annotations
@Override
formatDateback to summary
private String formatDate(TemporalAccessor temporal)
generateCitationback to summary
private String generateCitation(BibEntry entry, BibDatabaseContext databaseContext)
generateFileNameback to summary
private String generateFileName(BibEntry entry, Path targetDir)
loadLayoutback to summary
private Optional<Layout> loadLayout(String resourcePath, List<Path> fileDirForDatabase, JournalAbbreviationRepository abbreviationRepository)
renderLayoutback to summary
private Optional<String> renderLayout(BibEntry entry, BibDatabase database, List<Path> fileDirForDatabase, JournalAbbreviationRepository abbreviationRepository)

Renders entry-type-specific YAML fields using a layout file Falls back to the default layout if no type-specific layout exists

resolveDateback to summary
private Optional<String> resolveDate(BibEntry entry)
writeBibFileback to summary
private Optional<String> writeBibFile(BibEntry entry, Path outputDir, String key)

Writes a .bib file for the entry to the files directory and returns its filename.