Sha256: 45658b68af11037f0055aab97f46e67876aba1535a35c6f09525cee5e8f563d1

Contents?: true

Size: 824 Bytes

Versions: 103

Compression:

Stored size: 824 Bytes

Contents

# frozen_string_literal: true

# title: TaskPaper Export
# description: Export TaskPaper-friendly data
# author: Brett Terpstra
# url: https://brettterpstra.com
module Doing
  class TaskPaperExport
    include Doing::Util

    def self.settings
      {
        trigger: 'task(?:paper)?|tp'
      }
    end

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

      options = variables[:options]

      options[:highlight] = false
      options[:wrap_width] = 0
      options[:tags_color] = false
      options[:output] = 'template'
      options[:template] = '- %title @date(%date)%note'

      Doing.logger.debug('TaskPaper Export:', "#{items.count} items output to TaskPaper format")
      @out = wwid.list_section(options)
    end

    Doing::Plugins.register 'taskpaper', :export, self
  end
end

Version data entries

103 entries across 103 versions & 1 rubygems

Version Path
doing-2.0.5.pre lib/doing/plugins/export/taskpaper_export.rb
doing-2.0.3.pre lib/doing/plugins/export/taskpaper_export.rb
doing-2.0.2.pre lib/doing/plugins/export/taskpaper_export.rb