-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
124 lines (103 loc) · 2.64 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
OCPTimeline, l'éditeur pour créer des timelines populaires
# Install
1. Install the dependencies:
sudo apt-get install\
postgresql\
libsodium-dev\
libgeoip1\
libgeoip-dev\
libcurl4-gnutls-dev\
curl\
zlib1g-dev\
pkg-config\
libgmp-dev\
opam
2. Edit the opam config file
Before installing and compiling the next dependencies, you need to disable
the sandbox mode of opam. Check the file `~/.opam/config`, and comment
the lines below if there are still there:
```
wrap-build-commands:
["%{hooks}%/sandbox.sh" "build"] {os = "linux" | os = "macos"}
wrap-install-commands:
["%{hooks}%/sandbox.sh" "install"] {os = "linux" | os = "macos"}
wrap-remove-commands:
["%{hooks}%/sandbox.sh" "remove"] {os = "linux" | os = "macos"}
```
3. Initialize.
From here, "make init" should do the trick. If you want to customize
your installation, here are the steps.
You need a switch 4.07.1 (for ocp-build). You are strongly advised to
create a new switch for the installation.
$ opam switch create timeline 4.07.1
Before installing and compiling all dependencies, you need to disable
the sandbox mode of opam. Check the file `~/.opam/config`, and comment
the lines below if there are still there:
```
wrap-build-commands:
["%{hooks}%/sandbox.sh" "build"] {os = "linux" | os = "macos"}
wrap-install-commands:
["%{hooks}%/sandbox.sh" "install"] {os = "linux" | os = "macos"}
wrap-remove-commands:
["%{hooks}%/sandbox.sh" "remove"] {os = "linux" | os = "macos"}
```
Then, install dependnecies:
$ opam install -y \
ocp-build base64 lwt.4.5 \
ocplib-json-typed \
js_of_ocaml \
js_of_ocaml-tyxml \
js_of_ocaml-ppx \
js_of_ocaml-lwt \
js_of_ocaml-ocamlbuild \
js_of_ocaml-toplevel \
faraday-async \
ezjsonm \
geoip \
cohttp \
cohttp-lwt-unix \
lwt_log \
extunix \
httpaf \
httpaf-lwt-unix \
ocurl \
yojson \
calendar \
camlp4 \
pgocaml.3.2 \
sexplib \
omd \
sha
4. Compile.
make
# Usage
## Transform data into JSON
Execute ./csv-parser 'data_file'.
The format is the following:
Title
Event#1
Event#2
...
with
Event#i =
* Start year (integer)
* Start month (integer)
* End year (integer)
* End month (integer)
* Type (software, person, client)
* Type 2 (custom string)
* Level (integer)
* Media
* Title
* Narration (optional)
This generates a data.json file compatible with the timeline js library
## Put data into database
Execute ./csv-parser 'data_file' --db.
This will put the data into the database.
If you wish to empty the database:
dropdb ocptl_db
make
# Locally start a website
cd www
php -S 127.0.0.1:8000 &
xdg-open http://127.0.0.1:8000