mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-06-07 20:20:26 -03:00
Compare commits
3 Commits
cbedf8a8db
...
46d6d3f467
Author | SHA1 | Date | |
---|---|---|---|
46d6d3f467 | |||
78ddc69937 | |||
b1ad7b64c0 |
@ -15,6 +15,7 @@ module Tartrazine
|
|||||||
property? standalone : Bool = false
|
property? standalone : Bool = false
|
||||||
property? surrounding_pre : Bool = true
|
property? surrounding_pre : Bool = true
|
||||||
property? wrap_long_lines : Bool = false
|
property? wrap_long_lines : Bool = false
|
||||||
|
property? weight_of_bold : Int32 = 600
|
||||||
|
|
||||||
def format(text : String, lexer : Lexer, theme : Theme) : String
|
def format(text : String, lexer : Lexer, theme : Theme) : String
|
||||||
text = format_text(text, lexer, theme)
|
text = format_text(text, lexer, theme)
|
||||||
@ -43,7 +44,7 @@ module Tartrazine
|
|||||||
pre_style = wrap_long_lines? ? "style=\"white-space: pre-wrap; word-break: break-word;\"" : ""
|
pre_style = wrap_long_lines? ? "style=\"white-space: pre-wrap; word-break: break-word;\"" : ""
|
||||||
outp << "<pre class=\"#{get_css_class("Background", theme)}\" #{pre_style}>"
|
outp << "<pre class=\"#{get_css_class("Background", theme)}\" #{pre_style}>"
|
||||||
end
|
end
|
||||||
"<code class=\"#{get_css_class("Background", theme)}\">"
|
outp << "<code class=\"#{get_css_class("Background", theme)}\">"
|
||||||
lines.each_with_index(offset: line_number_start - 1) do |line, i|
|
lines.each_with_index(offset: line_number_start - 1) do |line, i|
|
||||||
line_label = line_numbers? ? "#{i + 1}".rjust(4).ljust(5) : ""
|
line_label = line_numbers? ? "#{i + 1}".rjust(4).ljust(5) : ""
|
||||||
line_class = highlighted?(i + 1) ? "class=\"#{get_css_class("LineHighlight", theme)}\"" : ""
|
line_class = highlighted?(i + 1) ? "class=\"#{get_css_class("LineHighlight", theme)}\"" : ""
|
||||||
@ -72,7 +73,7 @@ module Tartrazine
|
|||||||
# These are true/false/nil
|
# These are true/false/nil
|
||||||
outp << "border: none;" if style.border == false
|
outp << "border: none;" if style.border == false
|
||||||
outp << "font-weight: bold;" if style.bold
|
outp << "font-weight: bold;" if style.bold
|
||||||
outp << "font-weight: 400;" if style.bold == false
|
outp << "font-weight: #{weight_of_bold};" if style.bold == false
|
||||||
outp << "font-style: italic;" if style.italic
|
outp << "font-style: italic;" if style.italic
|
||||||
outp << "font-style: normal;" if style.italic == false
|
outp << "font-style: normal;" if style.italic == false
|
||||||
outp << "text-decoration: underline;" if style.underline
|
outp << "text-decoration: underline;" if style.underline
|
||||||
|
Loading…
x
Reference in New Issue
Block a user