summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAliceReuter <>2018-10-25 05:47:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-10-25 05:47:00 (GMT)
commitfcd8dbc571e1cb6bb4905d8cbe85afe97d759ac6 (patch)
tree98eb96398f55eedd239c6011f2cf1dcdd2223d2d
parent40665e4bd9d4c91e784c5d61e42233d3c73da0eb (diff)
version 0.1.2.170.1.2.17
-rw-r--r--Main.hs2
-rw-r--r--README.md75
-rw-r--r--Villefort.cabal2
-rw-r--r--src/Villefort/Database.hs2
4 files changed, 45 insertions, 36 deletions
diff --git a/Main.hs b/Main.hs
index bfb5faf..62ccf8a 100644
--- a/Main.hs
+++ b/Main.hs
@@ -1,7 +1,7 @@
module Main where
import Villefort.Server (villefort)
-import Villefort.Config (defaultConfig)
+import Villefort.Config
main :: IO ()
main = villefort defaultConfig
diff --git a/README.md b/README.md
index b42216b..f6adce2 100644
--- a/README.md
+++ b/README.md
@@ -1,18 +1,48 @@
# Villefort
-Villefort is a time management system written in Haskell.
+Villefort is a task management system written in Haskell.
-## Version 1.2.15
-- New Task Data type with better scheduling options
-- Running tasks is now fault tolerant. If one task fails the tasks after it still run.
-- You can now store aribitrary vars in the task database
+## Version 1.2.17 changes
+- fixed subject truncation bug on new todo page.
-### New Task Data Type
+
+# Home screen
+![alt text](https://raw.githubusercontent.com/alicereuter/Villefort/master/data/screen.png)
+# Add new todos
+![alt text](https://raw.githubusercontent.com/alicereuter/Villefort/master/data/screen01.png)
+# Stats page
+
+![alt text](https://raw.githubusercontent.com/alicereuter/Villefort/master/data/screen02.png)
+
+# To install
+1. Install cabal (https://www.haskell.org/platform/)
+2. In terminal or command prompt run `cabal install Villefort`.
+3. and then `cabal run Villefort`.
+4. You will be able to see the home screen by typing localhost:3002 into your favorite browser.
+
+## Configure Villefort
+create a custom main method in ~.villefort/villefort.hs
+This default config can be found [here](https://github.com/alicereuter/Villefort/blob/master/src/Villefort/Config.hs).
+For example
+```haskell
+module Main where
+
+import Villefort.Server (villefort)
+import Villefort.Config
+
+main :: IO ()
+main = villefort defaultConfig {
+ database = "/home/user/todo.db" --usage custom database location
+ }
+```
+
+### Task Data Type
+#### Definition
```haskell
-data Date = Date {year :: String, -- | The specific date you want a task to be on
+data Date = Date {year :: String, -- | The specific date you want a task to be due on
month :: String,
day :: String }
| Offset {offset :: Int} -- | The number of days in the future you want the task to be due on
- | Today -- | Make the task due today
+ | Today -- | Make the task due today
deriving (Show,Eq)
-- | Villefort's internal representation of Tasks
@@ -22,8 +52,7 @@ data Task = Task {title :: String,
due :: Date} deriving (Show,Eq)
```
-Example
-
+### Example usage
```haskell
cs121n :: IO Task
cs121n = pure $ Task {
@@ -32,7 +61,7 @@ cs121n = pure $ Task {
subject = "cs121",
due = Today}
```
-### Storing Vars in the Database
+### Storing Vars in the Database extended example
```haskell
module Main where
@@ -51,7 +80,7 @@ conf = defaultConfig {
,weekly = schedule
}
--- | checks if vars exists and if they don't initialize them with their default vals
+-- | checks if vars exists and if they don't initialize them with their default value
check :: IO ()
check = do
isBack <- runReaderT (isVar "back" ) conf
@@ -155,30 +184,10 @@ gener level = do
```
-[default config](https://github.com/alicereuter/Villefort/blob/master/src/Villefort/Config.hs)
-
-# Home screen
-![alt text](https://raw.githubusercontent.com/alicereuter/Villefort/master/data/screen.png)
-# Add new todos
-![alt text](https://raw.githubusercontent.com/alicereuter/Villefort/master/data/screen01.png)
-# Stats page
-
-![alt text](https://raw.githubusercontent.com/alicereuter/Villefort/master/data/screen02.png)
-
-# To install
-1. Install cabal (https://www.haskell.org/platform/)
-2. In terminal or command prompt run `cabal install Villefort`.
-3. and then `cabal run Villefort`.
-4. You will be able to see the home screen by typing localhost:3002 into your favorite browser.
-
-## Configure your villefort
-create a custom main method in ~.villefort/villefort.hs. Below is an example.
-
-
Use ```Villefort --recompile``` to recompile Villefort with your custom config. Recompilation requires ghc to be in your $PATH.
The next time you run villefort it will run with your custom config. The default Config is found in Villefort.Config.
-## How to copy data between versions of Villefort.
+## How to migrate between versions of Villefort.
1. Install the new version through cabal.
2. Navigate to ~/.cabal .
3. Navigate to share/ .
diff --git a/Villefort.cabal b/Villefort.cabal
index 305c558..434a15b 100644
--- a/Villefort.cabal
+++ b/Villefort.cabal
@@ -1,5 +1,5 @@
name: Villefort
-version: 0.1.2.16
+version: 0.1.2.17
synopsis: Villefort is a task manager and time tracker
description: Villefort is a browser based time tracker built around a sqlite3 database.
homepage: https://github.com/alicereuter/Villefort#readme
diff --git a/src/Villefort/Database.hs b/src/Villefort/Database.hs
index 20880b2..da647a5 100644
--- a/src/Villefort/Database.hs
+++ b/src/Villefort/Database.hs
@@ -59,7 +59,7 @@ makeTable path = do
getSubjects :: (MonadReader VConfig m, MonadIO m) => m [String]
getSubjects = do
subjects <- makeQuery "select Subject from todo where state = 0 group by Subject"
- pure $ map (\x-> (!! 0) <$> x) subjects
+ pure $ map (\x -> x !! 0) subjects
-- | get paths tests for --custom flag to allow for executing custom builds
path' :: (MonadReader VConfig m, MonadIO m) => m FilePath