Module: YARD::Markdown::SectionAssemblyHelper
- Defined in:
- lib/yard/markdown/section_assembly_helper.rb
Overview
Assembles grouped content into ordered Markdown sections.
Class Method Summary collapse
-
.grouped_items(items, group_order) ⇒ Array<Array>
Groups items by their YARD group and orders them for rendering.
-
.render_section_content(content) ⇒ String
Returns section content with the expected trailing spacing.
Class Method Details
.grouped_items(items, group_order) ⇒ Array<Array>
Groups items by their YARD group and orders them for rendering.
23 24 25 26 |
# File 'lib/yard/markdown/section_assembly_helper.rb', line 23 def self.grouped_items(items, group_order) groups = items.group_by(&:group) ordered_group_names(groups.keys, Array(group_order)).map { |name| [name, groups.fetch(name)] } end |
.render_section_content(content) ⇒ String
Returns section content with the expected trailing spacing.
11 12 13 14 15 16 |
# File 'lib/yard/markdown/section_assembly_helper.rb', line 11 def self.render_section_content(content) text = content.to_s.strip return "" if text.empty? "#{text}\n\n" end |