-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
[Feature Request] Syntax Highlighting #16
Comments
Hi @mattbisme, thanks! Super glad to hear you're finding it smooth. About the syntax highlighting, I've been wanting to add that feature since day one. Right now, there isn't a native solution that fits perfectly. There's a workaround using JS, but I'm a bit cautious about how it might affect performance. But, I'm up for experimenting to see how it goes 😃 |
Is this a Swift issue, or an Ollama issue? I'm surprised that there isn't a Swift native solution. I did notice that Ollama doesn't specify named code blocks when generating in the CLI. That is, instead of starting a code block with something like
it just has the lone tick marks without For what it's worth, Safari has hardware accelerated JS. Does that apply to JS used in a Swift app as well? I can't imagine that it's as performant as native Swift, but, if there is really no other option… I assume it be possible to only activate the syntax highlighting when a code block is generated? |
Most Swift code highlighters I've found are JavaScript-based, like Highlight.js. And yes, Ollama also doesn't specify the language in code blocks, likely due to a model limitation.
Yes, the performance benefits of Apple's JavaScriptCore do apply to JavaScript used within a Swift app.
Yes, it is indeed possible to activate syntax highlighting only when a code block is generated. I'm still experimenting with this and also keeping an eye on the performance metrics. It's an ongoing process, but I'm making progress! 😃 |
I noticed that when using |
I did tryto add the syntax highlighting, it worked fine but only for swift code since I was using a swift method to do it.. |
Just tried out Ollamac for the first time. Wow, is it smooth! I'll never use a browser UI again! Having said that, it would be great to see some syntax highlighting for code blocks, if that's possible.
The text was updated successfully, but these errors were encountered: