Flasksite / templates /dissertation_pdf.html
Docfile's picture
Update templates/dissertation_pdf.html
13b23c8 verified
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Dissertation de Philosophie</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Kalam&family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<style>
/*
* Styles pour la génération du PDF avec WeasyPrint.
* Utilisation d'unités absolues (px) pour les marges verticales
* afin d'assurer un rendu cohérent et compact.
*/
body {
font-family: 'Inter', sans-serif;
margin: 0;
padding: 0;
}
.dissertation-paper {
font-family: 'Kalam', cursive;
font-size: 20px;
color: #1a2a4c;
background-color: #fdfaf4;
/* L'interligne peut rester relatif, c'est généralement bien géré */
line-height: 1.8;
background-image: linear-gradient(transparent 97%, #d8e2ee 98%);
background-size: 100% 40px;
border-left: 3px solid #ffaaab;
padding-left: 4em; /* Le padding horizontal en 'em' est OK */
padding-top: 30px;
padding-bottom: 40px;
padding-right: 30px;
box-sizing: border-box;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
.dissertation-paper h2 {
font-size: 1.5em;
text-align: center;
margin-top: 0;
margin-bottom: 30px; /* Unité absolue */
color: #1a2a4c;
}
.dissertation-paper h3 {
font-size: 1.2em;
margin-top: 40px;
margin-bottom: 30px;
text-transform: uppercase;
text-decoration: underline;
color: #1a2a4c;
}
.dissertation-paper .development-block {
/* Espace avant chaque nouvelle partie */
margin-top: 40px;
}
.dissertation-paper p {
text-align: justify;
margin: 0;
padding: 0;
}
.dissertation-paper .prof {
text-align: center;
font-style: italic;
margin-bottom: 40px; /* Unité absolue */
}
.dissertation-paper .indented {
text-indent: 3em;
}
.dissertation-paper .transition {
/* Espace vertical pour la transition */
margin-top: 35px;
margin-bottom: 35px;
font-style: italic;
color: #4a6a9c;
}
.avoid-page-break {
/* La règle qui empêche de couper un bloc sur deux pages */
page-break-inside: avoid;
break-inside: avoid;
}
</style>
</head>
<body>
<div class="dissertation-paper">
<!-- Utilisation de la syntaxe Jinja2 pour insérer les données dynamiques -->
<h2>Sujet : {{ dissertation.sujet }}</h2>
<p class="prof">Prof : {{ dissertation.prof }}</p>
<h3>Introduction</h3>
<p class="indented">{{ dissertation.introduction }}</p>
{% for partie in dissertation.parties %}
<div>
<!-- La classe 'avoid-page-break' est maintenant ici, sur le bloc de contenu principal -->
<div class="development-block avoid-page-break">
<p class="indented">{{ partie.chapeau }}</p>
{% for arg in partie.arguments %}
<p class="indented">{{ arg.paragraphe_argumentatif }}</p>
{% endfor %}
</div>
{% if partie.transition %}
<p class="indented transition">{{ partie.transition }}</p>
{% endif %}
</div>
{% endfor %}
<h3>Conclusion</h3>
<p class="indented">{{ dissertation.conclusion }}</p>
</div>
</body>
</html>