Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explicitly depend upon pygments.rb #236

Closed
wants to merge 1 commit into from

Conversation

kbrock
Copy link
Contributor

@kbrock kbrock commented Dec 3, 2015

fixes #235

To reproduce, change the Gemfile from:

    gem "github-linguist",  "~> 2.10",  :require => false

to

    gem "github-linguist",  "> 2.10",  :require => false

and bundle update

I tried not requiring 'pygments.rb', and using defined?, but it looked like nothing worked without including the requirement.

I updated the README as well.

@simeonwillbanks
Copy link
Contributor

👍

Gemfile Outdated
@@ -23,6 +23,7 @@ group :test do
else
gem "escape_utils", "~> 1.0", :require => false
gem "github-linguist", "~> 2.10", :require => false
gem "pygments.rb", :require => false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github-linguist < 4 don't need to include this dependency, right?

How about we add a comment to inform this?

# github-linguist version > 4 need to explicitly include pygments.rb,
# see https://github.com/jch/html-pipeline/issues/235
# gem "pygments.rb",                  :require => false

@kbrock
Copy link
Contributor Author

kbrock commented Dec 6, 2015

@JuanitoFatas Thanks - any other thoughts?

@barraq
Copy link

barraq commented Sep 30, 2016

@kbrock @jch do we still need github-linguist? the newest version totally removed its need (lexer is gone). In one of my project I overrode SyntaxHighlightFilter to only use Pygments:

class HTML::Pipeline
  # Patch SyntaxHighlightFilter (@todo provide fix)
  class SyntaxHighlightFilter < Filter
    def lexer_for(lang)
      Pygments::Lexer[lang]
    end
  end
end

This works like a charm ;)

@kbrock
Copy link
Contributor Author

kbrock commented Oct 16, 2018

Think this is no longer needed

@kbrock kbrock closed this Oct 16, 2018
@kbrock kbrock deleted the linguist_dependency branch October 16, 2018 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Require pygments.rb or remove Pygments references
4 participants