File size: 3,974 Bytes
f1fd51e
 
 
dcf0012
f1fd51e
 
 
 
 
4ca90f2
 
 
 
 
f1fd51e
 
eb5759e
 
f1fd51e
 
 
eb5759e
f1fd51e
 
13b23c8
eb5759e
f1fd51e
eb5759e
 
13b23c8
eb5759e
 
 
 
dcf0012
 
 
 
 
 
624df09
13b23c8
eb5759e
dcf0012
 
 
eb5759e
 
dcf0012
 
 
 
eb5759e
13b23c8
eb5759e
dcf0012
 
 
eb5759e
dcf0012
 
eb5759e
 
 
13b23c8
dcf0012
 
eb5759e
dcf0012
 
13b23c8
4ca90f2
 
dcf0012
 
 
 
13b23c8
dcf0012
 
f1fd51e
 
 
 
 
4ca90f2
f1fd51e
 
 
 
 
 
 
13b23c8
 
 
eb5759e
 
 
 
 
13b23c8
f1fd51e
 
 
 
 
 
 
 
 
 
 
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!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>