doing 1.0.19 → 1.0.20

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d675f8d0e03a45a55e9be965c7e1dd5da2e1f6329bd313327c92234ec54f4b57
4
- data.tar.gz: 591e84462f5a8a7d38b94f3daf6482c65d262306f246ffcb9d5125a794eb25bd
3
+ metadata.gz: b9c612dd40f383ef86320a0484b1ed9408fa761f13346f1ba64133ce94966fca
4
+ data.tar.gz: 5d5ef023946246e76a94bb726f3db8f623137a0930771d11c3dc180465c219a6
5
5
  SHA512:
6
- metadata.gz: cd522f9ba33483143c8f792d1c4e20c4952a91b968859f8b8c1350fe4b80c063f4158f4301c670164a4fa8404f4c9a94b522f025716a1a0effcab85485e83b91
7
- data.tar.gz: 79170973a2dd8b49d31ef3f6b576ab9bc9c34f135585b8f0aac074cb527f5a3da08310d1f6d7192ced81c3747f2289b9ce1065de6bbc2b31627093f209473e5a
6
+ metadata.gz: baae64a38314c2a406852a8479c3525fd287100aa738e538051e2f94848a1352d1f8ebbc8e3ed6b3136a9a3c5d49a6b28a6c1f53898a3bd0a26430505b907eda
7
+ data.tar.gz: 1b1c6af8c049e7c3f7e3eb9407e89af9f19e714b4ae3b740fe95b252515be5def9ed539e5df5a61d965440a2c4b7d2570bbf83ef126e7403e454714e97072dfc
data/README.md CHANGED
@@ -91,7 +91,7 @@ A basic configuration looks like this:
91
91
  :include_notes: true
92
92
 
93
93
 
94
- The config file is stored in `~/.doingrc`, and is created on the first run.
94
+ The config file is stored in `~/.doingrc`, and a skeleton file is created on the first run. Just run `doing` on its own to create the file.
95
95
 
96
96
  ### Per-folder configuration
97
97
 
@@ -312,6 +312,14 @@ And a few special colors you'll just have to try out to see:
312
312
 
313
313
  Any time you use one of the foreground colors it will reset the bold and background settings to their default automatically. You can force a reset to default terminal colors using `%default`.
314
314
 
