diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..4c1c38e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,13 @@ +language: go +go: + - 1.1 + - 1.2 + - tip +env: + - GOARCH=amd64 +notifications: + email: + recipients: + - jamesclonk@jamesclonk.ch + on_success: change + on_failure: always diff --git a/README.md b/README.md index ceccb07..06ee0d3 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ go-todotxt A Go todo.txt library. -[![GoDoc](https://godoc.org/github.com/JamesClonk/go-todotxt?status.png)](https://godoc.org/github.com/JamesClonk/go-todotxt) +[![GoDoc](https://godoc.org/github.com/JamesClonk/go-todotxt?status.png)](https://godoc.org/github.com/JamesClonk/go-todotxt) [![Build Status](https://travis-ci.org/JamesClonk/go-todotxt.png?branch=master)](https://travis-ci.org/JamesClonk/go-todotxt) The *todotxt* package is a Go client library for Gina Trapani's [todo.txt](https://github.com/ginatrapani/todo.txt-cli/) files. It allows for parsing and manipulating of task lists and tasks in the todo.txt format. @@ -18,7 +18,29 @@ go-todotxt requires Go1.1 or higher. ## Usage -... +```go + package main + + import ( + "fmt" + "github.com/JamesClonk/go-todotxt" + "log" + ) + + func main() { + todotxt.IgnoreComments = false + + tasklist, err := todotxt.LoadFromFilename("todo.txt") + if err != nil { + log.Fatal(err) + } + + fmt.Printf("Task 2, todo: %v\n", tasklist[1].Todo) + fmt.Printf("Task 3: %v\n", tasklist[2]) + fmt.Printf("Task 4, has priority: %v\n\n", tasklist[3].HasPriority()) + fmt.Print(tasklist) + } +``` ## Documentation