Replies: 1 comment 1 reply
-
Torchlight would be a challenging integration for us to implement. As Torchlight is an external service that would need to be integrated in the build process, the Retype App would need to make external calls to the Torchlight service in order to fetch each formatted code block. That would significantly slow down the build process. That process would also break a fundamental goal of Retype that the app does not (cannot) make external calls. Everything needs to be self contained within the Retype App. There are options, but it would take a good bit of work to implement any of these:
A component For instance, while parsing, if Retype found a code block component, the code within that code block would be sent to Torchlight and Torchlight would return the final HTML that Retype would then inject into the finished document, instead of Retype generating the Prism syntax highlighter requirements. This is possible and the most flexible, but it would be a major project and take time to implement. Time and human resources that we do not have right now. Hitting the max 5000 requests per month limit of Torchlight seems like it would be very easy to do with that kind of Retype integration. Of course we could try building in some kind of caching mechanism to avoid sending code blocks that had already been previously compiled and had not changed, but that brings even more complexity. Good:
Bad:
Basically this means building our own Torchlight like service, but integrated directly into Retype. Use the same tech as Torchlight but not calling an external service. Good:
Bad:
I'm sure that are more scenarios and not just these two ideas. I'll keep this thread updated with other options as they come to me. Those are just a few of my thoughts on Torchlight integration. Certainly not saying no, but just doesn't seem feasible or necessary at the moment. Thoughts? |
Beta Was this translation helpful? Give feedback.
-
I suggest making Torchlight an optional choice for code block syntax highlighting.
Right now, there is currently one theme of choice when using Retype. Granted this is not "bad" I think with the planned changes for variables etc. we see a future of more customization to Retype, so this would be a nice addition.
Furthermore, Torchlight introduces proper syntax highlighting for all languages.
Torchlight has a pricing for commercial use. However, if it's up to the user of Retype to provide their own API key and having Torchlight being an optional choice, I assume this could be prevented?
Configuration could be something along the lines of this in
retype.yml
(Following the current project configuration it would either make sense to throw it under
snippets
orintegrations
).This however will expose the API key since
retype.yml
is comitted to a git repo usually. Would it perhaps be neccesary to implement the ability to load.env
vars into theretype.yml
file at this point? Or would this very quickly add a lot of complexity for something that should be simple?Beta Was this translation helpful? Give feedback.
All reactions