JUL 25 - AUG 1
Script Parsing Architecture
- Plain Text Parser Base Class: Introduced a new abstract base class for all plain-text parsers to standardize parsing logic and share common utilities.
- Isolate Support: Created a generic utility to run any parser in a background isolate, which prevents the UI from blocking during intensive parsing operations.
- Parser Registry: Refactored the registry to hold parser instances directly and to determine which parsers should run in a background isolate based on their format.
- Core Data Model: The primary script data model was updated to use a flat list of
ScriptElements instead of a nested scene structure, and ametadatafield was added for extra flexibility.
New and Refactored Parsers
- FDX Parser: Refactored to use the new background isolate utility for all parsing.
- Fountain Parser: Refactored to extend the new
PlainTextParserBaseclass. - PDF Parser: The existing PDF parser was renamed, and the class now extends
PlainTextParserBaseand runs in an isolate. - RTF Parser: A new parser for RTF files was created, which extends
PlainTextParserBaseand runs in an isolate. - TXT Parser: A new parser for plain
.txtfiles was created, which also extendsPlainTextParserBase.
Domain Layer and Services
- New Data Models: Introduced several new data models, including
ScriptElement,ScriptScene,ScenePartType, andParserType, to create a more structured and robust domain layer. - Script Breakdown Service: Refactored to use the
ScriptParserRegistryto dynamically handle any script file type and return a standardizedStructuredScriptobject. - Fountain Syntax Detector: Significantly improved the logic for detecting all Fountain elements, including the addition of logic to correctly handle multi-line parentheticals.
- Scene Extractor: A new utility was created to extract a list of scenes from a flat list of script elements.
Presentation Layer (UI)
- Fountain Editor Widget: This widget underwent a major refactor and no longer contains any parsing logic. It now delegates all file imports to the
ScriptBreakdownServiceand uses a new factory to build the editor’s content directly from the list of script elements. - Document Factory: A new method was added to the factory to build a SuperEditor document directly from the new
ScriptElementlist, which is a cornerstone of the new, more efficient architecture.