feat: optimize reader caching and document formats
This commit is contained in:
@@ -18,6 +18,18 @@ public final class RDEpubPlainTextBookBuilder {
|
||||
style: RDEPUBTextRenderStyle
|
||||
) throws -> RDEPUBTextBook {
|
||||
let rawText = rd_decodeTextFile(url: textFileURL)
|
||||
return try build(text: rawText, pageSize: pageSize, style: style)
|
||||
}
|
||||
|
||||
/// Builds a paginated book from text already held in memory. This is used
|
||||
/// by container formats such as MOBI, whose text does not exist as a
|
||||
/// standalone file on disk.
|
||||
public func build(
|
||||
text: String,
|
||||
pageSize: CGSize,
|
||||
style: RDEPUBTextRenderStyle
|
||||
) throws -> RDEPUBTextBook {
|
||||
let rawText = text
|
||||
let chapterSpecs = splitChapters(from: rawText)
|
||||
|
||||
var chapters: [RDEPUBTextChapter] = []
|
||||
|
||||
Reference in New Issue
Block a user