Class: Doing::DoingExport

Inherits:
Object show all
Defined in:
lib/doing/plugins/export/doing_export.rb

Class Method Summary collapse

Class Method Details

.render(wwid, items, variables: {}) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/doing/plugins/export/doing_export.rb', line 15

def self.render(wwid, items, variables: {})
  return if items.nil?

  content = Doing::Items.new
  items.each do |item|
    content.add_section(item.section, log: false)
    content.push(item)
  end

  out = []
  content.sections.each do |section|
    out.push(section.original)
    is = content.in_section(section.title).sort_by { |i| [i.date, i.title] }
    is.reverse! if Doing.setting('doing_file_sort').normalize_order == :desc
    is.each { |item| out.push(item.to_s) }
  end

  Doing::Pager.page out.join("\n")
end

.settingsObject



9
10
11
12
13
# File 'lib/doing/plugins/export/doing_export.rb', line 9

def self.settings
  {
    trigger: 'doing'
  }
end