Giter Site home page Giter Site logo

rouge-ruby / rouge Goto Github PK

View Code? Open in Web Editor NEW
3.3K 3.3K 729.0 5.24 MB

A pure Ruby code highlighter that is compatible with Pygments

Home Page: https://rouge.jneen.net/

License: Other

Ruby 96.51% Perl 0.19% Lua 0.23% MoonScript 0.05% R 0.10% HTML 0.20% Fortran 0.23% JavaScript 0.23% TypeScript 0.25% sed 1.92% Hy 0.10%
ruby syntax-highlighting

rouge's People

Contributors

aaroneg avatar abalkin avatar aldanor avatar ashmaroli avatar coffeejunk avatar dblessing avatar gfx avatar gmalecha avatar halirutan avatar japj avatar jjatria avatar jneen avatar julp avatar kitaitimakoto avatar klmr avatar lordcodes avatar michaelbaudino avatar miparnisari avatar mojavelinux avatar nsfisis avatar ole avatar pyrmont avatar radex avatar radlikewhoa avatar rumpelsepp avatar splattael avatar tancnle avatar totocaster avatar vidbina avatar zub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rouge's Issues

document lexer tags, aliases, and file associations

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.

Ruby Lexer fix

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?

Fix the handling of / in javascript

The lexer currently gets all confused between regex literals, division, and comments. Run rackup and visit /javascript to see the broken cases.

uninitialized constant Sass::COMMON - when deploying to production with Rails

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:

  • create new rails app
  • add gem 'rouge' in Gemfile
  • deploy to production server.

implement an Xresources lexer

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.