Open JoshCheek opened 9 years ago
Hello! I just logged in and noticed this issue (for some reason I didn't get the email notification). This is some neat hackery :)
The idea seems sensible, but like you said, CodeRay isn't maintained: for some unknown reason Ruby people tend to use Pygments. Thanks for the detailed description, by the way.
I'm not closing this issue, but I'm letting you know that currently I don't think I'll be able to work on this due to the combination these two things: lack of time & lack of interest in such a library.
P.S. It may be unmaintained, but korny, the guy who develops it, is nice and usually responds to issues :)
Hi, had a lot of fun playing with this lib today! I basically wanted a "cat" for source code. Coderay has a binary, but it and the lib in general seem unmaintained. Looking at theirs, it didn't seem like it'd be much work, so I did it. Then I remembered this lib and figured I'd add syntax highlighting. It went really well, and I'm happy with the result :)
Because it expects Pry to be in place, I did have to do a few hacks, to get it to work:
pry-theme.rb
because it usesPry.config.hooks
, and requires all the other files, several of which depend on Pry.PryTheme.create
is in thispry-theme.rb
, so I have to copy it into my code before loading plugins https://github.com/JoshCheek/dotfiles/blob/2e31fece8735897972ec71de2e794806d66aa444/bin/cc#L172-177activate_theme_intelligently
pry-theme.rb
andwhen_started_hook.rb
, I couldn't use that code, so had to locate the files via Rubygems https://github.com/JoshCheek/dotfiles/blob/2e31fece8735897972ec71de2e794806d66aa444/bin/cc#L179-182preview.rb
uses Pry helpers for formatting output, I had to write my own preview code https://github.com/JoshCheek/dotfiles/blob/2e31fece8735897972ec71de2e794806d66aa444/bin/cc#L223-262Anyway, figured I'd bring it up. The lib seems like a great idea, and there's no reason it can't be generally available as a theming library for anything using Coderay on the console, just need to move a few things around to separate the idea of Coderay theming from Pry integration. Thanks for making this, btw :)