Class: Muwu::RenderHtmlPartial::Topic
- Inherits:
-
Object
- Object
- Muwu::RenderHtmlPartial::Topic
- Includes:
- Muwu
- Defined in:
- lib/muwu/render_html_partial/render_topic.rb
Constant Summary
Constants included from Muwu
GEM_HOME_LIB, GEM_HOME_LIB_MUWU, VERSION
Instance Attribute Summary collapse
-
#commonmarker_options ⇒ Object
Returns the value of attribute commonmarker_options.
-
#depth ⇒ Object
Returns the value of attribute depth.
-
#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.
-
#generate_inner_identifiers ⇒ Object
Returns the value of attribute generate_inner_identifiers.
-
#heading ⇒ Object
Returns the value of attribute heading.
-
#heading_origin ⇒ Object
Returns the value of attribute heading_origin.
-
#html_id ⇒ Object
Returns the value of attribute html_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#is_parent_heading ⇒ Object
Returns the value of attribute is_parent_heading.
-
#numbering ⇒ Object
Returns the value of attribute numbering.
-
#numbering_as_text ⇒ Object
Returns the value of attribute numbering_as_text.
-
#project ⇒ Object
Returns the value of attribute project.
-
#source_filename_absolute ⇒ Object
Returns the value of attribute source_filename_absolute.
-
#source_filename_relative ⇒ Object
Returns the value of attribute source_filename_relative.
-
#source_relative_segments ⇒ Object
Returns the value of attribute source_relative_segments.
-
#subtopics ⇒ Object
Returns the value of attribute subtopics.
-
#subtopics_are_distinct ⇒ Object
Returns the value of attribute subtopics_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_subtopics ⇒ 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
#commonmarker_options ⇒ Object
Returns the value of attribute commonmarker_options.
12 13 14 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 12 def end |
#depth ⇒ Object
Returns the value of attribute depth.
12 13 14 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 12 def depth @depth end |
#destination ⇒ Object
Returns the value of attribute destination.
12 13 14 |
# File 'lib/muwu/render_html_partial/render_topic.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_topic.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_topic.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_topic.rb', line 12 def end_links @end_links end |
#generate_inner_identifiers ⇒ Object
Returns the value of attribute generate_inner_identifiers.
12 13 14 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 12 def generate_inner_identifiers @generate_inner_identifiers end |
#heading ⇒ Object
Returns the value of attribute heading.
12 13 14 |
# File 'lib/muwu/render_html_partial/render_topic.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_topic.rb', line 12 def heading_origin @heading_origin end |
#html_id ⇒ Object
Returns the value of attribute html_id.
12 13 14 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 12 def html_id @html_id end |
#id ⇒ Object
Returns the value of attribute id.
12 13 14 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 12 def id @id end |
#is_parent_heading ⇒ Object
Returns the value of attribute is_parent_heading.
12 13 14 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 12 def is_parent_heading @is_parent_heading end |
#numbering ⇒ Object
Returns the value of attribute numbering.
12 13 14 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 12 def numbering @numbering end |
#numbering_as_text ⇒ Object
Returns the value of attribute numbering_as_text.
12 13 14 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 12 def numbering_as_text @numbering_as_text end |
#project ⇒ Object
Returns the value of attribute project.
12 13 14 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 12 def project @project end |
#source_filename_absolute ⇒ Object
Returns the value of attribute source_filename_absolute.
12 13 14 |
# File 'lib/muwu/render_html_partial/render_topic.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_topic.rb', line 12 def source_filename_relative @source_filename_relative end |
#source_relative_segments ⇒ Object
Returns the value of attribute source_relative_segments.
12 13 14 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 12 def source_relative_segments @source_relative_segments end |
#subtopics ⇒ Object
Returns the value of attribute subtopics.
12 13 14 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 12 def subtopics @subtopics end |
#subtopics_are_distinct ⇒ Object
Returns the value of attribute subtopics_are_distinct.
12 13 14 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 12 def subtopics_are_distinct @subtopics_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_topic.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_topic.rb', line 12 def will_render_section_number @will_render_section_number end |
Instance Method Details
#render ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 38 def render @destination.padding_vertical(1) do write_tag_section_open render_section_number render_heading render_text if (@is_parent_heading == true) && (@subtopics_are_distinct == true) render_end_links render_subtopics elsif (@is_parent_heading == true) && (@subtopics_are_distinct == false) render_subtopics render_end_links elsif (@is_parent_heading == false) render_end_links end write_tag_section_close end end |
#render_end_link(name, href) ⇒ Object
69 70 71 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 69 def render_end_link(name, href) write_tag_nav_a(name, href) end |
#render_end_links ⇒ Object
58 59 60 61 62 63 64 65 66 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 58 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
74 75 76 77 78 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 74 def render_heading if heading_origin_is_basename_or_outline write_tag_heading end end |
#render_section_number ⇒ Object
81 82 83 84 85 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 81 def render_section_number if @will_render_section_number write_tag_span_section_number end end |
#render_subtopics ⇒ Object
88 89 90 91 92 93 94 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 88 def render_subtopics @destination.padding_vertical(1) do @subtopics.each do |subtopic| subtopic.render end end end |
#render_text ⇒ Object
97 98 99 100 101 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 97 def render_text if (source_file_exists == true) write_text_source_to_html end end |
#write_tag_heading ⇒ Object
104 105 106 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 104 def write_tag_heading @destination.write_line tag_heading end |
#write_tag_nav_a(name, href) ⇒ Object
109 110 111 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 109 def write_tag_nav_a(name, href) @destination.write_line tag_nav_a(name, href) end |
#write_tag_nav_close ⇒ Object
114 115 116 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 114 def write_tag_nav_close @destination.write_line tag_nav_close end |
#write_tag_nav_open ⇒ Object
119 120 121 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 119 def write_tag_nav_open @destination.write_line tag_nav_end_links_open end |
#write_tag_section_close ⇒ Object
129 130 131 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 129 def write_tag_section_close @destination.write_line tag_section_close end |
#write_tag_section_open ⇒ Object
124 125 126 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 124 def write_tag_section_open @destination.write_line tag_section_open end |
#write_tag_span_section_number ⇒ Object
134 135 136 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 134 def write_tag_span_section_number @destination.write_line tag_span_section_number end |
#write_text_file_missing ⇒ Object
139 140 141 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 139 def write_text_file_missing @destination.write_line tag_div_file_missing end |
#write_text_source_to_html ⇒ Object
144 145 146 |
# File 'lib/muwu/render_html_partial/render_topic.rb', line 144 def write_text_source_to_html @destination.write_inline source_convert_to_html end |