Class: Giblish::PdfLayoutConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/giblish/configurator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource_paths) ⇒ PdfLayoutConfig

Returns a new instance of PdfLayoutConfig.



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/giblish/configurator.rb', line 72

def initialize(resource_paths)
  @adoc_api_opts = {backend: "pdf"}
  @pre_builders = []
  @post_builders = []
  @adoc_extensions = {}
  @docattr_providers = []

  begin
    require "asciidoctor-mathematical"
    cc = PdfMathPostbuilder.new
    @post_builders << cc
    @docattr_providers << cc
  rescue LoadError
    Giblog.logger.warn { "Did not find asciidoctor-mathematical. stem blocks will not be rendered correctly!" }
  end

  if resource_paths.src_style_path_abs
    # generate pdf using asciidoctor-pdf with custom styling
    @docattr_providers << PdfCustomStyle.new(
      resource_paths.src_style_path_abs,
      *resource_paths.font_dirs_abs.to_a
    )
  end
end

Instance Attribute Details

#adoc_api_optsObject (readonly)

Returns the value of attribute adoc_api_opts.



70
71
72
# File 'lib/giblish/configurator.rb', line 70

def adoc_api_opts
  @adoc_api_opts
end

#adoc_extensionsObject (readonly)

Returns the value of attribute adoc_extensions.



70
71
72
# File 'lib/giblish/configurator.rb', line 70

def adoc_extensions
  @adoc_extensions
end

#docattr_providersObject (readonly)

Returns the value of attribute docattr_providers.



70
71
72
# File 'lib/giblish/configurator.rb', line 70

def docattr_providers
  @docattr_providers
end

#post_buildersObject (readonly)

Returns the value of attribute post_builders.



70
71
72
# File 'lib/giblish/configurator.rb', line 70

def post_builders
  @post_builders
end

#pre_buildersObject (readonly)

Returns the value of attribute pre_builders.



70
71
72
# File 'lib/giblish/configurator.rb', line 70

def pre_builders
  @pre_builders
end