Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiment with converters as renderers #286

Open
tim-evans opened this issue Nov 11, 2019 · 2 comments
Open

Experiment with converters as renderers #286

tim-evans opened this issue Nov 11, 2019 · 2 comments
Assignees

Comments

@tim-evans
Copy link
Collaborator

tim-evans commented Nov 11, 2019

Conceptually, renderers are a more general case of converters, being essentially a function from a document to any type. With the idea from #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 ❤️)

@tim-evans
Copy link
Collaborator Author

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...

@colin-alexa
Copy link
Contributor

here's an approach at how the renderer version of this might look in a simple case: https://gist.github.com/colinarobinson/69027d2e48a056c3f145e67ad8587043

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants