Package mekhq.campaign.roleplay
Class JournalArchive
java.lang.Object
mekhq.campaign.roleplay.JournalArchive
Reads journals back in from exported Markdown files.
A Markdown export ends with a hidden comment holding the entries exactly as saved, with their tags, answers and checks, so importing it loses nothing. Markdown renderers do not show the comment. Files exported before the comment existed are read from their text instead: each "## date - type" heading starts an entry, and notes are converted back from Markdown.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordWhat an import found.static final recordWhat an import added. -
Method Summary
Modifier and TypeMethodDescriptionstatic JournalArchive.ImportResultimportInto(Roleplay roleplay, JournalArchive.Archive archive, int maximumRecords) Adds an archive's entries to a campaign's journal.static JournalArchive.ArchiveReads an exported journal.
-
Method Details
-
read
Reads an exported journal.- Parameters:
document- the file's textdateParser- reads a date as the export wrote it, for files without the hidden data- Returns:
- what was found; empty if the file holds no entries
-
importInto
public static JournalArchive.ImportResult importInto(Roleplay roleplay, JournalArchive.Archive archive, int maximumRecords) Adds an archive's entries to a campaign's journal. Entries the journal already has (same date, type and text) are skipped. Tags are matched to this campaign's threads and cast by id, then by name; a thread tag that matches neither is dropped, and a cast member who matches neither is added to the cast as removed, so the tag is kept.- Parameters:
roleplay- the campaign's roleplay statearchive- what to importmaximumRecords- the Oracle log's size limit- Returns:
- what was added
-