module Doing
Main doing module
Cribbed from github.com/flori/term-ansicolor
title: By Day Export description: Export a table of items grouped by day with daily totals author: Brett Terpstra url: brettterpstra.com
title: CSV Export description: Export CSV formatted data with header row author: Brett Terpstra url: brettterpstra.com
title: Day One Export description: Export entries to Day One plist for auto import author: Brett Terpstra url: brettterpstra.com
title: Doing
File Export description: Export Doing
format data author: Brett Terpstra url: brettterpstra.com
title: HTML Export description: Export styled HTML view of data author: Brett Terpstra url: brettterpstra.com
title: JSON Export description: Export JSON-formatted data, including entry durations and tag totals author: Brett Terpstra url: brettterpstra.com
title: Markdown Export description: Export GFM-style task list author: Brett Terpstra url: brettterpstra.com
title: TaskPaper Export description: Export TaskPaper-friendly data author: Brett Terpstra url: brettterpstra.com
title: Template Export description: Default export option using configured template placeholders author: Brett Terpstra url: brettterpstra.com
title: Doing
Format Import description: Import entries from a Doing-formatted file author: Brett Terpstra url: brettterpstra.com
title: JSON Import description: Import entries from a Doing
JSON export author: Brett Terpstra url: brettterpstra.com
title: Timing.app Import description: Import entries from a Timing.app report (JSON) author: Brett Terpstra url: brettterpstra.com
title: Capture Thing Import description: Import entries from a Capture Thing folder author: Brett Terpstra url: brettterpstra.com
Example
doing show -o sayit
Configuration
¶ ↑
Change
what the plugin says by generating a template with doing template --type say
, saving it to a file, and putting the path to that file in export_templates->say
in .doingrc.
export_templates: say: /path/to/template.txt
Use a different voice by adding a say_voice
key to your .doingrc. Use say -v ?
to see available voices.
say_voice: Zarvox
title: HTML Export description: Export styled HTML view of data author: Brett Terpstra url: brettterpstra.com
Constants
- VERSION
Attributes
Public Class Methods
Add the entry to Day One using the CLI
@param entry The entry to add
# File lib/examples/plugins/hooks.rb, line 43 def self.add_to_day_one(entry, config) dayone = TTY::Which.which('dayone2') flagged = entry.tags?('flagged') ? ' -s' : '' tags = entry.tags.map { |t| Shellwords.escape(t) }.join(' ') tags = tags.length.positive? ? " -t #{tags}" : '' date = " -d '#{entry.date.strftime('%Y-%m-%d %H:%M:%S')}'" title = entry.title.tag(config['day_one_trigger'], remove: true) title += "\n#{entry.note}" unless entry.note.empty? `echo #{Shellwords.escape(title)} | #{dayone} new#{flagged}#{date}#{tags}` end
Holds a Configuration
object with methods and a @settings hash
@return [Configuration] Configuration
object
# File lib/doing.rb, line 76 def config @config ||= Configuration.new end
Update configuration from specified file
@param file [String] Path to new config file @param options [Hash] options
@option options :ignore_local Ignore local configuration files
# File lib/doing.rb, line 141 def config_with(file, options = {}) @config = Configuration.new(file, options: options) end
Fetch the logger
@return the Logger
instance.
# File lib/doing.rb, line 67 def logger @logger ||= Logger.new((ENV['DOING_LOG_LEVEL'] || :info).to_sym) end
# File lib/doing.rb, line 89 def original_options @original_options ||= { date_begin: nil, date_end: nil, date_range: nil, date_interval: nil } end
# File lib/doing.rb, line 126 def set(keypath, value) real_path = config.resolve_key_path(keypath, create: false) return nil unless real_path&.count&.positive? config.settings.deep_set(real_path, value) end
Fetch a config setting using a dot-separated keypath or array of keys
@param keypath [String|Array] Either a dot-separated key path (search.case) or array of keys ([‘search’, ‘case’]) @param default A default value to return if the provided path returns nil result
# File lib/doing.rb, line 109 def setting(keypath, default = nil, exact: false) cfg = config.settings case keypath when Array cfg.dig(*keypath) || default when String unless keypath =~ /^[.*]?$/ real_path = config.resolve_key_path(keypath, create: false, distance: 0, exact: exact) return default unless real_path&.count&.positive? cfg = cfg.dig(*real_path) end cfg.nil? ? default : cfg end end
Shortcut for Doing.config
.settings
@return [Hash] Settings hash
# File lib/doing.rb, line 85 def settings config.settings end