From 5bec472f7d0b0d6223e092f2fba82eaee4de2507 Mon Sep 17 00:00:00 2001 From: Michael Camilleri Date: Tue, 23 Jul 2019 09:51:35 +0900 Subject: [PATCH 1/8] Update README This commit updates the content of the README. --- README.md | 274 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 181 insertions(+), 93 deletions(-) diff --git a/README.md b/README.md index 283d184afb..44db85eef6 100644 --- a/README.md +++ b/README.md @@ -4,22 +4,30 @@ [![Gem Version](https://badge.fury.io/rb/rouge.svg)](https://rubygems.org/gems/rouge) [![YARD Docs](http://img.shields.io/badge/yard-docs-blue.svg)](https://rouge-ruby.github.io/docs/) -[rouge]: http://rouge.jneen.net/ -[Rouge][] is a pure-ruby syntax highlighter. It can highlight 100 different languages, and output HTML or ANSI 256-color text. Its HTML output is compatible with stylesheets designed for [pygments][]. +[Rouge][] is a pure Ruby syntax highlighter. It can highlight over 100 different +languages, and output HTML or ANSI 256-color text. Its HTML output is +compatible with stylesheets designed for [Pygments][]. -If you'd like to help out with this project, assign yourself something from the [issues][] page, and send me a pull request (even if it's not done yet!). Bonus points for feature branches. +[Rouge]: http://rouge.jneen.net/ "Rouge" -[issues]: https://github.com/rouge-ruby/rouge/issues "Help Out" -[pygments]: http://pygments.org/ "Pygments" +[Pygments]: http://pygments.org "Pygments" ## Usage -First, take a look at the [pretty colors][]. +Rouge's most common uses are as a Ruby library, as part of Jekyll and as a +command line tool. -[pretty colors]: http://rouge.jneen.net/ +### Ways to Use + +#### Library + +Here's a quick example of using Rouge as you would any other regular Ruby +library: ``` ruby +require 'rouge' + # make some nice lexed html source = File.read('/etc/bashrc') formatter = Rouge::Formatters::HTML.new @@ -32,143 +40,219 @@ Rouge::Themes::Base16.mode(:light).render(scope: '.highlight') Rouge::Theme.find('base16.light').render(scope: '.highlight') ``` -### Full options +#### Jekyll + +**Note**: If you're using GitHub Pages, you're stuck with [version +2.2.1][ghp-versions] of Rouge. Although GitHub Page uses an up to date version +of Jekyll, it locks the version of Rouge. There is [an open issue][ghp-issue] to +upgrade this to a more current release. + +[ghp-versions]: https://pages.github.com/versions/ "Version of the dependencies +used by GitHub Pages" + +[ghp-issue]: https://github.com/github/pages-gem/issues/601 "pages-gem Issue +#601" -#### Formatters +Rouge is Jekyll's default syntax highlighter. Out of the box, Rouge will be +used to highlight text wrapped in the `{% highlight %}` template tags. The +`{% highlight %}` tag provides minimal options: you can specify the language to +use and whether to enable line numbers or not. More information is available in +[the Jekyll docs][j-docs]. -As of Rouge 2.0, you are encouraged to write your own formatter for custom formatting needs. -Builtin formatters include: +[j-docs]: https://jekyllrb.com/docs/liquid/tags/#code-snippet-highlighting "Code +snippet highlighting in the Jekyll documentation" + +#### Command Line + +Rouge ships with a `rougify` command which allows you to easily highlight files +in your terminal: + +``` shell +$ rougify foo.rb +$ rougify style monokai.sublime > syntax.css +``` -* `Rouge::Formatters::HTML.new` - will render your code with standard class names for tokens, - with no div-wrapping or other bells or whistles. -* `Rouge::Formatters::HTMLInline.new(theme)` - will render your code with no class names, but - instead inline the styling options into the `style=` attribute. This is good for emails and - other systems where CSS support is minimal. -* `Rouge::Formatters::HTMLLinewise.new(formatter, class: 'line-%i')` - This formatter will split your code into lines, each contained in its own div. The - `class` option will be used to add a class name to the div, given the line - number. -* `Rouge::Formatters::HTMLLineTable.new(formatter, opts={})` will output an HTML table containing - numbered lines, each contained in its own table-row. Options are: +### API Documentation + +Rouge's documentation is available at [rouge-ruby.github.io/docs][docs]. + +[docs]: https://rouge-ruby.github.io/docs "Rouge's official documentation" + +## Configuration + +### Formatters + +Rouge comes with a number of formatters built-in but as of Rouge 2.0, you are +encouraged to write your own formatter if you need something custom. + +The built-in formatters are: + +* `Rouge::Formatters::HTML.new` will render your code with standard class names + for tokens, with no div-wrapping or other bells or whistles. + +* `Rouge::Formatters::HTMLInline.new(theme)` will render your code with no class + names, but instead inline the styling options into the `style=` attribute. + This is good for emails and other systems where CSS support is minimal. + +* `Rouge::Formatters::HTMLLinewise.new(formatter, class: 'line-%i')` will split + your code into lines, each contained in its own div. The `class` option will + be used to add a class name to the div, given the line number. + +* `Rouge::Formatters::HTMLLineTable.new(formatter, opts={})` will output an HTML + table containing numbered lines, each contained in its own table-row. Options + are: * `start_line: 1` - the number of the first row - * `line_id: 'line-%i'` - a `sprintf` template for `id` attribute with current line number + * `line_id: 'line-%i'` - a `sprintf` template for `id` attribute with + current line number * `line_class: 'lineno'` - a CSS class for each table-row * `table_class: 'rouge-line-table'` - a CSS class for the table * `gutter_class: 'rouge-gutter'` - a CSS class for the line-number cell * `code_class: 'rouge-code'` - a CSS class for the code cell -* `Rouge::Formatters::HTMLPygments.new(formatter, css_class='codehilite')` - wraps the given formatter with div wrappers generally expected by stylesheets designed for - Pygments. -* `Rouge::Formatters::HTMLTable.new(formatter, opts={})` will output an HTML table containing - numbered lines. Options are: + +* `Rouge::Formatters::HTMLPygments.new(formatter, css_class='codehilite')` wraps + the given formatter with div wrappers generally expected by stylesheets + designed for Pygments. + +* `Rouge::Formatters::HTMLTable.new(formatter, opts={})` will output an HTML + table containing numbered lines. Options are: * `start_line: 1` - the number of the first line * `line_format: '%i'` - a `sprintf` template for the line number itself * `table_class: 'rouge-table'` - a CSS class for the table * `gutter_class: 'rouge-gutter'` - a CSS class for the gutter * `code_class: 'rouge-code'` - a CSS class for the code column -* `Rouge::Formatters::HTMLLegacy.new(opts={})` is a backwards-compatibility class intended - for users of rouge 1.x, with options that were supported then. Options are: + +* `Rouge::Formatters::HTMLLegacy.new(opts={})` is a backwards-compatibile class + intended for users of Rouge 1.x, with options that were supported then. + Options are: * `inline_theme: nil` - use an HTMLInline formatter with the given theme * `line_numbers: false` - use an HTMLTable formatter * `wrap: true` - use an HTMLPygments wrapper - * `css_class: 'codehilite'` - a CSS class to use for the pygments wrapper -* `Rouge::Formatters::Terminal256.new(theme)` - * `theme` must be an instnce of `Rouge::Theme`, or a `Hash` structure with `:theme` entry + * `css_class: 'codehilite'` - a CSS class to use for the Pygments wrapper -#### Lexer options -##### debug: false -Print a trace of the lex on stdout +* `Rouge::Formatters::Terminal256.new(theme)` is a formatter for generating + highlighted text for use in the terminal. `theme` must be an instance of + `Rouge::Theme`, or a `Hash` structure with `:theme` entry. -##### parent: '' -Allows you to specify which language the template is inside +### Lexer Options -#### CSS theme options -##### scope: '.highlight' -CSS selector that styles are applied to, e.g. `Rouge::Themes::MonokaiSublime.render(scope: 'code')` +* `debug: false` will print a trace of the lex on stdout. -Rouge aims to be simple to extend, and to be a drop-in replacement for pygments, with the same quality of output. Also, Rouge ships with a `rougify` command which allows you to easily highlight files in your terminal: +* `parent: ''` allows you to specify which language the template is inside. -``` bash -$ rougify foo.rb -$ rougify style monokai.sublime > syntax.css -``` +### CSS Options + +* `scope: '.highlight'` sets the CSS selector to which styles are applied, eg. + ``` ruby + `Rouge::Themes::MonokaiSublime.render(scope: 'code')` + ``` + +## Comparisons + +Rouge aims to be simple to extend and to be a drop-in replacement for Pygments. +It stacks up well in comparison to other Ruby libraries. + +### pygments.rb + +In comparison to [pygments.rb][]: + +[pygments.rb]: https://github.com/tmm1/pygments.rb "pygments.rb repository on +GitHub" + +* no need to spawn Python processes; and +* Rouge is faster in [almost every measure][comp]. -### Advantages to pygments.rb -* No need to [spawn Python processes](https://github.com/tmm1/pygments.rb). -* We're faster in [almost every measure](https://github.com/rouge-ruby/rouge/pull/41#issuecomment-223751572) +[comp]: https://github.com/rouge-ruby/rouge/pull/41#issuecomment-223751572 +"Comparison with pygments.rb" -### Advantages to CodeRay -* The HTML output from Rouge is fully compatible with stylesheets designed for pygments. -* The lexers are implemented with a dedicated DSL, rather than being hand-coded. +### CodeRay + +In comparison to [CodeRay][]: + +* HTML output from Rouge is fully compatible with stylesheets designed for + Pygments; +* lexers are implemented with a dedicated DSL, rather than being hand-coded; and * Rouge supports every language CodeRay does and more. -## You can even use it with Redcarpet +[CodeRay]: https://github.com/rubychan/coderay "CodeRay repository on GitHub" -``` ruby -require 'redcarpet' -require 'rouge' -require 'rouge/plugins/redcarpet' +## Requirements -class HTML < Redcarpet::Render::HTML - include Rouge::Plugins::Redcarpet # yep, that's it. -end -``` +### Ruby -If you have `:fenced_code_blocks` enabled, you can specify languages, and even options with CGI syntax, like `php?start_inline=1`, or `erb?parent=javascript`. +Rouge is compatible with all versions of Ruby from 2.0.0 onwards. It has no +external dependencies. -## Encodings +### Encodings -Rouge is only for UTF-8 strings. If you'd like to highlight a string with a different encoding, please convert it to UTF-8 first. +Rouge only supports UTF-8 strings. If you'd like to highlight a string with a +different encoding, please convert it to UTF-8 first. -## Other integrations +## Integrations -* Middleman: [middleman-syntax](https://github.com/middleman/middleman-syntax) (@bhollis) -* Middleman: [middleman-rouge][] (@Linuus) +* Middleman: + * [middleman-syntax][] (@bhollis) + * [middleman-rouge][] (@Linuus) * RDoc: [rdoc-rouge][] (@zzak) -* Rouge::Rails: [render code samples in your rails views][rouge-rails] (@jacobsimeon) +* Rails: [Rouge::Rails][] (@jacobsimeon) +[middleman-syntax]: https://github.com/middleman/middleman-syntax [middleman-rouge]: https://github.com/Linuus/middleman-rouge [rdoc-rouge]: https://github.com/zzak/rdoc-rouge -[rouge-rails]: https://github.com/jacobsimeon/rouge-rails +[Rouge::Rails]: https://github.com/jacobsimeon/rouge-rails ## Contributing -### Bug reports - -Rouge uses GitHub issues to report bugs. You can [choose][issue-chooser] from one of our templates or create a custom issue. Issues that have not been active for a year are automatically closed by GitHub's [Probot][]. +We're always exited to welcome new contributors to Rouge. By it's nature, a +syntax highlighter relies for its success on submissions from users of the +languages being highlighted. You can help Rouge by filing bug reports or +developing new lexers. -[issue-chooser]: https://github.com/rouge-ruby/rouge/issues/new/choose "Issue Template Chooser" -[Probot]: https://probot.github.io "GitHub's Probot" +### Bug Reports -### Installing Ruby +Rouge uses GitHub's Issues to report bugs. You can [choose][issue-chooser] from +one of our templates or create a custom issue. Issues that have not been active +for a year are automatically closed by GitHub's [Probot][]. -If you're here to implement a lexer for your awesome language, there's a good chance you don't already have a ruby development environment set up. Follow the [instructions on the wiki](https://github.com/rouge-ruby/rouge/wiki/Setting-up-Ruby) to get up and running. If you have trouble getting set up, let me know - I'm always happy to help. +[issue-chooser]: https://github.com/rouge-ruby/rouge/issues/new/choose "Choose +an issue from the templates" -### Run the tests +[Probot]: https://probot.github.io "Read more about GitHub's Probot" -You can test the core of Rouge simply by running `rake` (no `bundle exec` required). You can also run a single test file by -setting the `TEST` environment variable to the path of the desired test. For example, to test just the *`ruby` lexer* which is -at path, `spec/lexers/ruby_spec.rb` within the repository, one may simply run the following: +### Developing Lexers -```sh -TEST=spec/lexers/ruby_spec.rb rake -``` +**Note**: Please don't submit lexers that are copy-pasted from other files. +These submission will be rejected and we don't want you to waste your time. -It's also set up with `guard`, if you like. +We want to make it as easy as we can for anyone to contribute a lexer to Rouge. +To help get you started, we have [a shiny new guide][lexer-dev-doc] on lexer +development in the documentation. The best place is to start there. -To test a lexer visually, run `rackup` from the root and go to `localhost:9292/#{some_lexer}` where `some_lexer` is the tag or an alias of a lexer you'd like to test. If you add `?debug=1`, helpful debugging info will be printed on stdout. +[lexer-dev-doc]: https://rouge-ruby.github.io/docs/file.LexerDevelopment.html +"Rouge's lexer development guide" -### API Documentation +If you get stuck and need help, submit a pull request with what you have and +make it clear in your submission that the lexer isn't finished yet. We'll do our +best to answer any questions you have and sometimes the best way to do that is +with actual code. -is at https://rouge-ruby.github.io/docs/. +### Testing Rouge -### Developing lexers +Once you've cloned the repository from GitHub, you can test the core of Rouge +simply by running `rake` (no `bundle exec` required). You can also run a single +test file by setting the `TEST` environment variable to the path of the desired +test. For example, to test just the *`ruby` lexer* (located at path +`spec/lexers/ruby_spec.rb`) simply run the following: -We have [a guide][lexer-dev-doc] on lexer development in the documentation but you'll also learn a lot by reading through the existing lexers. +``` shell +$ TEST=spec/lexers/ruby_spec.rb rake +``` -[lexer-dev-doc]: https://rouge-ruby.github.io/docs/file.LexerDevelopment.html +To test a lexer visually, run `rackup` from the top-level working directory and +you should have a web server running and ready to go. Visit + to see the full list of Rouge's lexers. -Please don't submit lexers that are largely copy-pasted from other files. +Once you've selected a particular lexer, you can add `?debug=1` to your URL +string to see a lot of helpful debugging info printed on stdout. ## Versioning @@ -178,8 +262,12 @@ Rouge uses [Semantic Versioning 2.0.0][sv2]. ## Tips -I don't get paid to maintain rouge. If you've found this software useful, consider dropping a tip in the [bucket](http://cash.me/$jneen). +I don't get paid to maintain rouge. If you've found this software useful, +consider dropping a tip in the [bucket][cashme]. + +[cashme]: http://cash.me/$jneen "Jeanine Adkisson's Cash App page" ## License -Rouge is released under the MIT license. Please see the `LICENSE` file for more information. +Rouge is released under the MIT license. Please see the `LICENSE` file for more +information. From 070a9994569058c61af5296bad1b442821c91910 Mon Sep 17 00:00:00 2001 From: Michael Camilleri Date: Thu, 25 Jul 2019 03:54:52 +0900 Subject: [PATCH 2/8] Add express note paragraph blocks --- README.md | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 44db85eef6..e932dee6ee 100644 --- a/README.md +++ b/README.md @@ -42,16 +42,18 @@ Rouge::Theme.find('base16.light').render(scope: '.highlight') #### Jekyll -**Note**: If you're using GitHub Pages, you're stuck with [version -2.2.1][ghp-versions] of Rouge. Although GitHub Page uses an up to date version -of Jekyll, it locks the version of Rouge. There is [an open issue][ghp-issue] to -upgrade this to a more current release. +

+ If you're using GitHub Pages, you're stuck with [version 2.2.1][ghp-versions] + of Rouge. Although GitHub Page uses an up to date version of Jekyll, it locks + the version of Rouge. There is [an open issue][ghp-issue] to upgrade this to + a more current release. +

-[ghp-versions]: https://pages.github.com/versions/ "Version of the dependencies -used by GitHub Pages" +[ghp-versions]: https://pages.github.com/versions/ +"Version of the dependencies used by GitHub Pages" -[ghp-issue]: https://github.com/github/pages-gem/issues/601 "pages-gem Issue -#601" +[ghp-issue]: https://github.com/github/pages-gem/issues/601 +"pages-gem Issue #601" Rouge is Jekyll's default syntax highlighter. Out of the box, Rouge will be used to highlight text wrapped in the `{% highlight %}` template tags. The @@ -59,8 +61,8 @@ used to highlight text wrapped in the `{% highlight %}` template tags. The use and whether to enable line numbers or not. More information is available in [the Jekyll docs][j-docs]. -[j-docs]: https://jekyllrb.com/docs/liquid/tags/#code-snippet-highlighting "Code -snippet highlighting in the Jekyll documentation" +[j-docs]: https://jekyllrb.com/docs/liquid/tags/#code-snippet-highlighting +"Code snippet highlighting in the Jekyll documentation" #### Command Line @@ -72,12 +74,6 @@ $ rougify foo.rb $ rougify style monokai.sublime > syntax.css ``` -### API Documentation - -Rouge's documentation is available at [rouge-ruby.github.io/docs][docs]. - -[docs]: https://rouge-ruby.github.io/docs "Rouge's official documentation" - ## Configuration ### Formatters @@ -142,10 +138,17 @@ The built-in formatters are: ### CSS Options * `scope: '.highlight'` sets the CSS selector to which styles are applied, eg. + ``` ruby - `Rouge::Themes::MonokaiSublime.render(scope: 'code')` + Rouge::Themes::MonokaiSublime.render(scope: 'code') ``` +## Documentation + +Rouge's documentation is available at [rouge-ruby.github.io/docs/][docs]. + +[docs]: https://rouge-ruby.github.io/docs "Rouge's official documentation" + ## Comparisons Rouge aims to be simple to extend and to be a drop-in replacement for Pygments. @@ -220,8 +223,10 @@ an issue from the templates" ### Developing Lexers -**Note**: Please don't submit lexers that are copy-pasted from other files. -These submission will be rejected and we don't want you to waste your time. +

+ Please don't submit lexers that are copy-pasted from other files. These + submissions will be rejected and we don't want you to waste your time. +

We want to make it as easy as we can for anyone to contribute a lexer to Rouge. To help get you started, we have [a shiny new guide][lexer-dev-doc] on lexer From 8003a06dd9afdd17625413c2555bbb14d11cf08c Mon Sep 17 00:00:00 2001 From: Michael Camilleri Date: Thu, 25 Jul 2019 04:19:41 +0900 Subject: [PATCH 3/8] Tweak formatting --- README.md | 59 +++++++++++-------------------------------------------- 1 file changed, 12 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index e932dee6ee..aa3a651639 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,7 @@ compatible with stylesheets designed for [Pygments][]. Rouge's most common uses are as a Ruby library, as part of Jekyll and as a command line tool. -### Ways to Use - -#### Library +### Library Here's a quick example of using Rouge as you would any other regular Ruby library: @@ -40,14 +38,12 @@ Rouge::Themes::Base16.mode(:light).render(scope: '.highlight') Rouge::Theme.find('base16.light').render(scope: '.highlight') ``` -#### Jekyll +### Jekyll -

- If you're using GitHub Pages, you're stuck with [version 2.2.1][ghp-versions] - of Rouge. Although GitHub Page uses an up to date version of Jekyll, it locks - the version of Rouge. There is [an open issue][ghp-issue] to upgrade this to - a more current release. -

+**NOTE**: If you're using GitHub Pages, you're stuck with [version +2.2.1][ghp-versions] of Rouge. Although GitHub Page uses an up to date version +of Jekyll, it locks the version of Rouge. There is [an open issue][ghp-issue] to +upgrade this to a more current release. [ghp-versions]: https://pages.github.com/versions/ "Version of the dependencies used by GitHub Pages" @@ -64,7 +60,7 @@ use and whether to enable line numbers or not. More information is available in [j-docs]: https://jekyllrb.com/docs/liquid/tags/#code-snippet-highlighting "Code snippet highlighting in the Jekyll documentation" -#### Command Line +### Command Line Rouge ships with a `rougify` command which allows you to easily highlight files in your terminal: @@ -149,35 +145,6 @@ Rouge's documentation is available at [rouge-ruby.github.io/docs/][docs]. [docs]: https://rouge-ruby.github.io/docs "Rouge's official documentation" -## Comparisons - -Rouge aims to be simple to extend and to be a drop-in replacement for Pygments. -It stacks up well in comparison to other Ruby libraries. - -### pygments.rb - -In comparison to [pygments.rb][]: - -[pygments.rb]: https://github.com/tmm1/pygments.rb "pygments.rb repository on -GitHub" - -* no need to spawn Python processes; and -* Rouge is faster in [almost every measure][comp]. - -[comp]: https://github.com/rouge-ruby/rouge/pull/41#issuecomment-223751572 -"Comparison with pygments.rb" - -### CodeRay - -In comparison to [CodeRay][]: - -* HTML output from Rouge is fully compatible with stylesheets designed for - Pygments; -* lexers are implemented with a dedicated DSL, rather than being hand-coded; and -* Rouge supports every language CodeRay does and more. - -[CodeRay]: https://github.com/rubychan/coderay "CodeRay repository on GitHub" - ## Requirements ### Ruby @@ -212,21 +179,19 @@ developing new lexers. ### Bug Reports -Rouge uses GitHub's Issues to report bugs. You can [choose][issue-chooser] from +Rouge uses GitHub's Issues to report bugs. You can [choose][issue_chooser] from one of our templates or create a custom issue. Issues that have not been active for a year are automatically closed by GitHub's [Probot][]. -[issue-chooser]: https://github.com/rouge-ruby/rouge/issues/new/choose "Choose -an issue from the templates" +[issue_chooser]: https://github.com/rouge-ruby/rouge/issues/new/choose +"Choose an issue from the templates" [Probot]: https://probot.github.io "Read more about GitHub's Probot" ### Developing Lexers -

- Please don't submit lexers that are copy-pasted from other files. These - submissions will be rejected and we don't want you to waste your time. -

+**NOTE**: Please don't submit lexers that are copy-pasted from other files. +These submission will be rejected and we don't want you to waste your time. We want to make it as easy as we can for anyone to contribute a lexer to Rouge. To help get you started, we have [a shiny new guide][lexer-dev-doc] on lexer From c9a3330a4699d54c076bd1ba48340a305b8190c3 Mon Sep 17 00:00:00 2001 From: Michael Camilleri Date: Sat, 27 Jul 2019 04:28:57 +0900 Subject: [PATCH 4/8] Correct typo Co-Authored-By: Ashwin Maroli --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aa3a651639..810f24c6d3 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Rouge::Theme.find('base16.light').render(scope: '.highlight') ### Jekyll **NOTE**: If you're using GitHub Pages, you're stuck with [version -2.2.1][ghp-versions] of Rouge. Although GitHub Page uses an up to date version +2.2.1][ghp-versions] of Rouge. Although GitHub Pages uses an up to date version of Jekyll, it locks the version of Rouge. There is [an open issue][ghp-issue] to upgrade this to a more current release. From 4ce83f316dd4ea5a9770e97b4eb3855505fcb362 Mon Sep 17 00:00:00 2001 From: Michael Camilleri Date: Sat, 27 Jul 2019 04:44:24 +0900 Subject: [PATCH 5/8] Replace tips section, correct typo --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 810f24c6d3..2d966df4fc 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ The built-in formatters are: * `gutter_class: 'rouge-gutter'` - a CSS class for the gutter * `code_class: 'rouge-code'` - a CSS class for the code column -* `Rouge::Formatters::HTMLLegacy.new(opts={})` is a backwards-compatibile class +* `Rouge::Formatters::HTMLLegacy.new(opts={})` is a backwards-compatible class intended for users of Rouge 1.x, with options that were supported then. Options are: * `inline_theme: nil` - use an HTMLInline formatter with the given theme @@ -230,12 +230,12 @@ Rouge uses [Semantic Versioning 2.0.0][sv2]. [sv2]: http://semver.org/ -## Tips +## Maintainers -I don't get paid to maintain rouge. If you've found this software useful, -consider dropping a tip in the [bucket][cashme]. - -[cashme]: http://cash.me/$jneen "Jeanine Adkisson's Cash App page" +Rouge is largely the result of the hard work of unpaid volunteers. It was +originally developed by Jeanine Adkisson (@jneen) and is currently maintained by +Jeanine Adkisson, Drew Blessing (@dblessing), Michael Camilleri (@pyrmont) and +Goro Fuji (@gfx). ## License From b328f26a5509b56e027dc06f30183cf2b4ceb1e9 Mon Sep 17 00:00:00 2001 From: Michael Camilleri Date: Sat, 27 Jul 2019 05:01:44 +0900 Subject: [PATCH 6/8] Correct wording --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2d966df4fc..5adfe4ddaf 100644 --- a/README.md +++ b/README.md @@ -113,8 +113,8 @@ The built-in formatters are: * `gutter_class: 'rouge-gutter'` - a CSS class for the gutter * `code_class: 'rouge-code'` - a CSS class for the code column -* `Rouge::Formatters::HTMLLegacy.new(opts={})` is a backwards-compatible class - intended for users of Rouge 1.x, with options that were supported then. +* `Rouge::Formatters::HTMLLegacy.new(opts={})` is a backwards-compatibility + class intended for users of Rouge 1.x, with options that were supported then. Options are: * `inline_theme: nil` - use an HTMLInline formatter with the given theme * `line_numbers: false` - use an HTMLTable formatter From 04c7a4a3714a0da6ebd0ac68267d0154f3de136c Mon Sep 17 00:00:00 2001 From: Michael Camilleri Date: Mon, 29 Jul 2019 03:20:15 +0900 Subject: [PATCH 7/8] Revise wording for HTMLTable formatter --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5adfe4ddaf..cbb7d274e6 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,10 @@ The built-in formatters are: designed for Pygments. * `Rouge::Formatters::HTMLTable.new(formatter, opts={})` will output an HTML - table containing numbered lines. Options are: + table containing numbered lines similar to `Rouge::Formatters::HTMLLineTable`, + except that the table from this formatter has just a single table-row. + Therefore, while the table is more DOM-friendly for JavaScript scripting, long + code lines will mess with the column alignment. Options are: * `start_line: 1` - the number of the first line * `line_format: '%i'` - a `sprintf` template for the line number itself * `table_class: 'rouge-table'` - a CSS class for the table From d3f8764d8ddad535329d08e128ee5a4eca777b89 Mon Sep 17 00:00:00 2001 From: Michael Camilleri Date: Tue, 30 Jul 2019 02:54:22 +0900 Subject: [PATCH 8/8] Fixed punctuation error --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cbb7d274e6..68f31ca479 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,8 @@ The built-in formatters are: ### CSS Options -* `scope: '.highlight'` sets the CSS selector to which styles are applied, eg. +* `scope: '.highlight'` sets the CSS selector to which styles are applied, + e.g.: ``` ruby Rouge::Themes::MonokaiSublime.render(scope: 'code')