Add a message and error out when Pygments returns nil. #2148

Merged
merged 2 commits into from Mar 20, 2014

Conversation

Projects
None yet
4 participants
@parkr
Member

parkr commented Mar 16, 2014

Fixes #2145.

/cc @stomar

lib/jekyll/tags/highlight.rb
+ puts
+ Jekyll.logger.error "While attempting to convert the above code, Pygments.rb" +
+ " returned an unacceptable value."
+ Jekyll.logger.error "This is usually solved by running `jekyll build` again."

This comment has been minimized.

@stomar

stomar Mar 16, 2014

Contributor

This is usually a timeout problem solved by... or similar?
(To make clear why running again might solve the problem)

@stomar

stomar Mar 16, 2014

Contributor

This is usually a timeout problem solved by... or similar?
(To make clear why running again might solve the problem)

This comment has been minimized.

@parkr

parkr Mar 16, 2014

Member

That's a good idea. How would you phrase that sentence, and what solution would you suggest? They could bump the env var in question, or just re-run and hope for the best, right?

@parkr

parkr Mar 16, 2014

Member

That's a good idea. How would you phrase that sentence, and what solution would you suggest? They could bump the env var in question, or just re-run and hope for the best, right?

This comment has been minimized.

@stomar

stomar Mar 16, 2014

Contributor

As a non-native speaker good formultations are not my strong point, so I have nothing better to offer than above...

IMO mentioning a possible timeout problem of Pygments and a re-run is a good enough pointer in the right direction.
Setting the env var is not possible for the gem version on RubyGems.org AFAIK, so you probably shouldn't suggest it.

@stomar

stomar Mar 16, 2014

Contributor

As a non-native speaker good formultations are not my strong point, so I have nothing better to offer than above...

IMO mentioning a possible timeout problem of Pygments and a re-run is a good enough pointer in the right direction.
Setting the env var is not possible for the gem version on RubyGems.org AFAIK, so you probably shouldn't suggest it.

This comment has been minimized.

@mattr-

mattr- Mar 18, 2014

Member

This is usually a timeout problem due to the complexity of the code you're trying to highlight

Not sure if we have an exact reason why Pygments.rb would fail though.
Also, do we need to do something similar for the Rouge highlighter?

@mattr-

mattr- Mar 18, 2014

Member

This is usually a timeout problem due to the complexity of the code you're trying to highlight

Not sure if we have an exact reason why Pygments.rb would fail though.
Also, do we need to do something similar for the Rouge highlighter?

@parkr parkr closed this Mar 17, 2014

@parkr parkr reopened this Mar 17, 2014

@parkr parkr self-assigned this Mar 17, 2014

@parkr parkr added this to the 2.0 milestone Mar 17, 2014

@parkr parkr added the Fix label Mar 17, 2014

@stomar

This comment has been minimized.

Show comment
Hide comment
@stomar

stomar Mar 18, 2014

Contributor

@mattr- It does not necessarily have to do with the complexity of the highlighted code. It happens e.g. on my machine when there is heavy CPU load due to completely unrelated processes. It also happens on Travis CI. Even for two-line code snippets.

This is usually a timeout problem solved by running 'jekyll build' again. ?

Contributor

stomar commented Mar 18, 2014

@mattr- It does not necessarily have to do with the complexity of the highlighted code. It happens e.g. on my machine when there is heavy CPU load due to completely unrelated processes. It also happens on Travis CI. Even for two-line code snippets.

This is usually a timeout problem solved by running 'jekyll build' again. ?

@jpiasetz jpiasetz referenced this pull request Mar 18, 2014

Merged

Refactor highlighting #2154

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Mar 20, 2014

Member

@mattr- @stomar Any last thoughts or is this good to go?

Member

parkr commented Mar 20, 2014

@mattr- @stomar Any last thoughts or is this good to go?

@stomar

This comment has been minimized.

Show comment
Hide comment
@stomar

stomar Mar 20, 2014

Contributor

👌 IMO much better, should make debugging of this problem a lot easier.

Contributor

stomar commented Mar 20, 2014

👌 IMO much better, should make debugging of this problem a lot easier.

@stomar stomar referenced this pull request in tmm1/pygments.rb Mar 20, 2014

Open

Pygments.highlight returning nil #78

@mattr-

This comment has been minimized.

Show comment
Hide comment
@mattr-

mattr- Mar 20, 2014

Member

👍 from me too.

Member

mattr- commented Mar 20, 2014

👍 from me too.

@parkr parkr merged commit cf37591 into master Mar 20, 2014

1 check passed

default The Travis CI build passed
Details

@parkr parkr deleted the error-when-pygments-errors branch Mar 20, 2014

parkr added a commit that referenced this pull request Mar 20, 2014

lmullen added a commit to lmullen/jekyll that referenced this pull request Mar 24, 2014

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.