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
Adding extensible, type-specific serialization for code blocks. #79
Conversation
Interesting, thanks Jared. |
A default serializer makes sense - I hadn't really settled on the best way to handle that. What I'm leaning towards right now is just a second field, "defaultSerializer" with a setter. Thoughts? Sorry about the whitespace change -- I'll rework this without that and with some tests. |
I don't think we need a second field. Rather please make the |
Sounds good. Any preferences on what the default key is? |
How about you add a static |
Got that added. Now I'm working on the test - I realized that when i was running this myself, I was overriding the |
Yes, I think that is the best of the mediocre solutions that Java let's us do here. If at some point another custom rendering component should be added we'll have to think about another design, but for the time being this will be ok. |
I think that's all there now. There is one unrelated change - in the casing of the file name for one of the tests. I can pull that out if you'd like, but I needed it to get the tests to pass. Let me know if there are any issues with style in the tests - sbt and specs2 are new to me (and my Scala experience in general is limited). |
Adding extensible, type-specific serialization for code blocks.
Thanks, Jared! |
My goal was to allow special handling of specific code blocks. I think this is a pretty succinct solution. I toyed with the idea of using the ServiceLoader to automatically load any VerbatimSerializers registered on the classpath, but decided to go the more manual route. Let me know if you want me to add some more automated extension loading -- or if you have any other questions or concerns about it.