Commit ceffe8d3 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[frame write] date paser work, update lts to 18.12

This doesn't compile yet.
parent ac77596e
......@@ -134,7 +134,7 @@ For Docker env, first create the appropriate image:
``` sh
cd devops/docker
docker build -t cgenie/stack-build:lts-17.13-garg .
docker build -t cgenie/stack-build:lts-18.12-garg .
```
then run:
......
FROM fpco/stack-build:lts-17.13
FROM fpco/stack-build:lts-18.12
RUN apt-key adv --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys 8B1DA6120C2BF624
#RUN apt-key adv --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys 8B1DA6120C2BF624
RUN apt-get update && \
apt-get install -y git libigraph0-dev && \
rm -rf /var/lib/apt/lists/*
......
......@@ -54,7 +54,7 @@ git clone https://gitlab.iscpif.fr/gargantext/purescript-gargantext
../install-deps $(pwd)
pushd devops/docker
docker build --pull -t fpco/stack-build:lts-17.13-garg .
docker build --pull -t fpco/stack-build:lts-18.12-garg .
popd
#stack docker pull
......
......@@ -176,6 +176,7 @@ library:
- pandoc
- parallel
- parsec
- parsec3-numbers
- patches-class
- patches-map
- path
......
......@@ -122,9 +122,9 @@ hyperdataDocumentFromFrameWrite (HyperdataFrame { _hf_base, _hf_frame_id }, cont
, _hd_source = source
, _hd_abstract = Just c
, _hd_publication_date = date
, _hd_publication_year = Nothing -- TODO
, _hd_publication_month = Nothing -- TODO
, _hd_publication_day = Nothing -- TODO
, _hd_publication_year = Just 2021 -- TODO
, _hd_publication_month = Just 10 -- TODO
, _hd_publication_day = Just 4 -- TODO
, _hd_publication_hour = Nothing
, _hd_publication_minute = Nothing
, _hd_publication_second = Nothing
......
......@@ -8,6 +8,7 @@ import Data.Text hiding (foldl)
import Gargantext.Prelude
import Prelude ((++))
import Text.Parsec hiding (Line)
import Text.Parsec.Number (number)
import Text.Parsec.String
......@@ -59,7 +60,7 @@ data Author =
Author { firstName :: Text
, lastName :: Text }
deriving (Show)
data Parsed =
Parsed { title :: Text
, authors :: [Author]
......@@ -76,10 +77,16 @@ emptyParsed =
, source = Nothing
, contents = "" }
data Date =
Date { year :: Int
, month :: Int
, day :: Int }
deriving (Show)
data Line =
LAuthors [Author]
| LContents Text
| LDate Text
| LDate Date
| LSource Text
| LTitle Text
deriving (Show)
......@@ -115,7 +122,7 @@ authorsLineP = do
dateLineP :: Parser Line
dateLineP = do
date <- dateP
pure $ LDate $ pack date
pure $ LDate date
sourceLineP :: Parser Line
sourceLineP = do
......@@ -173,6 +180,15 @@ dateP :: Parser [Char]
dateP = try datePrefixP
*> many (noneOf "\n")
dateISOP :: Parser Date
dateISOP = do
year <- number
_ <- char '-'
month <- number
_ <- char '-'
day <- number
pure $ Date { year, month, day }
sourcePrefixP :: Parser [Char]
sourcePrefixP = do
_ <- string "^@@source:"
......
resolver:
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/4.yaml
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/12.yaml
flags: {}
extra-package-dbs: []
packages:
......@@ -11,7 +11,7 @@ packages:
docker:
enable: false
repo: 'cgenie/stack-build:lts-17.13-garg'
repo: 'cgenie/stack-build:lts-18.12-garg'
run-args:
- '--publish=8008:8008'
......@@ -99,6 +99,7 @@ extra-deps:
- logging-effect-1.3.12@sha256:72d168dd09887649ba9501627219b6027cbec2d5541931555b7885b133785ce3,1679
- MissingH-1.4.3.0@sha256:32f9892ec98cd21df4f4d3ed8d95a3831ae74287ea0641d6f09b2dc6ef061d39,4859
- monoid-extras-0.5.1@sha256:438dbfd7b4dce47d8f0ca577f56caf94bd1e21391afa545cad09fe7cf2e5793d,2333
- parsec-numbers-0.1@sha256:60fa05b1c16050dffd0e28cecb682a021eeec1be6f34dc9d901a38c90182f289,727
- rake-0.0.1@sha256:3380f6567fb17505d1095b7f32222c0b631fa04126ad39726c84262da99c08b3,2025
- servant-cassava-0.10.1@sha256:07e7b6ca67cf57dcb4a0041a399a25d058844505837c6479e01d62be59d01fdf,1665
- servant-flatten-0.2@sha256:276896f7c5cdec5b8f8493f6205fded0cc602d050b58fdb09a6d7c85c3bb0837,1234
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment