Open tim-evans opened 4 years ago
This is an idea I had for this: https://gist.github.com/tim-evans/0893e956afc460cc53b9e0387d3e6ba3
I'm not sure how to extrapolate this code into a renderer, though...
here's an approach at how the renderer version of this might look in a simple case: https://gist.github.com/colinarobinson/69027d2e48a056c3f145e67ad8587043
Conceptually, renderers are a more general case of converters, being essentially a function from a document to any type. With the idea from https://github.com/CondeNast/atjson/issues/285 of adding additional safeguards and guarantees around renderer implementations, writing converters as renderers could help ensure that the converter satisfies some useful properties such as handling all the possible annotations in the source document.
(Written by @colinarobinson ❤️)