Class: Coradoc::Html::RenderOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/coradoc/html/render_options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(layout: :static, lang: 'en', toc: false, toc_levels: 2, section_numbers: false, section_number_levels: 3, author: nil, description: nil, custom_css: nil, dist_dir: nil, theme_toggle: true, reading_progress: true, toc_placement: :auto) ⇒ RenderOptions

Returns a new instance of RenderOptions.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/coradoc/html/render_options.rb', line 10

def initialize(layout: :static, lang: 'en', toc: false, toc_levels: 2,
               section_numbers: false, section_number_levels: 3,
               author: nil, description: nil, custom_css: nil,
               dist_dir: nil, theme_toggle: true, reading_progress: true,
               toc_placement: :auto)
  @layout = layout
  @lang = lang
  @toc = toc
  @toc_levels = toc_levels
  @section_numbers = section_numbers
  @section_number_levels = section_number_levels
  @author = author
  @description = description
  @custom_css = custom_css
  @dist_dir = dist_dir
  @theme_toggle = theme_toggle
  @reading_progress = reading_progress
  @toc_placement = toc_placement
  freeze
end

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



6
7
8
# File 'lib/coradoc/html/render_options.rb', line 6

def author
  @author
end

#custom_cssObject (readonly)

Returns the value of attribute custom_css.



6
7
8
# File 'lib/coradoc/html/render_options.rb', line 6

def custom_css
  @custom_css
end

#descriptionObject (readonly)

Returns the value of attribute description.



6
7
8
# File 'lib/coradoc/html/render_options.rb', line 6

def description
  @description
end

#dist_dirObject (readonly)

Returns the value of attribute dist_dir.



6
7
8
# File 'lib/coradoc/html/render_options.rb', line 6

def dist_dir
  @dist_dir
end

#langObject (readonly)

Returns the value of attribute lang.



6
7
8
# File 'lib/coradoc/html/render_options.rb', line 6

def lang
  @lang
end

#layoutObject (readonly)

Returns the value of attribute layout.



6
7
8
# File 'lib/coradoc/html/render_options.rb', line 6

def layout
  @layout
end

#reading_progressObject (readonly)

Returns the value of attribute reading_progress.



6
7
8
# File 'lib/coradoc/html/render_options.rb', line 6

def reading_progress
  @reading_progress
end

#section_number_levelsObject (readonly)

Returns the value of attribute section_number_levels.



6
7
8
# File 'lib/coradoc/html/render_options.rb', line 6

def section_number_levels
  @section_number_levels
end

#section_numbersObject (readonly)

Returns the value of attribute section_numbers.



6
7
8
# File 'lib/coradoc/html/render_options.rb', line 6

def section_numbers
  @section_numbers
end

#theme_toggleObject (readonly)

Returns the value of attribute theme_toggle.



6
7
8
# File 'lib/coradoc/html/render_options.rb', line 6

def theme_toggle
  @theme_toggle
end

#tocObject (readonly)

Returns the value of attribute toc.



6
7
8
# File 'lib/coradoc/html/render_options.rb', line 6

def toc
  @toc
end

#toc_levelsObject (readonly)

Returns the value of attribute toc_levels.



6
7
8
# File 'lib/coradoc/html/render_options.rb', line 6

def toc_levels
  @toc_levels
end

#toc_placementObject (readonly)

Returns the value of attribute toc_placement.



6
7
8
# File 'lib/coradoc/html/render_options.rb', line 6

def toc_placement
  @toc_placement
end

Instance Method Details

#spa?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/coradoc/html/render_options.rb', line 31

def spa?
  @layout == :spa
end

#static?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/coradoc/html/render_options.rb', line 35

def static?
  @layout == :static
end