-
Notifications
You must be signed in to change notification settings - Fork 499
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
Add support for the Rouge syntax highlighter #247
Comments
- add integration with rouge - organize the code to setup syntax highlighting - don't crash if color value is 3-digit hex in span style
Before merging, I'd like to implement a Prawn formatter that creates text fragments directly to avoid having to parse the generated HTML. This is similar to what we've done for CodeRay. |
And once that is done, I think we should just drop support for Coderay and map the "coderay" source highlighter value to Rouge. |
- add integration with Rouge - organize the code to setup syntax highlighting - enable line number support when highlighting with Rouge - add pastie theme for Rouge - patch Rouge style lookup (see rouge-ruby/rouge#280) - don't crash if color value is 3-digit hex in span style
- add integration with Rouge for highlighting source listings - organize the code to setup source highlighting - enable line number support when highlighting with Rouge - add pastie theme for Rouge - patch Rouge style lookup (see rouge-ruby/rouge#280)
Prawn formatter implemented. I also implemented support for line numbers (with primitive, but sufficient, output). |
- add integration with Rouge for highlighting source listings - organize the code to setup source highlighting - enable line number support when highlighting with Rouge - add pastie theme for Rouge - patch Rouge style lookup (see rouge-ruby/rouge#280)
- add integration with Rouge for highlighting source listings - organize the code to setup source highlighting - enable line number support when highlighting with Rouge - add pastie theme for Rouge - patch Rouge style lookup (see rouge-ruby/rouge#280)
All that's really left to do is allow the start number to be customized when line numbers are enabled. |
We have to add a trailing endline or else certain highlighting rules don't take affect on the last line. (See rouge-ruby/rouge#279). Although this endline is benign in Prawn, we could strip it out before applying the formatting using the following code: tokens = tokens.entries
if (last_token = tokens_a[-1])
if (last_val = last_token[-1]) == EOL
tokens.pop
else
last_token[-1] = last_val.chomp
end
end |
- add integration with Rouge for highlighting source listings - organize the code to setup source highlighting - enable line number support when highlighting with Rouge - add pastie theme for Rouge - patch Rouge style lookup (see rouge-ruby/rouge#280)
- add integration with Rouge for highlighting source listings - organize the code to setup source highlighting - enable line number support when highlighting with Rouge - add pastie theme for Rouge - patch Rouge style lookup (see rouge-ruby/rouge#280)
👍 on Rogue highlighter |
I'd like to do some side-by-side comparison of real-world code snippets to see how good a job Rouge does vs CodeRay and Pygments. I've got a bunch of repositories cloned, so I'll do a quick scan and see what comes up. If you're following this issue, free to test on any snippets you have to see if any deficiency come up in Rouge. |
- add integration with Rouge for highlighting source listings - guard indentation within Rouge formatter - organize the code to setup source highlighting - enable line number support when highlighting with Rouge - add pastie theme for Rouge - patch Rouge style lookup (see rouge-ruby/rouge#280)
- add integration with Rouge for highlighting source listings - use no-break space for indent guard instead of zero-width space - guard indentation within Rouge formatter - organize the code to setup source highlighting - enable line number support when highlighting with Rouge - add pastie theme for Rouge - patch Rouge style lookup (see rouge-ruby/rouge#280) - cast lookup collections to set - optimize code
- add integration with Rouge for highlighting source listings - use no-break space for indent guard instead of zero-width space - guard indentation within Rouge formatter - organize the code to setup source highlighting - enable line number support when highlighting with Rouge - add pastie theme for Rouge - patch Rouge style lookup (see rouge-ruby/rouge#280) - cast lookup collections to set - optimize code
- add integration with Rouge for highlighting source listings - use no-break space for indent guard instead of zero-width space - guard indentation within Rouge formatter - organize the code to setup source highlighting - enable line number support when highlighting with Rouge - add pastie theme for Rouge - patch Rouge style lookup (see rouge-ruby/rouge#280) - cast lookup collections to set - optimize code
- add integration with Rouge for highlighting source listings - use no-break space for indent guard instead of zero-width space - guard indentation within Rouge formatter - organize the code to setup source highlighting - enable line number support when highlighting with Rouge - add pastie theme for Rouge - patch Rouge style lookup (see rouge-ruby/rouge#280) - cast lookup collections to set - optimize code
- add integration with Rouge for highlighting source listings - use no-break space for indent guard instead of zero-width space - guard indentation within Rouge formatter - organize the code to setup source highlighting - enable line number support when highlighting with Rouge - add pastie theme for Rouge - patch Rouge style lookup (see rouge-ruby/rouge#280) - cast lookup collections to set - optimize code
resolves #247 add support for the Rouge source highlighter
Allow the use of the Rouge syntax highlighter by setting the value of the
source-highlighter
attribute torouge
.The text was updated successfully, but these errors were encountered: