Class: Muwu::RenderHtmlPartial::TextItem

Inherits:
Object
  • Object
show all
Includes:
Muwu
Defined in:
lib/muwu/render_html_partial/render_text_item.rb

Constant Summary

Constants included from Muwu

GEM_HOME_LIB, GEM_HOME_LIB_MUWU, VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Muwu

debug, read

Instance Attribute Details

#destinationObject

Returns the value of attribute destination.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def destination
  @destination
end

#distinctObject

Returns the value of attribute distinct.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def distinct
  @distinct
end

#does_have_source_textObject

Returns the value of attribute does_have_source_text.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def does_have_source_text
  @does_have_source_text
end

Returns the value of attribute end_links.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def end_links
  @end_links
end

#headingObject

Returns the value of attribute heading.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def heading
  @heading
end

#heading_originObject

Returns the value of attribute heading_origin.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def heading_origin
  @heading_origin
end

#html_attr_idObject

Returns the value of attribute html_attr_id.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def html_attr_id
  @html_attr_id
end

#is_parent_headingObject

Returns the value of attribute is_parent_heading.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def is_parent_heading
  @is_parent_heading
end

#markup_rendererObject

Returns the value of attribute markup_renderer.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def markup_renderer
  @markup_renderer
end

#numberingObject

Returns the value of attribute numbering.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def numbering
  @numbering
end

#projectObject

Returns the value of attribute project.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def project
  @project
end

#section_depthObject

Returns the value of attribute section_depth.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def section_depth
  @section_depth
end

#section_number_as_attrObject

Returns the value of attribute section_number_as_attr.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def section_number_as_attr
  @section_number_as_attr
end

#section_number_as_textObject

Returns the value of attribute section_number_as_text.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def section_number_as_text
  @section_number_as_text
end

#sectionsObject

Returns the value of attribute sections.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def sections
  @sections
end

#source_filename_absoluteObject

Returns the value of attribute source_filename_absolute.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def source_filename_absolute
  @source_filename_absolute
end

#source_filename_relativeObject

Returns the value of attribute source_filename_relative.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def source_filename_relative
  @source_filename_relative
end

#subsections_are_distinctObject

Returns the value of attribute subsections_are_distinct.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def subsections_are_distinct
  @subsections_are_distinct
end

#text_root_nameObject

Returns the value of attribute text_root_name.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def text_root_name
  @text_root_name
end

#will_render_section_numberObject

Returns the value of attribute will_render_section_number.



12
13
14
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 12

def will_render_section_number
  @will_render_section_number
end

Instance Method Details

#renderObject



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 36

def render
  @destination.padding_vertical(1) do
    write_tag_section_open
    render_section_number
    render_heading
    render_text
    if (@is_parent_heading == true) && (@subsections_are_distinct == true)
      render_end_links
      render_sections
    elsif (@is_parent_heading == true) && (@subsections_are_distinct == false)
      render_sections
      render_end_links
    elsif (@is_parent_heading == false)
      render_end_links
    end
    write_tag_section_close
  end
end


67
68
69
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 67

def render_end_link(name, href)
  write_tag_nav_a(name, href)
end


56
57
58
59
60
61
62
63
64
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 56

def render_end_links
  if @end_links && @end_links.any?
    write_tag_nav_open
    @end_links.each_pair do |name, href|
      render_end_link(name, href)
    end
    write_tag_nav_close
  end
end

#render_headingObject



72
73
74
75
76
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 72

def render_heading
  if heading_origin_is_basename_or_outline
    write_tag_heading
  end
end

#render_section_numberObject



79
80
81
82
83
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 79

def render_section_number
  if @will_render_section_number
    write_tag_span_section_number
  end
end

#render_sectionsObject



86
87
88
89
90
91
92
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 86

def render_sections
  @destination.padding_vertical(1) do
    @sections.each do |section|
      section.render
    end
  end
end

#render_textObject



95
96
97
98
99
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 95

def render_text
  if (source_file_exists == true)
    write_text_source_to_html
  end
end

#write_tag_headingObject



102
103
104
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 102

def write_tag_heading
  @destination.write_line tag_heading
end

#write_tag_nav_a(name, href) ⇒ Object



107
108
109
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 107

def write_tag_nav_a(name, href)
  @destination.write_line tag_nav_a(name, href)
end

#write_tag_nav_closeObject



112
113
114
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 112

def write_tag_nav_close
  @destination.write_line tag_nav_close
end

#write_tag_nav_openObject



117
118
119
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 117

def write_tag_nav_open
  @destination.write_line tag_nav_end_links_open
end

#write_tag_section_closeObject



127
128
129
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 127

def write_tag_section_close
  @destination.write_line tag_section_close
end

#write_tag_section_openObject



122
123
124
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 122

def write_tag_section_open
  @destination.write_line tag_section_open
end

#write_tag_span_section_numberObject



132
133
134
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 132

def write_tag_span_section_number
  @destination.write_line tag_span_section_number
end

#write_text_file_missingObject



137
138
139
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 137

def write_text_file_missing
  @destination.write_line tag_div_file_missing
end

#write_text_source_to_htmlObject



142
143
144
# File 'lib/muwu/render_html_partial/render_text_item.rb', line 142

def write_text_source_to_html
  @destination.write_inline source_to_html
end