-
Notifications
You must be signed in to change notification settings - Fork 112
Support word wrapping for HTML encoder #100
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
Comments
@korny Have you had a chance to look at this mockup? Do you have any interest in supporting this feature in CodeRay? I could attempt to do this as an external gem, but to do it well, I think the lexers would need to be revised. The encoder wants to know if there can be a soft-wrap (before or) after a given token, which is specific to the language. Often we can wrap the line while keeping the code valid, eg. after a After a variable we can't line wrap, nor should the space(s) after it cause a break. Eg. say Interested in your thoughts. |
Mmh, interesting. Seems to work differently in Firefox and Safari, but I'm not sure I completely understand what it's doing ;) Two things:
|
By the way, I'm warming up to Solarized, only the red operators are a weird choice… |
I've yet to write out the details of how this works. It's still experimental, and failing entirely in IE9. Use of Ripper and Solarized styles are of course orthogonal to this particular encoder. |
I discovered a better way to do wrapping. Rather than my zwsp (zero width space) with a bunch of CSS, we can just use a At the most basic level, if there is a word separator (eg. The stuff I was doing with I was also experimenting with hanging indents, which are nice, but still have some problems. Right now I'm using CSS for indentation, without any spaces for copy & paste. That would necessitate a Gist-style Still interested? I have yet to do a more thorough writeup. |
Yes, very. It could be a wonderful "wow"-feature for any highlighter (and sure be copied by others) – if we get it to work on IE, too. So the idea would be to use Also, how can you add that functionality to scanners without cluttering the already-complex logic? Would it be easier with a DSL like Rouge/Pygments? |
The only example I have so far is the mockup at http://www.tint.io/. I added you as a collaborator to my tint-web repo, if you want to see the hacky code behind it. I'd like to start simple, and add basic wrapping, then hanging indents, and finally maybe look at lexer-specific line continuations. |
When viewing code on a small screen or with a large font, it's nice to have word-wrapping rather than panning around. Ideally this word wrapping would adhere to the rules of the language in question to make it more readable.
I've done some research and a mockup.
While I'm happy to continue this little experiment on my own, I'm curious as to what would be involved in incorporating it into CodeRay and supporting multiple languages? :-D
The text was updated successfully, but these errors were encountered: