Villefort 0.1.2.16 → 0.1.2.17
raw patch · 4 files changed
+45/−36 lines, 4 files
Files
- Main.hs +1/−1
- README.md +42/−33
- Villefort.cabal +1/−1
- src/Villefort/Database.hs +1/−1
Main.hs view
@@ -1,7 +1,7 @@ module Main where import Villefort.Server (villefort)-import Villefort.Config (defaultConfig)+import Villefort.Config main :: IO () main = villefort defaultConfig
README.md view
@@ -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 + +# Add new todos + +# Stats page + + + +# 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 -data Date = Date {year :: String, -- | The specific date you want a task to be on +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 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 @@ due :: Date} deriving (Show,Eq) ``` -Example - +### Example usage ```haskell cs121n :: IO Task cs121n = pure $ Task { @@ -32,7 +61,7 @@ subject = "cs121", due = Today} ``` -### Storing Vars in the Database +### Storing Vars in the Database extended example ```haskell module Main where @@ -51,7 +80,7 @@ ,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 @@ ``` -[default config](https://github.com/alicereuter/Villefort/blob/master/src/Villefort/Config.hs) - -# Home screen - -# Add new todos - -# Stats page - - - -# 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/ .
Villefort.cabal view
@@ -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
src/Villefort/Database.hs view
@@ -59,7 +59,7 @@ 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