Class: Muwu::RenderHtmlPartial::Topic

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Methods included from Muwu

debug, read

Instance Attribute Details

#commonmarker_optionsObject

Returns the value of attribute commonmarker_options.



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

def commonmarker_options
  @commonmarker_options
end

#depthObject

Returns the value of attribute depth.



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

def depth
  @depth
end

#destinationObject

Returns the value of attribute destination.



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

def destination
  @destination
end

#distinctObject

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_textObject

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

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_identifiersObject

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

#headingObject

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_originObject

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_idObject

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

#idObject

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_headingObject

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

#numberingObject

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_textObject

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

#projectObject

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_absoluteObject

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_relativeObject

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_segmentsObject

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

#subtopicsObject

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_distinctObject

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_nameObject

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_numberObject

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

#renderObject



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


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


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_headingObject



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_numberObject



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_subtopicsObject



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_textObject



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_headingObject



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_closeObject



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_openObject



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_closeObject



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_openObject



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_numberObject



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_missingObject



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_htmlObject



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