Class: Kreuzberg::Config::HtmlOptions
- Inherits:
-
Object
- Object
- Kreuzberg::Config::HtmlOptions
- Defined in:
- lib/kreuzberg/config.rb
Overview
HTML rendering options for document conversion
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(**options) ⇒ HtmlOptions
constructor
A new instance of HtmlOptions.
- #to_h ⇒ Object
Constructor Details
#initialize(**options) ⇒ HtmlOptions
Returns a new instance of HtmlOptions.
640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 |
# File 'lib/kreuzberg/config.rb', line 640 def initialize(**) normalized = .transform_keys(&:to_sym) symbol_keys = %i[ heading_style code_block_style highlight_style list_indent_type newline_style whitespace_mode ] symbol_keys.each do |key| normalized[key] = normalized[key]&.to_sym if normalized.key?(key) end if normalized[:preprocessing].is_a?(Hash) normalized[:preprocessing] = HtmlPreprocessing.new(**normalized[:preprocessing]) end @options = normalized end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
638 639 640 |
# File 'lib/kreuzberg/config.rb', line 638 def @options end |
Instance Method Details
#to_h ⇒ Object
659 660 661 |
# File 'lib/kreuzberg/config.rb', line 659 def to_h @options.transform_values { |value| value.respond_to?(:to_h) ? value.to_h : value } end |