-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaffich.languinv
More file actions
57 lines (54 loc) · 1.35 KB
/
affich.languinv
File metadata and controls
57 lines (54 loc) · 1.35 KB
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
import json
data = json.loads(open('reco.json').read())
?????html[index.html]
%
def printbook(e):
print("<h4>"+e["title"]+"</h4>")
print("<i>By "+e["author"]+"</i><br>")
print("First published in "+e["year"]+"<br>")
if ("trad" in e):
for key,value in e["trad"].items():
sortie = "(Also in "+key+" : "+value["title"]
if "year" in value:
sortie += " ("+value["year"]+") "
sortie += ")<br>"
print(sortie)
%
<!DOCTYPE HTML>
<head>
<meta charset='utf-8'>
<title>Recommendations</title>
</head>
<body>
<h1>Books</h1>
%
for key,value in data["books"].items():
print("<h3>"+key+"</h3>")
for e in value:
printbook(e)
%
</body>
?????latex[recommendations.tex]
%
def printbook(e):
print("\subsubsection{"+e["title"]+"}")
print("\textit{By "+e["author"]+"}\\\\")
print("First published in "+e["year"]+"\\\\")
if ("trad" in e):
for key,value in e["trad"].items():
sortie = "(Also in "+key+" : "+value["title"]
if "year" in value:
sortie += " ("+value["year"]+") "
sortie += ")\\\\"
print(sortie)
%
\documentclass{article}
\begin{document}
\section{Books}
%
for key,value in data["books"].items():
print("\subsection{"+key+"}")
for e in value:
printbook(e)
%
\end{document}