Class: Giblish::RelativeCssDocAttr

Inherits:
DocAttributesBase show all
Defined in:
lib/giblish/docattr_providers.rb

Instance Method Summary collapse

Constructor Details

#initialize(dst_css_path_rel) ⇒ RelativeCssDocAttr

dst_css_path_rel

the relative path to the dst top to the location of the

css file to use



26
27
28
# File 'lib/giblish/docattr_providers.rb', line 26

def initialize(dst_css_path_rel)
  @css_path = Pathname.new(dst_css_path_rel)
end

Instance Method Details

#document_attributes(src_node, dst_node, dst_top) ⇒ Object



30
31
32
33
34
35
36
37
38
# File 'lib/giblish/docattr_providers.rb', line 30

def document_attributes(src_node, dst_node, dst_top)
  href_path = dst_top.relative_path_from(dst_node).dirname / @css_path
  {
    "stylesdir" => href_path.dirname.to_s,
    "stylesheet" => href_path.basename.to_s,
    "linkcss" => true,
    "copycss" => nil
  }
end