Class: Muwu::RenderHtmlPartial::TextItem
- Inherits:
-
Object
- Object
- Muwu::RenderHtmlPartial::TextItem
- 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
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#distinct ⇒ Object
Returns the value of attribute distinct.
-
#does_have_source_text ⇒ Object
Returns the value of attribute does_have_source_text.
-
#end_links ⇒ Object
Returns the value of attribute end_links.
-
#heading ⇒ Object
Returns the value of attribute heading.
-
#heading_origin ⇒ Object
Returns the value of attribute heading_origin.
-
#html_attr_id ⇒ Object
Returns the value of attribute html_attr_id.
-
#is_parent_heading ⇒ Object
Returns the value of attribute is_parent_heading.
-
#markup_renderer ⇒ Object
Returns the value of attribute markup_renderer.
-
#numbering ⇒ Object
Returns the value of attribute numbering.
-
#project ⇒ Object
Returns the value of attribute project.
-
#section_depth ⇒ Object
Returns the value of attribute section_depth.
-
#section_number_as_attr ⇒ Object
Returns the value of attribute section_number_as_attr.
-
#section_number_as_text ⇒ Object
Returns the value of attribute section_number_as_text.
-
#sections ⇒ Object
Returns the value of attribute sections.
-
#source_filename_absolute ⇒ Object
Returns the value of attribute source_filename_absolute.
-
#source_filename_relative ⇒ Object
Returns the value of attribute source_filename_relative.
-
#subsections_are_distinct ⇒ Object
Returns the value of attribute subsections_are_distinct.
-
#text_root_name ⇒ Object
Returns the value of attribute text_root_name.
-
#will_render_section_number ⇒ Object
Returns the value of attribute will_render_section_number.
Instance Method Summary collapse
- #render ⇒ Object
- #render_end_link(name, href) ⇒ Object
- #render_end_links ⇒ Object
- #render_heading ⇒ Object
- #render_section_number ⇒ Object
- #render_sections ⇒ Object
- #render_text ⇒ Object
- #write_tag_heading ⇒ Object
- #write_tag_nav_a(name, href) ⇒ Object
- #write_tag_nav_close ⇒ Object
- #write_tag_nav_open ⇒ Object
- #write_tag_section_close ⇒ Object
- #write_tag_section_open ⇒ Object
- #write_tag_span_section_number ⇒ Object
- #write_text_file_missing ⇒ Object
- #write_text_source_to_html ⇒ Object
Methods included from Muwu
Instance Attribute Details
#destination ⇒ Object
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 |
#distinct ⇒ Object
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_text ⇒ Object
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 |
#end_links ⇒ Object
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 |
#heading ⇒ Object
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_origin ⇒ Object
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_id ⇒ Object
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_heading ⇒ Object
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_renderer ⇒ Object
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 |
#numbering ⇒ Object
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 |
#project ⇒ Object
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_depth ⇒ Object
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_attr ⇒ Object
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_text ⇒ Object
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 |
#sections ⇒ Object
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_absolute ⇒ Object
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_relative ⇒ Object
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_distinct ⇒ Object
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_name ⇒ Object
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_number ⇒ Object
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
#render ⇒ Object
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 |
#render_end_link(name, href) ⇒ Object
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 |
#render_end_links ⇒ Object
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_heading ⇒ Object
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_number ⇒ Object
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_sections ⇒ Object
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_text ⇒ Object
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_heading ⇒ Object
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_close ⇒ Object
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_open ⇒ Object
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_close ⇒ Object
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_open ⇒ Object
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_number ⇒ Object
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_missing ⇒ Object
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_html ⇒ Object
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 |