rouge-ruby / rouge Goto Github PK
View Code? Open in Web Editor NEWA pure Ruby code highlighter that is compatible with Pygments
Home Page: https://rouge.jneen.net/
License: Other
A pure Ruby code highlighter that is compatible with Pygments
Home Page: https://rouge.jneen.net/
License: Other
the current one (a port of the pygments lexer) is kind of a mess. Consider basing the lexer on https://github.com/yaml/libyaml/blob/master/src/scanner.c
Hello,
Sometimes I don't know what exact lexer tag to put on my fenced code blocks.
Please list the available lexer tags, aliases, and file extensions in the README.
For example, all of these trigger the erb lexer:
```erb
```eruby
```rhtml
Thanks for your consideration.
Rouge::Lexer.auto_detect(:fname => fname, :text => text)
Or something like that.
Hi
I've created a Middleman extension that uses Rouge and Redcarpet.
It can be found here: https://github.com/Linuus/middleman-rouge
Thanks for the library! ๐
hi there,
I have found some missuse, that exists in wrong highlighting of methods that are used on objects in ruby. It looks the same as definition name now.
I have digged in this lexer and changed this:
rule /(\.|::)([a-z_]\w*[!?]?|[*%&^`~+-\/\[<>=])/,
'Name.Function', :expr_start
to that
rule /(\.|::)([a-z_]\w*[!?]?|[*%&^`~+-\/\[<>=])/,
'Name', :expr_start
This regexp is quite complex.
What do you think, It will have other after-effects?
The lexer currently gets all confused between regex literals, division, and comments. Run rackup
and visit /javascript
to see the broken cases.
When I'm trying to deploy to production with capistrano I'm getting error from any rake command (at development it's worked like a charm, without any errors), for example:
executing "cd -- /home/deployer/apps/blog/releases/20130309092954 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile && cp -- /home/deployer/apps/blog/shared/assets/manifest.yml /home/deployer/apps/blog/releases/20130309092954/assets_manifest.yml"
at production machine (I've tried with rvm and rbenv configuration and the same error):
** [out :: ip_number] rake aborted!
** [out :: ip_number]
** [out :: ip_number] uninitialized constant Sass::COMMON
** [out :: ip_number]
with trace:
rake --trace
rake aborted!
uninitialized constant Sass::COMMON
/home/deployer/.rvm/gems/ruby-2.0.0-p0/gems/rouge-0.3.0/lib/rouge/lexers/scss.rb:28:in `<class:Scss>'
/home/deployer/.rvm/gems/ruby-2.0.0-p0/gems/rouge-0.3.0/lib/rouge/lexers/scss.rb:3:in `<module:Lexers>'
/home/deployer/.rvm/gems/ruby-2.0.0-p0/gems/rouge-0.3.0/lib/rouge/lexers/scss.rb:2:in `<module:Rouge>'
/home/deployer/.rvm/gems/ruby-2.0.0-p0/gems/rouge-0.3.0/lib/rouge/lexers/scss.rb:1:in `<top (required)>'
/home/deployer/.rvm/gems/ruby-2.0.0-p0/gems/rouge-0.3.0/lib/rouge.rb:41:in `load'
/home/deployer/.rvm/gems/ruby-2.0.0-p0/gems/rouge-0.3.0/lib/rouge.rb:41:in `block in <top (required)>'
/home/deployer/.rvm/gems/ruby-2.0.0-p0/gems/rouge-0.3.0/lib/rouge.rb:41:in `each'
/home/deployer/.rvm/gems/ruby-2.0.0-p0/gems/rouge-0.3.0/lib/rouge.rb:41:in `<top (required)>'
/home/deployer/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.1/lib/bundler/runtime.rb:72:in `require'
/home/deployer/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.1/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
/home/deployer/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.1/lib/bundler/runtime.rb:70:in `each'
/home/deployer/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.1/lib/bundler/runtime.rb:70:in `block in require'
/home/deployer/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.1/lib/bundler/runtime.rb:59:in `each'
/home/deployer/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.1/lib/bundler/runtime.rb:59:in `require'
/home/deployer/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.1/lib/bundler.rb:132:in `require'
/home/deployer/apps/blog/releases/20130307182408/config/application.rb:7:in `<top (required)>'
/home/deployer/apps/blog/releases/20130307182408/Rakefile:5:in `require'
/home/deployer/apps/blog/releases/20130307182408/Rakefile:5:in `<top (required)>'
/home/deployer/.rvm/gems/ruby-2.0.0-p0@global/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load'
/home/deployer/.rvm/gems/ruby-2.0.0-p0@global/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load_rakefile'
/home/deployer/.rvm/gems/ruby-2.0.0-p0@global/gems/rake-10.0.3/lib/rake/application.rb:583:in `raw_load_rakefile'
/home/deployer/.rvm/gems/ruby-2.0.0-p0@global/gems/rake-10.0.3/lib/rake/application.rb:89:in `block in load_rakefile'
/home/deployer/.rvm/gems/ruby-2.0.0-p0@global/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/home/deployer/.rvm/gems/ruby-2.0.0-p0@global/gems/rake-10.0.3/lib/rake/application.rb:88:in `load_rakefile'
/home/deployer/.rvm/gems/ruby-2.0.0-p0@global/gems/rake-10.0.3/lib/rake/application.rb:72:in `block in run'
/home/deployer/.rvm/gems/ruby-2.0.0-p0@global/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/home/deployer/.rvm/gems/ruby-2.0.0-p0@global/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
/home/deployer/.rvm/gems/ruby-2.0.0-p0@global/gems/rake-10.0.3/bin/rake:33:in `<top (required)>'
/home/deployer/.rvm/gems/ruby-2.0.0-p0/bin/rake:19:in `load'
/home/deployer/.rvm/gems/ruby-2.0.0-p0/bin/rake:19:in `<main>'
/home/deployer/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `eval'
/home/deployer/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `<main>'
I'm deploying with capistrano 2.14.2 to Ubuntu 12.10x64 with ruby 2.0.0-p0 (ruby 1.9.3-p392 the same issue) using rails 3.2.12 with rake 10.0.3 and bundler 1.3.1(1.3.2 the same).
To reproduce:
bonus points if it highlights the right builtins :)
Hello,
Please implement an Xresources
lexer for the syntax described here. This lexer should have these aliases: xresources
, xdefaults
, Xdefaults
and xrdb
.
Also, it would be cool if you could highlight hex color strings using their values. For example, #FF0000
would show up as <span style="background:#FF0000">#FF0000</span>
with a legible (automatically calculated) foreground color. Similarly, highlighting X11 color names would also be helpful! ๐บ
Thanks for your consideration.
Hello,
Please add support for word-level change markers in the diff
lexer:
[-
deletion -]
{+
insertion +}
You may find these related programs to be of reference:
Thanks for your consideration.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.