doing 1.0.93 → 2.0.6.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/AUTHORS +19 -0
 - data/CHANGELOG.md +616 -0
 - data/COMMANDS.md +1181 -0
 - data/Gemfile +2 -0
 - data/Gemfile.lock +110 -0
 - data/LICENSE +23 -0
 - data/README.md +15 -699
 - data/Rakefile +79 -0
 - data/_config.yml +1 -0
 - data/bin/doing +1055 -494
 - data/doing.gemspec +34 -0
 - data/doing.rdoc +1839 -0
 - data/example_plugin.rb +209 -0
 - data/generate_completions.sh +5 -0
 - data/img/doing-colors.jpg +0 -0
 - data/img/doing-printf-wrap-800.jpg +0 -0
 - data/img/doing-show-note-formatting-800.jpg +0 -0
 - data/lib/completion/_doing.zsh +203 -0
 - data/lib/completion/doing.bash +449 -0
 - data/lib/completion/doing.fish +329 -0
 - data/lib/doing/array.rb +8 -0
 - data/lib/doing/cli_status.rb +70 -0
 - data/lib/doing/colors.rb +136 -0
 - data/lib/doing/configuration.rb +312 -0
 - data/lib/doing/errors.rb +109 -0
 - data/lib/doing/hash.rb +31 -0
 - data/lib/doing/hooks.rb +59 -0
 - data/lib/doing/item.rb +155 -0
 - data/lib/doing/log_adapter.rb +344 -0
 - data/lib/doing/markdown_document_listener.rb +174 -0
 - data/lib/doing/note.rb +59 -0
 - data/lib/doing/pager.rb +95 -0
 - data/lib/doing/plugin_manager.rb +208 -0
 - data/lib/doing/plugins/export/csv_export.rb +48 -0
 - data/lib/doing/plugins/export/html_export.rb +83 -0
 - data/lib/doing/plugins/export/json_export.rb +140 -0
 - data/lib/doing/plugins/export/markdown_export.rb +85 -0
 - data/lib/doing/plugins/export/taskpaper_export.rb +34 -0
 - data/lib/doing/plugins/export/template_export.rb +141 -0
 - data/lib/doing/plugins/import/cal_to_json.scpt +0 -0
 - data/lib/doing/plugins/import/calendar_import.rb +76 -0
 - data/lib/doing/plugins/import/doing_import.rb +144 -0
 - data/lib/doing/plugins/import/timing_import.rb +78 -0
 - data/lib/doing/string.rb +348 -0
 - data/lib/doing/symbol.rb +16 -0
 - data/lib/doing/time.rb +18 -0
 - data/lib/doing/util.rb +186 -0
 - data/lib/doing/version.rb +1 -1
 - data/lib/doing/wwid.rb +1868 -2349
 - data/lib/doing/wwidfile.rb +117 -0
 - data/lib/doing.rb +43 -3
 - data/lib/examples/commands/autotag.rb +63 -0
 - data/lib/examples/commands/wiki.rb +81 -0
 - data/lib/examples/plugins/hooks.rb +22 -0
 - data/lib/examples/plugins/say_export.rb +202 -0
 - data/lib/examples/plugins/templates/wiki.css +169 -0
 - data/lib/examples/plugins/templates/wiki.haml +27 -0
 - data/lib/examples/plugins/templates/wiki_index.haml +18 -0
 - data/lib/examples/plugins/wiki_export.rb +87 -0
 - data/lib/templates/doing-markdown.erb +5 -0
 - data/man/doing.1 +964 -0
 - data/man/doing.1.html +711 -0
 - data/man/doing.1.ronn +600 -0
 - data/package-lock.json +3 -0
 - data/rdoc_to_mmd.rb +42 -0
 - data/rdocfixer.rb +13 -0
 - data/scripts/generate_bash_completions.rb +211 -0
 - data/scripts/generate_fish_completions.rb +204 -0
 - data/scripts/generate_zsh_completions.rb +168 -0
 - metadata +82 -7
 - data/lib/doing/helpers.rb +0 -191
 - data/lib/doing/markdown_export.rb +0 -16
 
