RevisionRenderer is a stateless service for generating a ParserOutput object for a given RevisionRecord. The output should combine all slots.
The service should eventually also support single-slot mode, user-specific vs canonical rendering, and previews. In a first iteration, it only needs to support one method:
- renderRevision( RevisionRecord $revRec, ParserOptions $options ): RenderedRevison;
RenderedRevision would in turn support at least:
- getCombinedParserOutput()
- getRevision()
- maybe also getSlotParserOutput( $role ).
All ParserOutputs should be cached locally. The ParserOptions to be used would be injected into the constructor of RenderedRevision by RevisionRenderer::renderRevision().
For the first version, it's sufficient for getCombinedParserOutput to concatenate the output for all slots, with the main slot going first, possibly with a heading for all but the main slot.
In later iterations, SlotRoleHandlers should provide layout hints that can cause the output for some slots to be placed differently.