Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(renderer): Simplify templates (#634)
This eliminates the `ContextualPipeline`, and simplifies the templates a bit, making them hopefully much easier to read and maintain, and also to build derivatives. The templates no longer require the use of functions, for the most part. In particular the detailed rendering functions for nesting are completely hidden from the templates, instead there is just a generic `.Content` field which represents the rendered content for nested content. While here, I've added `.Roles` support in the renderer for top level block. These won't be used until the parser is updated to provide Role attributes for them though. A lot of the templates use the "sanitized" type to track the fact that they can be trusted for HTML safety. None of the tests were modified, in spite of the size of this change. This is foundation work both for future backends (ePUB, docbook), as well as further improvements to the existing rendering (for example adding support for table styling.)
- Loading branch information