| 
         @@ -0,0 +1,27 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            !!!
         
     | 
| 
      
 2 
     | 
    
         
            +
            %html
         
     | 
| 
      
 3 
     | 
    
         
            +
            %head
         
     | 
| 
      
 4 
     | 
    
         
            +
              %meta{"charset" => "utf-8"}/
         
     | 
| 
      
 5 
     | 
    
         
            +
              %meta{"content" => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible"}/
         
     | 
| 
      
 6 
     | 
    
         
            +
              %title what are you doing?
         
     | 
| 
      
 7 
     | 
    
         
            +
              %style= @style
         
     | 
| 
      
 8 
     | 
    
         
            +
            %body
         
     | 
| 
      
 9 
     | 
    
         
            +
              %header
         
     | 
| 
      
 10 
     | 
    
         
            +
                %h1= @page_title
         
     | 
| 
      
 11 
     | 
    
         
            +
                %p
         
     | 
| 
      
 12 
     | 
    
         
            +
                  %a{ href: 'index.html' }= "[[Home]]"
         
     | 
| 
      
 13 
     | 
    
         
            +
              %article
         
     | 
| 
      
 14 
     | 
    
         
            +
                %ul
         
     | 
| 
      
 15 
     | 
    
         
            +
                  - @items.each do |i|
         
     | 
| 
      
 16 
     | 
    
         
            +
                    %li
         
     | 
| 
      
 17 
     | 
    
         
            +
                      %span.date= i[:date]
         
     | 
| 
      
 18 
     | 
    
         
            +
                      %div.entry
         
     | 
| 
      
 19 
     | 
    
         
            +
                        = i[:title]
         
     | 
| 
      
 20 
     | 
    
         
            +
                        %span.section= i[:section]
         
     | 
| 
      
 21 
     | 
    
         
            +
                        - if i[:time] && i[:time] != "00:00:00"
         
     | 
| 
      
 22 
     | 
    
         
            +
                          %span.time= i[:time]
         
     | 
| 
      
 23 
     | 
    
         
            +
                        - if i[:note]
         
     | 
| 
      
 24 
     | 
    
         
            +
                          %ul.note
         
     | 
| 
      
 25 
     | 
    
         
            +
                            - i[:note].map{|n| n.strip }.each do |li|
         
     | 
| 
      
 26 
     | 
    
         
            +
                              %li= li
         
     | 
| 
      
 27 
     | 
    
         
            +
                = @totals
         
     | 
| 
         @@ -0,0 +1,18 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            !!!
         
     | 
| 
      
 2 
     | 
    
         
            +
            %html
         
     | 
| 
      
 3 
     | 
    
         
            +
            %head
         
     | 
| 
      
 4 
     | 
    
         
            +
              %meta{"charset" => "utf-8"}/
         
     | 
| 
      
 5 
     | 
    
         
            +
              %meta{"content" => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible"}/
         
     | 
| 
      
 6 
     | 
    
         
            +
              %title= @page_title
         
     | 
| 
      
 7 
     | 
    
         
            +
              %style= @style
         
     | 
| 
      
 8 
     | 
    
         
            +
            %body
         
     | 
| 
      
 9 
     | 
    
         
            +
              %header
         
     | 
| 
      
 10 
     | 
    
         
            +
                %h1= @page_title
         
     | 
| 
      
 11 
     | 
    
         
            +
              %article
         
     | 
| 
      
 12 
     | 
    
         
            +
                %ul
         
     | 
| 
      
 13 
     | 
    
         
            +
                  - @tags.each do |tag|
         
     | 
| 
      
 14 
     | 
    
         
            +
                    %li
         
     | 
| 
      
 15 
     | 
    
         
            +
                      %a{href: "#{tag[:name]}.html"}
         
     | 
| 
      
 16 
     | 
    
         
            +
                        %span.tag= tag[:name]
         
     | 
| 
      
 17 
     | 
    
         
            +
                        %span.count= "(#{tag[:count]})"
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
         @@ -0,0 +1,87 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            # title: HTML Export
         
     | 
| 
      
 4 
     | 
    
         
            +
            # description: Export styled HTML view of data
         
     | 
| 
      
 5 
     | 
    
         
            +
            # author: Brett Terpstra
         
     | 
| 
      
 6 
     | 
    
         
            +
            # url: https://brettterpstra.com
         
     | 
| 
      
 7 
     | 
    
         
            +
            module Doing
         
     | 
| 
      
 8 
     | 
    
         
            +
              class WikiExport
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
                def self.settings
         
     | 
| 
      
 11 
     | 
    
         
            +
                  {
         
     | 
| 
      
 12 
     | 
    
         
            +
                    trigger: 'wiki',
         
     | 
| 
      
 13 
     | 
    
         
            +
                    templates: [
         
     | 
| 
      
 14 
     | 
    
         
            +
                      { name: 'wiki_page', trigger: 'wiki.?page' },
         
     | 
| 
      
 15 
     | 
    
         
            +
                      { name: 'wiki_index', trigger: 'wiki.?index' },
         
     | 
| 
      
 16 
     | 
    
         
            +
                      { name: 'wiki_css', trigger: 'wiki.?css' }
         
     | 
| 
      
 17 
     | 
    
         
            +
                    ]
         
     | 
| 
      
 18 
     | 
    
         
            +
                  }
         
     | 
| 
      
 19 
     | 
    
         
            +
                end
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
                def self.template(trigger)
         
     | 
| 
      
 22 
     | 
    
         
            +
                  if trigger =~ /css/
         
     | 
| 
      
 23 
     | 
    
         
            +
                    IO.read(File.join(File.dirname(__FILE__), 'templates/wiki.css'))
         
     | 
| 
      
 24 
     | 
    
         
            +
                  elsif trigger =~ /index/
         
     | 
| 
      
 25 
     | 
    
         
            +
                    IO.read(File.join(File.dirname(__FILE__), 'templates/wiki_index.haml'))
         
     | 
| 
      
 26 
     | 
    
         
            +
                  else
         
     | 
| 
      
 27 
     | 
    
         
            +
                    IO.read(File.join(File.dirname(__FILE__), 'templates/wiki.haml'))
         
     | 
| 
      
 28 
     | 
    
         
            +
                  end
         
     | 
| 
      
 29 
     | 
    
         
            +
                end
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
                def self.render(wwid, items, variables: {})
         
     | 
| 
      
 32 
     | 
    
         
            +
                  return if items.nil?
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
                  opt = variables[:options]
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
                  items_out = []
         
     | 
| 
      
 37 
     | 
    
         
            +
                  items.each do |i|
         
     | 
| 
      
 38 
     | 
    
         
            +
                    # if i.has_key?('note')
         
     | 
| 
      
 39 
     | 
    
         
            +
                    #   note = '<span class="note">' + i.note.map{|n| n.strip }.join('<br>') + '</span>'
         
     | 
| 
      
 40 
     | 
    
         
            +
                    # else
         
     | 
| 
      
 41 
     | 
    
         
            +
                    #   note = ''
         
     | 
| 
      
 42 
     | 
    
         
            +
                    # end
         
     | 
| 
      
 43 
     | 
    
         
            +
                    if String.method_defined? :force_encoding
         
     | 
| 
      
 44 
     | 
    
         
            +
                      title = i.title.force_encoding('utf-8').link_urls
         
     | 
| 
      
 45 
     | 
    
         
            +
                      note = i.note.map { |line| line.force_encoding('utf-8').strip.link_urls } if i.note
         
     | 
| 
      
 46 
     | 
    
         
            +
                    else
         
     | 
| 
      
 47 
     | 
    
         
            +
                      title = i.title.link_urls
         
     | 
| 
      
 48 
     | 
    
         
            +
                      note = i.note.map { |line| line.strip.link_urls } if i.note
         
     | 
| 
      
 49 
     | 
    
         
            +
                    end
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
                    interval = wwid.get_interval(i) if i.title =~ /@done\((\d{4}-\d\d-\d\d \d\d:\d\d.*?)\)/ && opt[:times]
         
     | 
| 
      
 52 
     | 
    
         
            +
                    interval ||= false
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
      
 54 
     | 
    
         
            +
                    title.gsub!(/(@([^ (]+)(\(.*?\))?)/im, '<a class="tag" href="\2.html">\1</a>').strip
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
                    items_out << {
         
     | 
| 
      
 57 
     | 
    
         
            +
                      date: i.date.strftime('%a %-I:%M%p'),
         
     | 
| 
      
 58 
     | 
    
         
            +
                      title: title, #+ " #{note}"
         
     | 
| 
      
 59 
     | 
    
         
            +
                      note: note,
         
     | 
| 
      
 60 
     | 
    
         
            +
                      time: interval,
         
     | 
| 
      
 61 
     | 
    
         
            +
                      section: i.section
         
     | 
| 
      
 62 
     | 
    
         
            +
                    }
         
     | 
| 
      
 63 
     | 
    
         
            +
                  end
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
                  template = if wwid.config['export_templates']['wiki_page'] && File.exist?(File.expand_path(wwid.config['export_templates']['wiki_haml']))
         
     | 
| 
      
 66 
     | 
    
         
            +
                               IO.read(File.expand_path(wwid.config['export_templates']['wiki_page']))
         
     | 
| 
      
 67 
     | 
    
         
            +
                             else
         
     | 
| 
      
 68 
     | 
    
         
            +
                               self.template('wiki_html')
         
     | 
| 
      
 69 
     | 
    
         
            +
                             end
         
     | 
| 
      
 70 
     | 
    
         
            +
             
     | 
| 
      
 71 
     | 
    
         
            +
                  style = if wwid.config['export_templates']['wiki_css'] && File.exist?(File.expand_path(wwid.config['export_templates']['wiki_css']))
         
     | 
| 
      
 72 
     | 
    
         
            +
                            IO.read(File.expand_path(wwid.config['export_templates']['wiki_css']))
         
     | 
| 
      
 73 
     | 
    
         
            +
                          else
         
     | 
| 
      
 74 
     | 
    
         
            +
                            self.template('wiki_css')
         
     | 
| 
      
 75 
     | 
    
         
            +
                          end
         
     | 
| 
      
 76 
     | 
    
         
            +
             
     | 
| 
      
 77 
     | 
    
         
            +
                  totals = opt[:totals] ? wwid.tag_times(format: :html, sort_by_name: opt[:sort_tags], sort_order: opt[:tag_order]) : ''
         
     | 
| 
      
 78 
     | 
    
         
            +
                  engine = Haml::Engine.new(template)
         
     | 
| 
      
 79 
     | 
    
         
            +
                  Doing.logger.debug('Wiki Export:', "#{items_out.count} items output to #{variables[:page_title]} wiki page")
         
     | 
| 
      
 80 
     | 
    
         
            +
                  @out = engine.render(Object.new,
         
     | 
| 
      
 81 
     | 
    
         
            +
                                     { :@items => items_out, :@page_title => variables[:page_title], :@style => style, :@totals => totals })
         
     | 
| 
      
 82 
     | 
    
         
            +
                end
         
     | 
| 
      
 83 
     | 
    
         
            +
             
     | 
| 
      
 84 
     | 
    
         
            +
                Doing::Plugins.register 'wiki', :export, self
         
     | 
| 
      
 85 
     | 
    
         
            +
              end
         
     | 
| 
      
 86 
     | 
    
         
            +
            end
         
     | 
| 
      
 87 
     | 
    
         
            +
             
     | 
| 
         @@ -0,0 +1,5 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # <%= @page_title %>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <% @items.each do |i| %>
         
     | 
| 
      
 3 
     | 
    
         
            +
            - [<%= i[:done] %>] <%= i[:date] %> <%= i[:title] %> <% if i[:time] && i[:time] != "00:00:00" %>[**<%= i[:time] %>**]<% end %><% if i[:note].length.positive? %><%= "\n\n    " + i[:note].map{|n| n.strip }.join("\n    ") %><% end %><% end %>
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            <%= @totals %>
         
     |