Method: Code::Component#initialize

Defined in:
app/components/lookbook/code/component.rb

#initialize(source: nil, language: :html, line_numbers: false, highlight_lines: [], start_line: 1, wrap: false, theme: nil, dark: false, full_height: false, **html_attrs) ⇒ Component

Returns a new instance of Component.



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/components/lookbook/code/component.rb', line 3

def initialize(
  source: nil,
  language: :html,
  line_numbers: false,
  highlight_lines: [],
  start_line: 1,
  wrap: false,
  theme: nil,
  dark: false,
  full_height: false,
  **html_attrs
)
  @source_code = source
  @highlight_opts = {
    language: language,
    line_numbers: line_numbers,
    highlight_lines: highlight_lines,
    start_line: start_line
  }
  @highlight_lines = highlight_lines
  @wrap = wrap
  @theme = theme
  @dark = dark
  @full_height = full_height
  super(**html_attrs)
end