mirror of
https://git.nerfingen.de/nerf/choirMail.git
synced 2024-11-21 15:09:33 +00:00
changed table layout and seperator
This commit is contained in:
parent
93a09e8402
commit
4f2a6bffda
3 changed files with 36 additions and 23 deletions
10
app/Main.hs
10
app/Main.hs
|
@ -66,13 +66,11 @@ mailText :: MailRecord -> LT.Text
|
|||
mailText record = LT.concat ["Guten Morgen,\n\n"
|
||||
, announcement record
|
||||
,"\n\ndiesen Donnerstag\n\nDurchsingen: "
|
||||
,song1 record
|
||||
,", "
|
||||
,song2 record
|
||||
,songs record
|
||||
,"\nStimmproben: "
|
||||
,voice1 record
|
||||
,", "
|
||||
,voice2 record
|
||||
,voices record
|
||||
,"\nNoten mitbringen: "
|
||||
, notes record
|
||||
,"\n\nLG\nJo^^\n" ]
|
||||
|
||||
mailSubject :: MailRecord -> T.Text
|
||||
|
|
|
@ -14,15 +14,14 @@ import Control.Monad(void)
|
|||
|
||||
data MailRecord = MailRecord {
|
||||
date :: D.Day,
|
||||
voice1 :: LT.Text,
|
||||
voice2 :: LT.Text,
|
||||
song1 :: LT.Text,
|
||||
song2 :: LT.Text,
|
||||
voices :: LT.Text,
|
||||
songs :: LT.Text,
|
||||
notes :: LT.Text,
|
||||
announcement :: LT.Text
|
||||
} deriving (Show)
|
||||
|
||||
seperator :: Char
|
||||
seperator = '\t'
|
||||
seperator = ';'
|
||||
|
||||
sepParser :: P.Parser ()
|
||||
sepParser = void $ P.char seperator
|
||||
|
@ -52,19 +51,17 @@ parseRow :: P.Parser MailRecord
|
|||
parseRow = do
|
||||
date <- dateCellParser
|
||||
sepParser
|
||||
voice1 <- textCellParser
|
||||
voices <- textCellParser
|
||||
sepParser
|
||||
voice2 <- textCellParser
|
||||
songs <- textCellParser
|
||||
sepParser
|
||||
song1 <- textCellParser
|
||||
sepParser
|
||||
song2 <- textCellParser
|
||||
notes <- textCellParser
|
||||
sepParser
|
||||
announcement <- textCellParser
|
||||
return $ MailRecord{..}
|
||||
|
||||
parseFirstRow :: P.Parser ()
|
||||
parseFirstRow = void (P.string "Datum\tStimmprobe 1\tStimmprobe 2\tLied 1\tLied 2\tWeitere Ansagen" >> P.endOfLine)
|
||||
parseFirstRow = void (P.string "Datum;Stimmproben;Lieder;Noten;Weitere Ansagen" >> P.endOfLine)
|
||||
|
||||
parseTable :: P.Parser [MailRecord]
|
||||
parseTable = do
|
||||
|
|
30
flake.lock
30
flake.lock
|
@ -1,12 +1,15 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1676283394,
|
||||
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
|
||||
"lastModified": 1692799911,
|
||||
"narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
|
||||
"rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -17,11 +20,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1678086707,
|
||||
"narHash": "sha256-y1uXdxzinIne4FW3TF7DCtxEB9gAbQ4qnbpYzhvkFm8=",
|
||||
"lastModified": 1693355128,
|
||||
"narHash": "sha256-+ZoAny3ZxLcfMaUoLVgL9Ywb/57wP+EtsdNGuXUJrwg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "21eda9bc80bef824a037582b1e5a43ba74e92daa",
|
||||
"rev": "a63a64b593dcf2fe05f7c5d666eb395950f36bc9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -36,6 +39,21 @@
|
|||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
|
Loading…
Reference in a new issue