diff --git a/Gemfile b/Gemfile index f296c97d..22738adb 100644 --- a/Gemfile +++ b/Gemfile @@ -75,7 +75,6 @@ group :jekyll_optional_dependencies do platform :ruby, :mswin, :mingw, :x64_mingw do gem "classifier-reborn", "~> 2.2.0" gem "liquid-c", "~> 3.0" - gem "pygments.rb", "~> 1.0" gem "yajl-ruby", "~> 1.4" end diff --git a/docs/_docs/liquid/tags.md b/docs/_docs/liquid/tags.md index 50bed0cb..90b654b8 100644 --- a/docs/_docs/liquid/tags.md +++ b/docs/_docs/liquid/tags.md @@ -14,16 +14,23 @@ If you have page snippets that you use repeatedly across your site, an ## Code snippet highlighting -Jekyll has built in support for syntax highlighting of over 60 languages +Jekyll has built in support for syntax highlighting of over 100 languages thanks to [Rouge](http://rouge.jneen.net). Rouge is the default highlighter in Jekyll 3 and above. To use it in Jekyll 2, set `highlighter` to `rouge` and ensure the `rouge` gem is installed properly. -Alternatively, you can use [Pygments](http://pygments.org) to highlight -your code snippets. To use Pygments, you must have Python installed on your -system, have the `pygments.rb` gem installed and set `highlighter` to -`pygments` in your site's configuration file. Pygments supports [over 100 -languages](http://pygments.org/languages/) +Alternatively, you can use [Pygments](http://pygments.org) to highlight your +code snippets in Jekyll 3.x and below. To use Pygments, you must have Python +installed on your system, have the `pygments.rb` gem installed and set +`highlighter` to `pygments` in your site's configuration file. Pygments +supports [over 100 languages](http://pygments.org/languages/) + +
Using Pygments has been deprecated and will not be officially supported in
+ Jekyll 4, meaning that the configuration setting highlighter: pygments
+ will automatically fall back to using Rouge which is written in Ruby
+ and 100% compatible with stylesheets for Pygments.
', "").sub("
) +
- %(test
),
- @result
- )
- end
-
- should "render markdown with pygments with line numbers" do
- assert_match(
- %() +
- %(1 test
),
- @result
- )
- end
- end
-
- context "post content has highlight with file reference" do
- setup do
- fill_post("./jekyll.gemspec", "highlighter" => "pygments")
- end
-
- should "not embed the file" do
- assert_match(
- %() +
- %(./jekyll.gemspec
),
- @result
- )
- end
- end
-
- context "post content has highlight tag with UTF character" do
- setup do
- fill_post("Æ", "highlighter" => "pygments")
- end
-
- should "render markdown with pygments line handling" do
- assert_match(
- %() +
- %(Æ
),
- @result
- )
- end
- end
-
- context "post content has highlight tag with preceding spaces & lines" do
- setup do
- code = <<~EOS
-
-
- [,1] [,2]
- [1,] FALSE TRUE
- [2,] FALSE TRUE
- EOS
- fill_post(code, "highlighter" => "pygments")
- end
-
- should "only strip the preceding newlines" do
- assert_match(
- %() +
- %( [,1] [,2]),
- @result
- )
- end
- end
-
- context "post content has highlight tag " \
- "with preceding spaces & lines in several places" do
- setup do
- code = <<~EOS
-
-
- [,1] [,2]
-
-
- [1,] FALSE TRUE
- [2,] FALSE TRUE
-
-
- EOS
- fill_post(code, "highlighter" => "pygments")
- end
-
- should "only strip the newlines which precede and succeed the entire block" do
- assert_match(
- %() +
- %( [,1] [,2]\n\n\n[1,] FALSE TRUE\n[2,] FALSE TRUE
),
- @result
- )
- end
- end
-
- context "post content has highlight tag with " \
- "preceding spaces & Windows-style newlines" do
- setup do
- fill_post "\r\n\r\n\r\n [,1] [,2]", "highlighter" => "pygments"
- end
-
- should "only strip the preceding newlines" do
- assert_match(
- %() +
- %( [,1] [,2]),
- @result
- )
- end
- end
-
- context "post content has highlight tag with only preceding spaces" do
- setup do
- code = <<~EOS
- [,1] [,2]
- [1,] FALSE TRUE
- [2,] FALSE TRUE
- EOS
- fill_post(code, "highlighter" => "pygments")
- end
-
- should "only strip the preceding newlines" do
- assert_match(
- %() +
- %( [,1] [,2]),
- @result
- )
- end
- end
- end
-
context "with the rouge highlighter" do
context "post content has highlight tag" do
setup do