Docfile commited on
Commit
a3e2608
·
verified ·
1 Parent(s): eb5759e

Update templates/dissertation_pdf.html

Browse files
Files changed (1) hide show
  1. templates/dissertation_pdf.html +25 -17
templates/dissertation_pdf.html CHANGED
@@ -7,11 +7,6 @@
7
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
8
  <link href="https://fonts.googleapis.com/css2?family=Kalam&family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
9
  <style>
10
- /*
11
- * Styles pour la génération du PDF avec WeasyPrint.
12
- * Utilisation d'unités absolues (px) pour les marges verticales
13
- * afin d'assurer un rendu cohérent et compact.
14
- */
15
  body {
16
  font-family: 'Inter', sans-serif;
17
  margin: 0;
@@ -22,12 +17,11 @@
22
  font-size: 20px;
23
  color: #1a2a4c;
24
  background-color: #fdfaf4;
25
- /* L'interligne peut rester relatif, c'est généralement bien géré */
26
  line-height: 1.8;
27
  background-image: linear-gradient(transparent 97%, #d8e2ee 98%);
28
  background-size: 100% 40px;
29
  border-left: 3px solid #ffaaab;
30
- padding-left: 4em; /* Le padding horizontal en 'em' est OK */
31
  padding-top: 30px;
32
  padding-bottom: 40px;
33
  padding-right: 30px;
@@ -39,12 +33,12 @@
39
  font-size: 1.5em;
40
  text-align: center;
41
  margin-top: 0;
42
- margin-bottom: 30px; /* MODIFIÉ: Unité absolue */
43
  color: #1a2a4c;
44
  }
45
  .dissertation-paper h3 {
46
  font-size: 1.2em;
47
- /* MODIFIÉ: Remplacé 3em par 40px pour un espacement contrôlé */
48
  margin-top: 40px;
49
  margin-bottom: 30px;
50
  text-transform: uppercase;
@@ -52,8 +46,8 @@
52
  color: #1a2a4c;
53
  }
54
  .dissertation-paper .development-block {
55
- /* MODIFIÉ: Remplacé 3em par 40px. C'est le changement crucial */
56
- /* pour l'espace entre l'introduction et la première partie. */
57
  margin-top: 40px;
58
  }
59
  .dissertation-paper p {
@@ -64,15 +58,15 @@
64
  .dissertation-paper .prof {
65
  text-align: center;
66
  font-style: italic;
67
- margin-bottom: 40px; /* MODIFIÉ: Unité absolue */
68
  }
69
  .dissertation-paper .indented {
70
  text-indent: 3em;
71
  }
72
  .dissertation-paper .transition {
73
- /* MODIFIÉ: Remplacé 2em par 35px pour la transition */
74
- margin-top: 35px;
75
- margin-bottom: 35px;
76
  font-style: italic;
77
  color: #4a6a9c;
78
  }
@@ -80,25 +74,39 @@
80
  page-break-inside: avoid;
81
  break-inside: avoid;
82
  }
 
 
 
 
83
  </style>
84
  </head>
85
  <body>
86
  <div class="dissertation-paper">
87
- <!-- Utilisation de la syntaxe Jinja2 pour insérer les données dynamiques -->
88
  <h2>Sujet : {{ dissertation.sujet }}</h2>
89
  <p class="prof">Prof : {{ dissertation.prof }}</p>
90
 
91
  <h3>Introduction</h3>
 
92
  <p class="indented">{{ dissertation.introduction }}</p>
93
 
 
 
 
94
  {% for partie in dissertation.parties %}
95
  <div class="avoid-page-break">
96
- <div class="development-block">
 
 
 
 
 
97
  <p class="indented">{{ partie.chapeau }}</p>
98
  {% for arg in partie.arguments %}
99
  <p class="indented">{{ arg.paragraphe_argumentatif }}</p>
100
  {% endfor %}
101
  </div>
 
 
102
  {% if partie.transition %}
103
  <p class="indented transition">{{ partie.transition }}</p>
104
  {% endif %}
 
7
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
8
  <link href="https://fonts.googleapis.com/css2?family=Kalam&family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
9
  <style>
 
 
 
 
 
10
  body {
11
  font-family: 'Inter', sans-serif;
12
  margin: 0;
 
17
  font-size: 20px;
18
  color: #1a2a4c;
19
  background-color: #fdfaf4;
 
20
  line-height: 1.8;
21
  background-image: linear-gradient(transparent 97%, #d8e2ee 98%);
22
  background-size: 100% 40px;
23
  border-left: 3px solid #ffaaab;
24
+ padding-left: 4em;
25
  padding-top: 30px;
26
  padding-bottom: 40px;
27
  padding-right: 30px;
 
33
  font-size: 1.5em;
34
  text-align: center;
35
  margin-top: 0;
36
+ margin-bottom: 30px;
37
  color: #1a2a4c;
38
  }
39
  .dissertation-paper h3 {
40
  font-size: 1.2em;
41
+ /* RÈGLE: 2 sauts de ligne avant la Conclusion */
42
  margin-top: 40px;
43
  margin-bottom: 30px;
44
  text-transform: uppercase;
 
46
  color: #1a2a4c;
47
  }
48
  .dissertation-paper .development-block {
49
+ /* RÈGLE: Espace par défaut avant un bloc de développement. */
50
+ /* Sera annulé pour la première partie. */
51
  margin-top: 40px;
52
  }
53
  .dissertation-paper p {
 
58
  .dissertation-paper .prof {
59
  text-align: center;
60
  font-style: italic;
61
+ margin-bottom: 40px;
62
  }
63
  .dissertation-paper .indented {
64
  text-indent: 3em;
65
  }
66
  .dissertation-paper .transition {
67
+ /* RÈGLE: Un saut avant et un saut après la transition */
68
+ margin-top: 25px;
69
+ margin-bottom: 25px;
70
  font-style: italic;
71
  color: #4a6a9c;
72
  }
 
74
  page-break-inside: avoid;
75
  break-inside: avoid;
76
  }
77
+ /* Classe utilitaire pour annuler la marge supérieure */
78
+ .no-top-margin {
79
+ margin-top: 0 !important;
80
+ }
81
  </style>
82
  </head>
83
  <body>
84
  <div class="dissertation-paper">
 
85
  <h2>Sujet : {{ dissertation.sujet }}</h2>
86
  <p class="prof">Prof : {{ dissertation.prof }}</p>
87
 
88
  <h3>Introduction</h3>
89
+ <!-- RÈGLE: 2 sauts de ligne après l'intro (géré par le margin-top du premier h3) -->
90
  <p class="indented">{{ dissertation.introduction }}</p>
91
 
92
+ <!-- Titre du développement, avec un espace de 2 lignes avant -->
93
+ <h3>Développement</h3>
94
+
95
  {% for partie in dissertation.parties %}
96
  <div class="avoid-page-break">
97
+ <!--
98
+ LOGIQUE JINJA2:
99
+ - Si c'est la PREMIÈRE partie, on ajoute la classe 'no-top-margin' pour coller au titre "Développement".
100
+ - Pour les autres parties, on laisse le margin-top par défaut s'appliquer.
101
+ -->
102
+ <div class="development-block {% if loop.first %}no-top-margin{% endif %}">
103
  <p class="indented">{{ partie.chapeau }}</p>
104
  {% for arg in partie.arguments %}
105
  <p class="indented">{{ arg.paragraphe_argumentatif }}</p>
106
  {% endfor %}
107
  </div>
108
+
109
+ <!-- La transition est affichée après le bloc de développement -->
110
  {% if partie.transition %}
111
  <p class="indented transition">{{ partie.transition }}</p>
112
  {% endif %}