Skip to content

Commit 3b5f7e8

Browse files
committed
Typos,biweekly recurrence, webserver work (broken)
1 parent a097ec2 commit 3b5f7e8

24 files changed

+303
-37
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ main
55
main
66
dist
77
redo.vc.code-workspace
8-
redovc
8+
redovc
9+
web/tasks.json
10+
web/web

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ To learn about available redo.vc commands, see the [usage page](https://redo.vc/
1010
* Ability to serve todo data as json, html or CSV via http
1111
* [Search capabilities](https://redo.vc/commands/list/) - Search for strings in all of your todos when using the list command
1212
* [Theming capabilities](https://redo.vc/theming) - Change all the colors and column order on the fly!
13+
* Recurrence daily, weekly and more!
1314
* Adding additional due strings (End of quarter, End of Month)
1415
* Tasks can be assigned to a project
1516
* Projects can be created dynamically while creating todos
@@ -37,7 +38,7 @@ Find the installation for your device in the releases section of the GitHub proj
3738
* [DONE] Theming capabilities
3839
* [DONE] Adding additional due strings (End of quarter, End of Month)
3940
* Syncing via cloud providers (Google Drive, iCloud, Dropbox, etc.)
40-
* [STARTED] Web UI
41+
* [continuing] Web UI
4142
* Importing from common formats
4243
* Config file defaults
4344
* Whatever you would like to see! [Let me know](https://github.com/sottey/redo.vc/discussions)

Rakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Envs = [
1111
{ goos: "windows", arch: "amd64" }
1212
].freeze
1313

14-
Version = "1.7.10".freeze
14+
Version = "1.7.11".freeze
1515

1616
task :build do
1717
`rm -rf dist/#{Version}`

cmd/add_note.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
func init() {
1212
var (
13-
addNoteCmdDesc = "Adds notes to a todo."
13+
addNoteCmdDesc = "Add notes to a todo."
1414
addNoteCmdExample = " redovc an 1 this is a note for the first todo"
1515
)
1616

cmd/archive.go

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func init() {
3636
Aliases: []string{"ar"},
3737
Example: archiveCmdExample,
3838
Short: "Archives a todo.",
39+
Args: cobra.MinimumNArgs(1),
3940
Run: func(cmd *cobra.Command, args []string) {
4041
redovc.NewApp().ArchiveTodo(strings.Join(args, " "))
4142
},
@@ -46,6 +47,7 @@ func init() {
4647
Aliases: []string{"uar"},
4748
Example: archiveCmdExample,
4849
Short: "Un-archives a todo.",
50+
Args: cobra.MinimumNArgs(1),
4951
Run: func(cmd *cobra.Command, args []string) {
5052
redovc.NewApp().UnarchiveTodo(strings.Join(args, " "))
5153
},

cmd/list.go

+1
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ When listing todos, you can apply powerful filters, and perform grouping.`
149149
}
150150

151151
rootCmd.AddCommand(listCmd)
152+
// these are --FLAG flags
152153
listCmd.Flags().BoolVarP(&unicodeSupport, "unicode", "", true, "Allows unicode support in redovc output (default: true)")
153154
listCmd.Flags().BoolVarP(&colorSupport, "color", "", true, "Allows color in redovc output (default: true)")
154155
listCmd.Flags().BoolVarP(&listNotes, "notes", "", false, "Show a todo's notes when listing. (default: false)")

lib/app.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

1414
const (
1515
// Current version of redovc.
16-
VERSION string = "1.7.10"
16+
VERSION string = "1.7.11"
1717

1818
DATE_FORMAT string = "2006-01-02"
1919
)
@@ -503,16 +503,12 @@ func (a *App) BulkEdit() {
503503
}
504504

505505
// in case it is a symlink...
506-
targetFile, _ = os.Readlink(targetFile)
506+
// targetFile, _ = os.Readlink(targetFile)
507507

508508
fmt.Println(targetFile)
509509

510510
err := open.Run(targetFile)
511511
if err != nil {
512512
fmt.Printf("Error: %v\n", err)
513513
}
514-
515-
//cmd := exec.Command(targetFile)
516-
// err := cmd.Start()
517-
// fmt.Printf("err: %v\n", err)
518514
}

lib/input_parser.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func (p *InputParser) Parse(input string) (*Filter, error) {
199199
r := &Recurrence{}
200200

201201
if !r.ValidRecurrence(filter.Recur) {
202-
return filter, fmt.Errorf("i could not understand the recurrence you gave me: '%s'", filter.Recur)
202+
return filter, fmt.Errorf("I could not understand the recurrence you gave me: '%s'", filter.Recur)
203203
}
204204

205205
if filter.Recur == "none" {

lib/input_parser_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func TestInvalidRecurrence(t *testing.T) {
125125
t.Fail()
126126
}
127127

128-
assert.Equal(err.Error(), "i could not understand the recurrence you gave me: 'blah'")
128+
assert.Equal(err.Error(), "I could not understand the recurrence you gave me: 'blah'")
129129
}
130130

131131
func TestNoneRecurrence(t *testing.T) {

lib/recurrence.go

+16
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const (
99
Daily = "daily"
1010
Weekdays = "weekdays"
1111
Weekly = "weekly"
12+
Biweekly = "biweekly"
1213
Monthly = "monthly"
1314
Yearly = "yearly"
1415
)
@@ -24,6 +25,7 @@ func (r *Recurrence) ValidRecurrence(input string) bool {
2425
Daily,
2526
Weekdays,
2627
Weekly,
28+
Biweekly,
2729
Monthly,
2830
Yearly:
2931
return true
@@ -76,6 +78,8 @@ func (r *Recurrence) nextRecurrence(dueDate time.Time, completedDate time.Time,
7678
return r.findNextWeekDay(dueDate, completedDate)
7779
case Weekly:
7880
return r.findNextWeek(dueDate, completedDate)
81+
case Biweekly:
82+
return r.findTwoWeeksOut(dueDate, completedDate)
7983
case Monthly:
8084
return r.findNextMonth(dueDate, completedDate)
8185
case Yearly:
@@ -121,6 +125,18 @@ func (r *Recurrence) findNextWeek(dueDate time.Time, completedDate time.Time) ti
121125
}
122126
}
123127

128+
func (r *Recurrence) findTwoWeeksOut(dueDate time.Time, completedDate time.Time) time.Time {
129+
weekday := dueDate.Weekday()
130+
dueDate = dueDate.AddDate(0, 0, 1)
131+
for {
132+
if dueDate.Weekday() != weekday || dueDate.Before(completedDate.AddDate(0, 0, 7)) {
133+
dueDate = dueDate.AddDate(0, 0, 1)
134+
} else {
135+
return dueDate
136+
}
137+
}
138+
}
139+
124140
func (r *Recurrence) findNextMonth(dueDate time.Time, completedDate time.Time) time.Time {
125141
dueDate = dueDate.AddDate(0, 1, 0)
126142
for {

redovc_docs/docs/index.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ To learn about available redo.vc commands, see the [usage page](https://redo.vc/
1010
* Ability to serve todo data as json, html or CSV via http
1111
* [Search capabilities](https://redo.vc/commands/list/) - Search for strings in all of your todos when using the list command
1212
* [Theming capabilities](https://redo.vc/theming) - Change all the colors and column order on the fly!
13+
* Recurrence daily, weekly and more!
1314
* Adding additional due strings (End of quarter, End of Month)
1415
* Tasks can be assigned to a project
1516
* Projects can be created dynamically while creating todos
@@ -37,7 +38,7 @@ Find the installation for your device in the releases section of the GitHub proj
3738
* [DONE] Theming capabilities
3839
* [DONE] Adding additional due strings (End of quarter, End of Month)
3940
* Syncing via cloud providers (Google Drive, iCloud, Dropbox, etc.)
40-
* [STARTED] Web UI
41+
* [continuing] Web UI
4142
* Importing from common formats
4243
* Config file defaults
4344
* Whatever you would like to see! [Let me know](https://github.com/sottey/redo.vc/discussions)

redovc_docs/site/index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ <h2 id="features">Features</h2>
247247
<li>Ability to serve todo data as json, html or CSV via http</li>
248248
<li><a href="https://redo.vc/commands/list/">Search capabilities</a> - Search for strings in all of your todos when using the list command</li>
249249
<li><a href="https://redo.vc/theming">Theming capabilities</a> - Change all the colors and column order on the fly!</li>
250+
<li>Recurrence daily, weekly and more!</li>
250251
<li>Adding additional due strings (End of quarter, End of Month)</li>
251252
<li>Tasks can be assigned to a project</li>
252253
<li>Projects can be created dynamically while creating todos</li>
@@ -274,7 +275,7 @@ <h2 id="future-plans">Future Plans</h2>
274275
<li>[DONE] Theming capabilities</li>
275276
<li>[DONE] Adding additional due strings (End of quarter, End of Month)</li>
276277
<li>Syncing via cloud providers (Google Drive, iCloud, Dropbox, etc.)</li>
277-
<li>[STARTED] Web UI</li>
278+
<li>[continuing] Web UI</li>
278279
<li>Importing from common formats</li>
279280
<li>Config file defaults</li>
280281
<li>Whatever you would like to see! <a href="https://github.com/sottey/redo.vc/discussions">Let me know</a></li>
-710 KB
Binary file not shown.

redovc_docs/site/search/search_index.json

+1-1
Large diffs are not rendered by default.

redovc_docs/site/sitemap.xml

+22-22
Original file line numberDiff line numberDiff line change
@@ -2,112 +2,112 @@
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
33
<url>
44
<loc>https://redo.vc/</loc>
5-
<lastmod>2023-11-13</lastmod>
5+
<lastmod>2023-11-29</lastmod>
66
<changefreq>daily</changefreq>
77
</url>
88
<url>
99
<loc>https://redo.vc/theming/</loc>
10-
<lastmod>2023-11-13</lastmod>
10+
<lastmod>2023-11-29</lastmod>
1111
<changefreq>daily</changefreq>
1212
</url>
1313
<url>
1414
<loc>https://redo.vc/usage/</loc>
15-
<lastmod>2023-11-13</lastmod>
15+
<lastmod>2023-11-29</lastmod>
1616
<changefreq>daily</changefreq>
1717
</url>
1818
<url>
1919
<loc>https://redo.vc/commands/add/</loc>
20-
<lastmod>2023-11-13</lastmod>
20+
<lastmod>2023-11-29</lastmod>
2121
<changefreq>daily</changefreq>
2222
</url>
2323
<url>
2424
<loc>https://redo.vc/commands/addnote/</loc>
25-
<lastmod>2023-11-13</lastmod>
25+
<lastmod>2023-11-29</lastmod>
2626
<changefreq>daily</changefreq>
2727
</url>
2828
<url>
2929
<loc>https://redo.vc/commands/archive/</loc>
30-
<lastmod>2023-11-13</lastmod>
30+
<lastmod>2023-11-29</lastmod>
3131
<changefreq>daily</changefreq>
3232
</url>
3333
<url>
3434
<loc>https://redo.vc/commands/complete/</loc>
35-
<lastmod>2023-11-13</lastmod>
35+
<lastmod>2023-11-29</lastmod>
3636
<changefreq>daily</changefreq>
3737
</url>
3838
<url>
3939
<loc>https://redo.vc/commands/completion/</loc>
40-
<lastmod>2023-11-13</lastmod>
40+
<lastmod>2023-11-29</lastmod>
4141
<changefreq>daily</changefreq>
4242
</url>
4343
<url>
4444
<loc>https://redo.vc/commands/delete/</loc>
45-
<lastmod>2023-11-13</lastmod>
45+
<lastmod>2023-11-29</lastmod>
4646
<changefreq>daily</changefreq>
4747
</url>
4848
<url>
4949
<loc>https://redo.vc/commands/deletenote/</loc>
50-
<lastmod>2023-11-13</lastmod>
50+
<lastmod>2023-11-29</lastmod>
5151
<changefreq>daily</changefreq>
5252
</url>
5353
<url>
5454
<loc>https://redo.vc/commands/edit/</loc>
55-
<lastmod>2023-11-13</lastmod>
55+
<lastmod>2023-11-29</lastmod>
5656
<changefreq>daily</changefreq>
5757
</url>
5858
<url>
5959
<loc>https://redo.vc/commands/editnote/</loc>
60-
<lastmod>2023-11-13</lastmod>
60+
<lastmod>2023-11-29</lastmod>
6161
<changefreq>daily</changefreq>
6262
</url>
6363
<url>
6464
<loc>https://redo.vc/commands/export/</loc>
65-
<lastmod>2023-11-13</lastmod>
65+
<lastmod>2023-11-29</lastmod>
6666
<changefreq>daily</changefreq>
6767
</url>
6868
<url>
6969
<loc>https://redo.vc/commands/help/</loc>
70-
<lastmod>2023-11-13</lastmod>
70+
<lastmod>2023-11-29</lastmod>
7171
<changefreq>daily</changefreq>
7272
</url>
7373
<url>
7474
<loc>https://redo.vc/commands/init/</loc>
75-
<lastmod>2023-11-13</lastmod>
75+
<lastmod>2023-11-29</lastmod>
7676
<changefreq>daily</changefreq>
7777
</url>
7878
<url>
7979
<loc>https://redo.vc/commands/list/</loc>
80-
<lastmod>2023-11-13</lastmod>
80+
<lastmod>2023-11-29</lastmod>
8181
<changefreq>daily</changefreq>
8282
</url>
8383
<url>
8484
<loc>https://redo.vc/commands/prioritize/</loc>
85-
<lastmod>2023-11-13</lastmod>
85+
<lastmod>2023-11-29</lastmod>
8686
<changefreq>daily</changefreq>
8787
</url>
8888
<url>
8989
<loc>https://redo.vc/commands/status/</loc>
90-
<lastmod>2023-11-13</lastmod>
90+
<lastmod>2023-11-29</lastmod>
9191
<changefreq>daily</changefreq>
9292
</url>
9393
<url>
9494
<loc>https://redo.vc/commands/unarchive/</loc>
95-
<lastmod>2023-11-13</lastmod>
95+
<lastmod>2023-11-29</lastmod>
9696
<changefreq>daily</changefreq>
9797
</url>
9898
<url>
9999
<loc>https://redo.vc/commands/uncomplete/</loc>
100-
<lastmod>2023-11-13</lastmod>
100+
<lastmod>2023-11-29</lastmod>
101101
<changefreq>daily</changefreq>
102102
</url>
103103
<url>
104104
<loc>https://redo.vc/commands/unprioritize/</loc>
105-
<lastmod>2023-11-13</lastmod>
105+
<lastmod>2023-11-29</lastmod>
106106
<changefreq>daily</changefreq>
107107
</url>
108108
<url>
109109
<loc>https://redo.vc/commands/version/</loc>
110-
<lastmod>2023-11-13</lastmod>
110+
<lastmod>2023-11-29</lastmod>
111111
<changefreq>daily</changefreq>
112112
</url>
113113
</urlset>

redovc_docs/site/sitemap.xml.gz

0 Bytes
Binary file not shown.

release.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pushd .
2+
cd ~/go/src/projects/redo.vc
3+
go build -o redovc
4+
rake build
5+
cd redovc_docs
6+
mkdocs build
7+
cd site
8+
zip -r redovc_docs.zip *
9+
mv ./redovc_docs.zip ~/Downloads
10+
popd

web/go.mod

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module projects/redo.vc/web
2+
3+
go 1.21.4
4+
5+
require github.com/gorilla/mux v1.8.1

web/go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
2+
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=

0 commit comments

Comments
 (0)