Receiving theme parameter to use the default or github#28
Open
volpatorafael wants to merge 1 commit intolucascaton:masterfrom
Open
Receiving theme parameter to use the default or github#28volpatorafael wants to merge 1 commit intolucascaton:masterfrom
volpatorafael wants to merge 1 commit intolucascaton:masterfrom
Conversation
houndci-bot
reviewed
Nov 28, 2022
|
|
||
| theme = Rouge::Themes::Base16.mode(:light) | ||
| if (@themeName == "github") | ||
| theme = Rouge::Themes::Github.new() |
Collaborator
There was a problem hiding this comment.
Style/MethodCallWithoutArgsParentheses: Do not use parentheses for method calls with no arguments.
| return CGI.escapeHTML(file.last) unless file_lexer | ||
|
|
||
| theme = Rouge::Themes::Base16.mode(:light) | ||
| if (@themeName == "github") |
Collaborator
There was a problem hiding this comment.
Style/ConditionalAssignment: Use the return of the conditional for variable assignment and comparison.
Style/ParenthesesAroundCondition: Don't use parentheses around the condition of an if.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
| raise ArgumentError.new 'where should I save the generated pdf file?' | ||
| else | ||
| @from, @to, @except = params[:from], params[:to], params[:except].to_s | ||
| @from, @to, @except, @themeName = params[:from], params[:to], params[:except].to_s, params[:theme] |
Collaborator
There was a problem hiding this comment.
Style/ParallelAssignment: Do not use parallel assignment.
Naming/VariableName: Use snake_case for variable names.
Metrics/LineLength: Line is too long. [104/80]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello!
I facing some issues using the default Rouge theme, then I added a script param to switch to the Github theme (that works fine to me).
'/Users/rafael/.rvm/rubies/ruby-2.6.8/lib/ruby/gems/2.6.0/gems/rouge-2.0.7/lib/rouge/formatters/html_inline.rb:15:insafe_span': undefined methodstyle_for' for Rouge::Themes::Base16:Class (NoMethodError) Did you mean? style from /Users/rafael/.rvm/rubies/ruby-2.6.8/lib/ruby/gems/2.6.0/gems/rouge-2.0.7/lib/rouge/formatters/html.rb:15:inspan'from /Users/rafael/.rvm/rubies/ruby-2.6.8/lib/ruby/gems/2.6.0/gems/rouge-2.0.7/lib/rouge/formatters/html_table.rb:30:in
block in stream' from /Users/rafael/.rvm/rubies/ruby-2.6.8/lib/ruby/gems/2.6.0/gems/rouge-2.0.7/lib/rouge/lexer.rb:315:inblock in lex'from /Users/rafael/.rvm/rubies/ruby-2.6.8/lib/ruby/gems/2.6.0/gems/rouge-2.0.7/lib/rouge/regex_lexer.rb:126:in
block in rule' from /Users/rafael/.rvm/rubies/ruby-2.6.8/lib/ruby/gems/2.6.0/gems/rouge-2.0.7/lib/rouge/regex_lexer.rb:305:ininstance_exec'from /Users/rafael/.rvm/rubies/ruby-2.6.8/lib/ruby/gems/2.6.0/gems/rouge-2.0.7/lib/rouge/regex_lexer.rb:305:in
block in step' from /Users/rafael/.rvm/rubies/ruby-2.6.8/lib/ruby/gems/2.6.0/gems/rouge-2.0.7/lib/rouge/regex_lexer.rb:287:ineach'from /Users/rafael/.rvm/rubies/ruby-2.6.8/lib/ruby/gems/2.6.0/gems/rouge-2.0.7/lib/rouge/regex_lexer.rb:287:in
step' from /Users/rafael/.rvm/rubies/ruby-2.6.8/lib/ruby/gems/2.6.0/gems/rouge-2.0.7/lib/rouge/regex_lexer.rb:268:instream_tokens'from /Users/rafael/.rvm/rubies/ruby-2.6.8/lib/ruby/gems/2.6.0/gems/rouge-2.0.7/lib/rouge/lexer.rb:307:in
lex' from /Users/rafael/.rvm/rubies/ruby-2.6.8/lib/ruby/gems/2.6.0/gems/rouge-2.0.7/lib/rouge/formatters/html_table.rb:27:ineach'from /Users/rafael/.rvm/rubies/ruby-2.6.8/lib/ruby/gems/2.6.0/gems/rouge-2.0.7/lib/rouge/formatters/html_table.rb:27:in
stream' from /Users/rafael/.rvm/rubies/ruby-2.6.8/lib/ruby/gems/2.6.0/gems/rouge-2.0.7/lib/rouge/formatter.rb:37:informat'from /Users/rafael/Development/x4fare/code2pdf/lib/code2pdf/convert_to_pdf.rb:63:in
syntax_highlight' from /Users/rafael/Development/x4fare/code2pdf/lib/code2pdf/convert_to_pdf.rb:40:inblock in pdf'from /Users/rafael/Development/x4fare/code2pdf/lib/code2pdf/convert_to_pdf.rb:38:in
each' from /Users/rafael/Development/x4fare/code2pdf/lib/code2pdf/convert_to_pdf.rb:38:inpdf'from /Users/rafael/Development/x4fare/code2pdf/lib/code2pdf/convert_to_pdf.rb:30:in
save' from /Users/rafael/Development/x4fare/code2pdf/lib/code2pdf/convert_to_pdf.rb:23:ininitialize'from /Users/rafael/Development/x4fare/code2pdf/bin/code2pdf:58:in
new' from /Users/rafael/Development/x4fare/code2pdf/bin/code2pdf:58:in`