Docfile commited on
Commit
624df09
·
verified ·
1 Parent(s): dcf0012

Update templates/dissertation_pdf.html

Browse files
Files changed (1) hide show
  1. templates/dissertation_pdf.html +58 -38
templates/dissertation_pdf.html CHANGED
@@ -7,73 +7,92 @@
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 de la dissertation.
12
- * Les marges et interlignes ont été ajustés pour un rendu plus compact.
13
  */
 
 
 
 
 
 
 
14
  body {
15
  font-family: 'Inter', sans-serif;
16
- margin: 0;
17
- padding: 0;
18
  }
 
19
  .dissertation-paper {
20
  font-family: 'Kalam', cursive;
21
- font-size: 20px;
22
  color: #1a2a4c;
23
  background-color: #fdfaf4;
24
- /* MODIFIÉ: Interligne réduit pour un texte moins aéré */
25
- line-height: 1.8;
 
26
  background-image: linear-gradient(transparent 97%, #d8e2ee 98%);
27
- background-size: 100% 40px;
28
- border-left: 3px solid #ffaaab;
29
- padding-left: 4em;
30
- padding-top: 30px;
31
- padding-bottom: 40px;
32
- padding-right: 30px;
33
- box-sizing: border-box;
34
  -webkit-print-color-adjust: exact;
35
  print-color-adjust: exact;
36
  }
 
37
  .dissertation-paper h2 {
38
  font-size: 1.5em;
39
  text-align: center;
40
- margin-top: 0;
41
- margin-bottom: 1.5em;
42
  color: #1a2a4c;
 
 
 
 
 
 
 
 
43
  }
 
44
  .dissertation-paper h3 {
45
  font-size: 1.2em;
46
- /* MODIFIÉ: Marge supérieure des titres de section réduite */
47
- margin-top: 2em;
48
- margin-bottom: 1.5em;
49
  text-transform: uppercase;
50
  text-decoration: underline;
51
  color: #1a2a4c;
 
 
 
 
52
  }
53
- .dissertation-paper .development-block {
54
- /* MODIFIÉ: Marge supérieure des blocs de développement réduite */
55
- margin-top: 2em;
 
56
  }
 
57
  .dissertation-paper p {
58
  text-align: justify;
59
- margin: 0;
60
  padding: 0;
61
  }
62
- .dissertation-paper .prof {
63
- text-align: center;
64
- font-style: italic;
65
- margin-bottom: 2em;
66
  }
 
67
  .dissertation-paper .indented {
68
- text-indent: 3em;
69
  }
 
70
  .dissertation-paper .transition {
71
- /* MODIFIÉ: Espacement de la transition ajusté */
72
- margin-top: 1.5em;
73
- margin-bottom: 1.5em;
74
  font-style: italic;
75
  color: #4a6a9c;
 
 
76
  }
 
 
77
  .avoid-page-break {
78
  page-break-inside: avoid;
79
  break-inside: avoid;
@@ -91,12 +110,13 @@
91
 
92
  {% for partie in dissertation.parties %}
93
  <div class="avoid-page-break">
94
- <div class="development-block">
95
- <p class="indented">{{ partie.chapeau }}</p>
96
- {% for arg in partie.arguments %}
97
- <p class="indented">{{ arg.paragraphe_argumentatif }}</p>
98
- {% endfor %}
99
- </div>
 
100
  {% if partie.transition %}
101
  <p class="indented transition">{{ partie.transition }}</p>
102
  {% 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
+ /*
11
+ * CSS OPTIMISÉ POUR WEASYPRINT (GÉNÉRATION PDF SERVEUR)
12
+ * Utilisation d'unités absolues (mm) pour un contrôle précis de la mise en page.
13
  */
14
+
15
+ @page {
16
+ /* Définit les marges de la page A4 */
17
+ size: A4;
18
+ margin: 20mm;
19
+ }
20
+
21
  body {
22
  font-family: 'Inter', sans-serif;
23
+ line-height: 1.5; /* Interligne de base pour le corps du texte */
 
24
  }
25
+
26
  .dissertation-paper {
27
  font-family: 'Kalam', cursive;
28
+ font-size: 14pt; /* Taille de police plus adaptée au format A4 */
29
  color: #1a2a4c;
30
  background-color: #fdfaf4;
31
+ line-height: 1.8; /* Interligne spécifique pour le style manuscrit */
32
+
33
+ /* L'arrière-plan avec les lignes */
34
  background-image: linear-gradient(transparent 97%, #d8e2ee 98%);
35
+ background-size: 100% 1.8em; /* Ajuster la taille des lignes à l'interligne */
36
+ border-left: 2mm solid #ffaaab;
37
+
38
+ padding-left: 10mm; /* Espace intérieur après la bordure */
 
 
 
39
  -webkit-print-color-adjust: exact;
40
  print-color-adjust: exact;
41
  }
42
+
43
  .dissertation-paper h2 {
44
  font-size: 1.5em;
45
  text-align: center;
 
 
46
  color: #1a2a4c;
47
+ margin-top: 0;
48
+ margin-bottom: 8mm; /* Espace après le titre du sujet */
49
+ }
50
+
51
+ .dissertation-paper .prof {
52
+ text-align: center;
53
+ font-style: italic;
54
+ margin-bottom: 15mm; /* Espace après le nom du prof */
55
  }
56
+
57
  .dissertation-paper h3 {
58
  font-size: 1.2em;
 
 
 
59
  text-transform: uppercase;
60
  text-decoration: underline;
61
  color: #1a2a4c;
62
+ /* Espace AVANT chaque titre de section (Introduction, Conclusion, etc.) */
63
+ margin-top: 12mm;
64
+ /* Espace APRÈS chaque titre de section */
65
+ margin-bottom: 8mm;
66
  }
67
+
68
+ /* Cible spécifiquement le premier h3 (Introduction) pour n'avoir aucune marge en haut */
69
+ .dissertation-paper h3:first-of-type {
70
+ margin-top: 0;
71
  }
72
+
73
  .dissertation-paper p {
74
  text-align: justify;
75
+ margin: 0 0 5mm 0; /* Ajoute un petit espace après chaque paragraphe */
76
  padding: 0;
77
  }
78
+
79
+ /* Enlève la marge du tout dernier paragraphe du document */
80
+ .dissertation-paper p:last-child {
81
+ margin-bottom: 0;
82
  }
83
+
84
  .dissertation-paper .indented {
85
+ text-indent: 10mm; /* Alinéa pour les paragraphes indentés */
86
  }
87
+
88
  .dissertation-paper .transition {
 
 
 
89
  font-style: italic;
90
  color: #4a6a9c;
91
+ margin-top: 8mm; /* Espace avant la transition */
92
+ margin-bottom: 8mm; /* Espace après la transition */
93
  }
94
+
95
+ /* Assure que les blocs ne sont pas coupés entre deux pages */
96
  .avoid-page-break {
97
  page-break-inside: avoid;
98
  break-inside: avoid;
 
110
 
111
  {% for partie in dissertation.parties %}
112
  <div class="avoid-page-break">
113
+ <!-- Le titre h3 de la partie sera généré par la boucle si vous le souhaitez,
114
+ sinon on garde le développement directement -->
115
+ <p class="indented">{{ partie.chapeau }}</p>
116
+ {% for arg in partie.arguments %}
117
+ <p class="indented">{{ arg.paragraphe_argumentatif }}</p>
118
+ {% endfor %}
119
+
120
  {% if partie.transition %}
121
  <p class="indented transition">{{ partie.transition }}</p>
122
  {% endif %}