-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.jl
37 lines (33 loc) · 1.13 KB
/
utils.jl
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
using DelimitedFiles, Dates
function hfun_btable(params)
path = params[1]
csvcontent,headers = readdlm(path, ',', String, header=true)
nrows, ncols = size(csvcontent)
show(csvcontent)
# sort the table so earlier deadlines are first
sorting = sortperm(Date.(csvcontent[:,3],"m/d/yyyy"))
csvcontent = csvcontent[sorting,:]
io = IOBuffer()
# write headers
println(io,"<table class=\"table table-striped table-responsive table-sm\">")
println(io,"<caption>","$nrows conferences","</caption>")
println(io,"<thead class=\"thead-dark\">")
println(io,"<tr>")
for i in 1:ncols-1
println(io,"<th scope=\"col\" class=\"align-middle\">",headers[i],"</th>")
end
println(io,"</tr>")
println(io,"</thead>")
# writing content
println(io,"<tbody>")
for i in 1:nrows
println(io, "<tr>")
println(io,"<td>","<a href=\"",csvcontent[i,ncols],"\">",csvcontent[i,1],"</a>","</td>")
for j in 2:ncols-1
println(io,"<td>",csvcontent[i,j],"</td>")
end
println(io,"</tr>")
end
println(io,"</table>")
return String(take!(io))
end