Sha256: 7705886b29ca9bba84e4f7c2aad2694c9af2631b8ca1d8362ff54673d28750e6
Contents?: true
Size: 909 Bytes
Versions: 34
Compression:
Stored size: 909 Bytes
Contents
# frozen_string_literal: true # title: Doing File Export # description: Export Doing format data # author: Brett Terpstra # url: https://brettterpstra.com module Doing class DoingExport def self.settings { trigger: 'doing' } end 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 Doing::Plugins.register 'doing', :export, self end end
Version data entries
34 entries across 34 versions & 1 rubygems