Class: Coradoc::Input::HTML::Config

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/coradoc/input/html/config.rb', line 6

def initialize
  @unknown_tags     = :pass_through
  @input_format     = :html
  @mathml2asciimath = false
  @external_images  = false

  # Destination to save file and images
  @destination      = nil

  # Source of HTML
  # @sourcedir        = nil

  # Image counter, assuming there are max 999 images
  @image_counter = 1
  # pad with 0s
  @image_counter_pattern = "%03d"

  @em_delimiter     = "_".freeze
  @strong_delimiter = "*".freeze
  @inline_options   = {}
  @tag_border       = " ".freeze

  @split_sections   = nil

  # Document width - used to compute table sizes.
  # This is an assumption for screen size in input document.
  # If column widths are specified in absolute values, then we
  # have to convert them to relative values, as AsciiDoc only
  # supports those.
  @doc_width        = 1000

  # Plugin system
  @plugins          = []

  # Debugging options
  @track_time       = false
end

Class Method Details

.declare_option(option) ⇒ Object



52
53
54
55
56
57
58
# File 'lib/coradoc/input/html/config.rb', line 52

def self.declare_option(option)
  define_method(option) do
    @inline_options[option] || instance_variable_get(:"@#{option}")
  end

  attr_writer option
end

Instance Method Details

#with(options = {}) ⇒ Object



44
45
46
47
48
49
50
# File 'lib/coradoc/input/html/config.rb', line 44

def with(options = {})
  old_options = @inline_options
  @inline_options = options
  result = yield
  @inline_options = old_options
  result
end