315
+ ### HTML Templates
316
+
317
+ For commands that provide an HTML output option, you can customize the templates used for markup and CSS. The markup uses [HAML](http://haml.info/), and the styles are pure CSS.
318
+
319
+ To export the default configurations for customization, use `doing templates --type=[HAML|CSS]`. This will output to STDOUT where you can pipe it to a file, e.g. `doing templates --type=HAML > my_template.haml`. You can modify the markup, the CSS, or both.
320
+
321
+ Once you have either or both of the template files, edit `.doingrc` and look for the `html_template:` section. There are two subvalues, `haml:` and `css:`. Add the path to the templates you want to use. A tilde may be substituted for your home directory, e.g. `css: ~/styles/doing.css`.
322
+
315
323
  ## Usage
316
324
 
317
325
  doing [global options] command [command options] [arguments...]
@@ -540,12 +548,19 @@ Feel free to [poke around](http://github.com/ttscoff/doing/), I'll try to add mo
540
548
 
541
549
  ## Changelog
542
550
 
551
+ #### 1.0.20
552
+
553
+ - Rewrite HTML export templates with responsive layout and typography
554
+ - Ability to customize the HTML output using HAML and CSS
555
+ - New command `doing templates` to export default templates for HAML and CSS
556
+ - New config options under `html_template` for `haml` and `css`
557
+
543
558
  #### 1.0.19
544
559
 
545
560
  - For `doing note -e` include the entry title so you know what you're adding a note to
546
561
  - For any other command that allows `-e` include a comment noting that anything after the first line creates a note
547
562
  - Ignore # comments when parsing editor results
548
-
563
+ - Add a .md extension to the temp file passed to the editor so you can take advantage of any syntax highlighting and other features in your editor
549
564
 
550
565
  #### 1.0.18
551
566
 
@@ -692,8 +707,6 @@ Catching up on the changelog. Kind of. A lot has happened, mostly fixes.
692
707
  - fuzzy section guessing when specified section isn't found
693
708
  - fuzzy view guessing for `doing view` command
694
709
 
695
- ----
696
-
697
710
  #### 0.1.9
698
711
 
699
712
  - colors in templated output
data/bin/doing CHANGED
@@ -226,6 +226,28 @@ command :meanwhile do |c|
226
226
  end
227
227
  end
228
228
 
229
+ desc 'Output HTML templates for customization. Save them to files and use them in the configuration file under html_template'
230
+ command :templates do |c|
231
+ c.desc "Type of template to output (HAML|CSS)"
232
+ c.arg_name 'template_type'
233
+ c.flag [:t,:type]
234
+
235
+ c.action do |global_options,options,args|
236
+ unless options[:type]
237
+ raise "No type specified, use --type=[HAML|CSS]"
238
+ else
239
+ if options[:t] =~ /html|haml/i
240
+ $stdout.puts wwid.haml_template
241
+ elsif options[:t] =~ /css/i
242
+ $stdout.puts wwid.css_template
243
+ else
244
+ raise "Invalid type specified, use --type=[HAML|CSS]"
245
+ end
246
+ end
247
+ end
248
+ end
249
+
250
+
229
251
  desc 'Add an item to the Later section'
230
252
  arg_name 'entry'
231
253
  command :later do |c|
data/lib/doing/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Doing
2
- VERSION = '1.0.19'
2
+ VERSION = '1.0.20'
3
3
  end
data/lib/doing/wwid.rb CHANGED
@@ -54,6 +54,11 @@ class WWID
54
54
  @config['doing_file'] ||= "~/what_was_i_doing.md"
55
55
  @config['current_section'] ||= 'Currently'
56
56
  @config['editor_app'] ||= nil
57
+
58
+ @config['html_template'] ||= {}
59
+ @config['html_template']['haml'] ||= nil
60
+ @config['html_template']['css'] ||= nil
61
+
57
62
  @config['templates'] ||= {}
58
63
  @config['templates']['default'] ||= {
59
64
  'date_format' => '%Y-%m-%d %H:%M',
@@ -173,6 +178,14 @@ class WWID
173
178
  }
174
179
  end
175
180
 
181
+ def haml_template
182
+ IO.read(File.join(File.dirname(__FILE__), '../templates/doing.haml'))
183
+ end
184
+
185
+ def css_template
186
+ IO.read(File.join(File.dirname(__FILE__), '../templates/doing.css'))
187
+ end
188
+
176
189
  def create(filename=nil)
177
190
  if filename.nil?
178
191
  filename = @doing_file
@@ -960,31 +973,18 @@ EOTEMPLATE
960
973
  }
961
974
  }
962
975
 
