Skip to content
Snippets Groups Projects
Commit bec53db7 authored by VALLET Nathan's avatar VALLET Nathan
Browse files

add some styling

parent 96eb4942
No related branches found
No related tags found
No related merge requests found
......@@ -35,20 +35,21 @@ def fusion_flux(liste_url: list[str], liste_flux: list[dict[str, any] | None],
def genere_html(liste_evenements: list[dict[str, str]],
chemin_html: str) -> None:
output = "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>Events log</title><link rel=\"stylesheet\" href=\"css/feed.css\" type=\"text/css\"/></head><body><article><header><h1>Events log</h1></header>"
output += f"<p>{time.asctime()}</p>"
output = "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>Events log</title><link rel=\"stylesheet\" href=\"css/feed.css\" type=\"text/css\"/></head><body><article><header><h1 class=\"maintitle\">Events log</h1></header>"
output += f"<p class=\"currenttime\">{time.asctime()}</p>"
output += f"<div class=\"container\">"
for evenement in liste_evenements:
output += "<article><header>"
output += f"<article class=\"event {evenement['categorie'].lower()}\"><header>"
output += f"<h2>{evenement['titre']}</h2>"
output += f"<p class=\"server\">from: {evenement['serveur']}</p>"
output += "</header>"
output += f"<p>from: {evenement['serveur']}</p>"
output += f"<p>{evenement['date_publi']}</p>"
output += f"<p>{evenement['categorie']}</p>"
output += f"<p>{evenement['guid']}</p>"
output += f"<p><a href=\"{evenement['lien']}\">{evenement['lien']}</a></p>"
output += f"<p class=\"guid\">{evenement['guid']}</p>"
output += f"<p><a href=\"eventlink\"{evenement['lien']}\">{evenement['lien']}</a></p>"
output += f"<p>{evenement['description']}</p>"
output += "</article>"
output += "</article></body></html>"
output += "</div></article></body></html>"
with open(chemin_html, "w") as outputfile:
outputfile.write(output)
......
* {
font-family: sans-serif;
}
.maintitle {
margin-bottom: 0;
}
.currenttime {
margin-top: 0;
}
article.event {
padding: 10px;
margin-bottom: 10px;
border-style: solid;
border-width: medium;
}
article.critical {
border-color: red;
}
article.major {
border-color: orange;
}
article.minor {
border-color: green;
}
.guid {
color: grey;
font-style: italic;
}
.server {
font-weight: bold;
}
/* "what are you, bootstrap ?"
-- a friend */
.container {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
@media (min-width: 768px) {
.container {
width: 750px;
}
}
@media (min-width: 992px) {
.container {
width: 970px;
}
}
@media (min-width: 1200px) {
.container {
width: 1170px;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment