File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5050 :task-begin
5151 {:main (* " - " :checkbox )
5252 :checkbox
53- {:main (+ :checkbox-done :checkbox-pending )
53+ {:main (+ :checkbox-done :checkbox-pending :checkbox-obsolete )
5454 :checkbox-done (* (+ " [x]" " [X]" ) (constant :checked ))
55- :checkbox-pending (* " [ ]" (constant :open ))}}
55+ :checkbox-pending (* " [ ]" (constant :open ))
56+ :checkbox-obsolete (* " [~]" (constant :obsolete ))}}
5657 :task-missed-on-date (* " (missed on " (constant :missed-on ) :date " )" )
5758 :task-body
5859 {:main (group (any :task-body-line ))
Original file line number Diff line number Diff line change 99 (string " # " (plan :title )))
1010
1111(defn- checkbox [task ]
12- (if (= (task :state ) :checked ) " [X]" " [ ]" ))
12+ (case (task :state )
13+ :open " [ ]"
14+ :checked " [X]"
15+ :obsolete " [~]" ))
1316
1417(defn- serialize-event-title [event ]
1518 (string " - " (event :title )))
Original file line number Diff line number Diff line change 33
44(import ./date )
55
6- (def states [:open :checked ])
6+ (def states [:open :checked :obsolete ])
77
88(defn build-task [title state &opt body ]
99 (default body @[])
Original file line number Diff line number Diff line change 2525 ## 2020-07-31, Friday
2626
2727 - Talked to Mike & Molly
28- - [x] #work - Review open pull requests
28+ - [X] #work - Review open pull requests
29+ - [~] #work - Review logs
2930 - [x] #work - Fix the flaky test
3031 ``` )
3132 (def parse-result (parse plan-string ))
5960 (test (task :title ) " #work - Review open pull requests" )
6061 (test (task :state ) :checked ))
6162 (let [task ((day-2 :tasks ) 1 )]
63+ (test (task :title ) " #work - Review logs" )
64+ (test (task :state ) :obsolete ))
65+ (let [task ((day-2 :tasks ) 2 )]
6266 (test (task :title ) " #work - Fix the flaky test" )
6367 (test (task :state ) :checked )))
6468
Original file line number Diff line number Diff line change 1717 (day/build-day (d/date 2020 8 1 )
1818 @[(event/build-event " Talked to Mike" @[" - He has a new car" ])]
1919 @[(task/build-task " Develop photos" :open )
20+ (task/build-task " Fix the lamp" :obsolete )
2021 (task/build-task " Pay bills" :checked @[" - Electricity" " - Water" ])
2122 (task/build-missed-task " Organize photos" (d/date 2020 7 20 ))])
2223 (day/build-day (d/date 2020 7 31 )
4041 - Talked to Mike
4142 - He has a new car
4243 - [ ] Develop photos
44+ - [~] Fix the lamp
4345 - [X] Pay bills
4446 - Electricity
4547 - Water
You can’t perform that action at this time.
0 commit comments