963
- style = "body{background:#fff;color:#333;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:16px;line-height:120%;text-align:justify;padding:20px}h1{text-align:left;position:relative;left:220px;margin-bottom:1em}ul{list-style-position:outside;position:relative;left:170px;margin-right:170px;text-align:left}ul li{list-style-type:none;border-left:solid 1px #ccc;padding-left:10px;line-height:2;position:relative}ul li .date{font-size:14px;position:absolute;left:-122px;color:#7d9ca2;text-align:right;width:110px;line-height:2}ul li .tag{color:#999}ul li .note{display:block;color:#666;padding:0 0 0 22px;line-height:1.4;font-size:15px}ul li .note:before{content:'\\25BA';font-weight:300;position:absolute;left:40px;font-size:8px;color:#aaa;line-height:3}ul li:hover .note{display:block}span.time{color:#729953;float:left;position:relative;padding:0 5px;font-size:15px;border-bottom:dashed 1px #ccc;text-align:right;background:#f9fced;margin-right:4px}table td{border-bottom:solid 1px #ddd;height:24px}caption{text-align:left;border-bottom:solid 1px #aaa;margin:10px 0}table{width:400px;margin:50px 0 0 211px}th{padding-bottom:10px}th,td{padding-right:20px}table{max-width:400px;margin:50px 0 0 221px}ul li .section{color:#dbbfad;border-left:solid 1px #dbbfad;border-right:solid 1px #dbbfad;border-radius:25px;padding:0 4px;line-height:1 !important;font-size:.8em}ul li .section:hover{color:#c5753f}ul li a:link{color:#64a9a5;text-decoration:none;background-color:rgba(203,255,251,.15)}"
964
- template =<<EOT
965
- !!!
966
- %html
967
- %head
968
- %meta{"charset" => "utf-8"}/
969
- %meta{"content" => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible"}/
970
- %title what are you doing?
971
- %style= @style
972
- %body
973
- %header
974
- %h1= @page_title
975
- %article
976
- %ul
977
- - @items.each do |i|
978
- %li
979
- %span.date= i[:date]
980
- = i[:title]
981
- %span.section= i[:section]
982
- - if i[:time] && i[:time] != "00:00:00"
983
- %span.time= i[:time]
984
- - if i[:note]
985
- %span.note= i[:note].map{|n| n.strip }.join('<br>')
986
- = @totals
987
- EOT
976
+ if @config['html_template']['haml'] && File.exists?(File.expand_path(@config['html_template']['haml']))
977
+ template = IO.read(File.expand_path(@config['html_template']['haml']))
978
+ else
979
+ template = haml_template
980
+ end
981
+
982
+ if @config['html_template']['css'] && File.exists?(File.expand_path(@config['html_template']['css']))
983
+ style = IO.read(File.expand_path(@config['html_template']['css']))
984
+ else
985
+ style = css_template
986
+ end
987
+
988
988
  totals = opt[:totals] ? tag_times("html") : ""
989
989
  engine = Haml::Engine.new(template)
990
990
  puts engine.render(Object.new, { :@items => items_out, :@page_title => page_title, :@style => style, :@totals => totals })
data/lib/doing.rb CHANGED
@@ -9,4 +9,3 @@ require 'chronic'
9
9
  require 'haml'
10
10
  require 'json'
11
11
  require 'doing/wwid.rb'
12
-
@@ -0,0 +1,169 @@
1
+ body {
2
+ background: #fff;
3
+ color: #333;
4
+ font-family: Helvetica,arial,freesans,clean,sans-serif;
5
+ font-size: 21px;
6
+ line-height: 1.5;
7
+ text-align: justify;
8
+ }
9
+
10
+ @media only screen and (max-width: 900px) {
11
+ body {
12
+ font-size: calc(12px + 1vw);
13
+ }
14
+
15
+ .date,
16
+ .note {
17
+ font-size: calc(8px + 1vw)!important;
18
+ }
19
+ }
20
+
21
+ h1 {
22
+ margin-bottom: 1em;
23
+ margin-left: .1em;
24
+ position: relative;
25
+ text-align: left;
26
+ }
27
+
28
+ ul {
29
+ list-style-position: outside;
30
+ position: relative;
31
+ text-align: left;
32
+ padding-left: 0;
33
+ }
34
+
35
+ article > ul > li {
36
+ display: grid;
37
+ grid-template-columns: 14ch auto;
38
+ line-height: 1.2;
39
+ list-style-type: none;
40
+ padding-left: 10px;
41
+ position: relative;
42
+ word-break: break-word;
43
+ transition: background .2s ease-in-out;
44
+ }
45
+
46
+ article > ul > li:hover {
47
+ background: rgba(150,150,150,.05);
48
+ }
49
+
50
+ .date {
51
+ color: #7d9ca2;
52
+ font-size: 14px;
53
+ padding: 15px 1ch 0 0;
54
+ text-align: right;
55
+ white-space: nowrap;
56
+ transition: color .2s ease-in-out;
57
+ }
58
+
59
+ .entry {
60
+ border-left: solid 1px #ccc;
61
+ line-height: 1.2;
62
+ padding: 10px 10px 10px 3ch;
63
+ text-indent: -2ch;
64
+ }
65
+
66
+ .tag {
67
+ color: #999;
68
+ transition: color 1s ease-in;
69
+ }
70
+
71
+ .note {
72
+ color: #aaa;
73
+ display: block;
74
+ font-size: 16px;
75
+ line-height: 1.1;
76
+ padding: 1em 0 0 2ch;
77
+ position: relative;
78
+ transition: color .2s ease-in-out;
79
+ }
80
+
81
+ li:hover .note {
82
+ color: #777;
83
+ }
84
+
85
+ li:hover .tag {
86
+ color: rgb(182, 120, 125);
87
+ }
88
+
89
+ li:hover .date {
90
+ color: rgb(100, 169, 165);
91
+ }
92
+
93
+ .note li {
94
+ margin-bottom: .5em;
95
+ list-style: none;
96
+ position: relative;
97
+ }
98
+
99
+ .note li:before {
100
+ color: #ddd;
101
+ content: '\25BA';
102
+ font-size: 12px;
103
+ font-weight: 300;
104
+ left: -3ch;
105
+ position: absolute;
106
+ top: .25em;
107
+ }
108
+
109
+ .time {
110
+ background: #f9fced;
111
+ border-bottom: dashed 1px #ccc;
112
+ color: #729953;
113
+ font-size: 15px;
114
+ margin-right: 4px;
115
+ padding: 0 5px;
116
+ position: relative;
117
+ text-align: right;
118
+ }
119
+
120
+ table td {
121
+ border-bottom: solid 1px #ddd;
122
+ height: 24px;
123
+ }
124
+
125
+ caption {
126
+ border-bottom: solid 1px #aaa;
127
+ margin: 10px 0;
128
+ text-align: left;
129
+ }
130
+
131
+ table {
132
+ margin: 50px 0 0 211px;
133
+ width: 400px;
134
+ }
135
+
136
+ th {
137
+ padding-bottom: 10px;
138
+ }
139
+
140
+ th, td {
141
+ padding-right: 20px;
142
+ }
143
+
144
+ table {
145
+ margin: 50px 0 2em 16ch;
146
+ max-width: 400px;
147
+ }
148
+
149
+ .section {
150
+ border-left: solid 1px rgb(182, 120, 125);
151
+ border-radius: 25px;
152
+ border-right: solid 1px rgb(182, 120, 125);
153
+ color: rgb(182, 120, 125);
154
+ font-size: .8em;
155
+ line-height: 1 !important;
156
+ padding: 0 4px;
157
+ transition: background .4s ease-in, color .4s ease-in;
158
+ }
159
+
160
+ li:hover .section {
161
+ color: #fff;
162
+ background: rgb(182, 120, 125);
163
+ }
164
+
165
+ a:link {
166
+ background-color: rgba(203, 255, 251, .15);
167
+ color: #64a9a5;
168
+ text-decoration: none;
169
+ }
@@ -0,0 +1,25 @@
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
+ %article
12
+ %ul
13
+ - @items.each do |i|
14
+ %li
15
+ %span.date= i[:date]
16
+ %div.entry
17
+ = i[:title]
18
+ %span.section= i[:section]
19
+ - if i[:time] && i[:time] != "00:00:00"
20
+ %span.time= i[:time]
21
+ - if i[:note]
22
+ %ul.note
23
+ - i[:note].map{|n| n.strip }.each do |li|
24
+ %li= li
25
+ = @totals
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.19
4
+ version: 1.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
@@ -96,16 +96,22 @@ dependencies:
96
96
  name: haml
97
97
  requirement: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - '='
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: 5.0.0
102
+ - - "~>"
100
103
  - !ruby/object:Gem::Version
101
- version: 4.0.3
104
+ version: 5.0.0
102
105
  type: :runtime
103
106
  prerelease: false
104
107
  version_requirements: !ruby/object:Gem::Requirement
105
108
  requirements:
106
- - - '='
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: 5.0.0
112
+ - - "~>"
107
113
  - !ruby/object:Gem::Version
108
- version: 4.0.3
114
+ version: 5.0.0
109
115
  - !ruby/object:Gem::Dependency
110
116
  name: chronic
111
117
  requirement: !ruby/object:Gem::Requirement
@@ -181,6 +187,8 @@ files:
181
187
  - lib/doing.rb
182
188
  - lib/doing/version.rb
183
189
  - lib/doing/wwid.rb
190
+ - lib/templates/doing.css
191
+ - lib/templates/doing.haml
184
192
  homepage: http://brettterpstra.com/project/doing/
185
193
  licenses:
186
194
  - MIT