|
19 | 19 | padding: 0 !important; |
20 | 20 | } |
21 | 21 |
|
22 | | - /* Fond de "bureau" neutre autour des feuilles (écran) */ |
23 | | - body { background: #e9e9ec !important; } |
24 | | - .pagedjs_pages { display: flex; flex-direction: column; gap: 10px; align-items: center; } |
25 | | - .pagedjs_page { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); } |
| 22 | + /* Fond de "bureau" neutre autour des feuilles (écran uniquement) */ |
| 23 | + @media screen { |
| 24 | + body { background: #e9e9ec !important; } |
| 25 | + .pagedjs_pages { |
| 26 | + display: flex; |
| 27 | + flex-direction: column; |
| 28 | + gap: 10px; |
| 29 | + align-items: center; |
| 30 | + } |
| 31 | + .pagedjs_page { |
| 32 | + background: #fff; |
| 33 | + box-shadow: 0 2px 8px rgba(0,0,0,.25); |
| 34 | + } |
| 35 | + } |
26 | 36 |
|
27 | 37 | /* ================= TYPOGRAPHIE ================= */ |
28 | 38 | .md-typeset { |
|
43 | 53 | } |
44 | 54 | .md-typeset li { margin-bottom: 0.25em; } |
45 | 55 |
|
46 | | - /* ---- Titres : hiérarchie claire, encadrés de chapitre ---- */ |
| 56 | + /* ---- Titres ---- */ |
47 | 57 | .md-typeset h1 { |
48 | 58 | font-size: 1.7rem; |
49 | 59 | line-height: 1.25; |
|
75 | 85 | border-left: 3px solid #4051b5; |
76 | 86 | border-radius: 2px; |
77 | 87 | padding: 0.7em 0.9em !important; |
| 88 | + white-space: pre-wrap !important; |
| 89 | + word-break: break-word; |
78 | 90 | } |
79 | 91 | .md-typeset :not(pre) > code { |
80 | 92 | background: #f0f0ec; |
|
83 | 95 | border-radius: 2px; |
84 | 96 | } |
85 | 97 |
|
86 | | - /* ---- Admonitions : encadrés sobres pour le papier ---- */ |
| 98 | + /* ---- Admonitions ---- */ |
87 | 99 | .md-typeset .admonition { |
88 | 100 | border-radius: 3px; |
89 | 101 | border: 1px solid #ccc; |
|
94 | 106 | } |
95 | 107 | .md-typeset .admonition-title { font-weight: bold; } |
96 | 108 |
|
97 | | - /* ---- Tableaux : lignes nettes, en-tête grisé ---- */ |
| 109 | + /* ---- Tableaux ---- */ |
98 | 110 | .md-typeset table { |
99 | 111 | width: 100% !important; |
100 | 112 | font-size: 9.5pt; |
|
112 | 124 | padding: 0.35em 0.6em; |
113 | 125 | } |
114 | 126 |
|
115 | | - /* ---- Images ---- */ |
| 127 | + /* ---- Images, figures, boutons, liens ---- */ |
116 | 128 | .md-typeset img { max-width: 100% !important; break-inside: avoid; } |
117 | 129 | .md-typeset figure { break-inside: avoid; margin: 0.8em 0; } |
118 | | - |
119 | | - /* ---- Blocs code : pas de débordement ---- */ |
120 | | - .md-typeset pre, .md-typeset code { |
121 | | - white-space: pre-wrap !important; |
122 | | - word-break: break-word; |
123 | | - } |
124 | | - |
125 | | - /* ---- Boutons authoring : style sobre à l'impression ---- */ |
126 | 130 | .md-typeset .md-button { |
127 | 131 | border: 1.5px solid #4051b5 !important; |
128 | 132 | color: #4051b5 !important; |
|
133 | 137 | background: #4051b5 !important; |
134 | 138 | color: #fff !important; |
135 | 139 | } |
136 | | - |
137 | | - /* ---- Liens : sobre, URL visible en print ---- */ |
138 | 140 | .md-typeset a { color: #1a5fb4 !important; text-decoration: none; } |
| 141 | + .tabbed-set .tabbed-content { display: block !important; } |
139 | 142 |
|
140 | 143 | /* ================= PAGE DE GARDE ================= */ |
141 | 144 | .print-cover { |
|
171 | 174 | .print-toc li { margin: 0; padding: 0; } |
172 | 175 | .print-toc > ul { counter-reset: tocchap; } |
173 | 176 |
|
174 | | - /* niveau 1 : chapitres */ |
175 | 177 | .print-toc > ul > li { |
176 | 178 | font-weight: bold; |
177 | 179 | margin-top: 0.75rem; |
|
181 | 183 | content: counter(tocchap) ". "; |
182 | 184 | color: #4051b5; |
183 | 185 | } |
184 | | - /* niveau 2 : sous-sections */ |
185 | 186 | .print-toc > ul > li > ul { |
186 | 187 | padding-left: 1.7rem; |
187 | 188 | font-weight: normal; |
188 | 189 | } |
189 | | - /* ligne titre ...... n° */ |
190 | 190 | .print-toc li a { |
191 | 191 | display: flex; |
192 | 192 | align-items: baseline; |
|
198 | 198 | content: target-counter(attr(href url), page); |
199 | 199 | margin-left: auto; |
200 | 200 | font-weight: normal; |
201 | | - font paragraph-height: 0; |
202 | 201 | font-size: 0.9em; |
203 | 202 | color: #444; |
204 | 203 | } |
|
215 | 214 | page-break-before: always; |
216 | 215 | } |
217 | 216 |
|
218 | | - /* pas de titre orphelin en bas de page */ |
| 217 | + /* pas de titre orphelin, pas de bloc coupé */ |
219 | 218 | h1, h2, h3 { break-after: avoid; page-break-after: avoid; } |
220 | 219 | h1, h2, h3, h4, h5, h6, |
221 | 220 | table, figure, blockquote, .admonition { |
222 | 221 | break-inside: avoid; page-break-inside: avoid; |
223 | 222 | } |
224 | 223 |
|
225 | | - /* ================= PAGINATION ================= */ |
| 224 | + /* ================= PAGINATION (Paged.js) ================= */ |
226 | 225 | @page { |
227 | 226 | size: A4; |
228 | | - margin: 22mm 19mm 24mm 19mm; /* marge basse plus grande : footer */ |
| 227 | + margin: 22mm 19mm 24mm 19mm; |
229 | 228 | @bottom-center { |
230 | 229 | content: counter(page) " / " counter(pages); |
231 | 230 | font-family: "Palatino Linotype", Palatino, Georgia, serif; |
|
240 | 239 | } |
241 | 240 | } |
242 | 241 | @page :first { |
243 | | - margin-top: 0; /* couverture pleine hauteur */ |
244 | 242 | @bottom-center { content: none; } |
245 | 243 | @bottom-right { content: none; } |
246 | 244 | } |
247 | 245 |
|
248 | 246 | /* ================= IMPRESSION (Ctrl+P) ================= */ |
249 | 247 | @media print { |
250 | | - /* Les feuilles Paged.js embarquent déjà les marges : le navigateur |
251 | | - n'en rajoute pas. */ |
252 | | - @page { size: A4; margin: 0; } |
253 | 248 | html, body { background: #fff !important; } |
254 | 249 | .pagedjs_pages { gap: 0 !important; display: block !important; } |
255 | 250 | .pagedjs_page { |
256 | 251 | margin: 0 !important; |
257 | 252 | box-shadow: none !important; |
258 | | - break-after: page; /* une feuille HTML = une feuille papier */ |
| 253 | + break-after: page; /* une feuille HTML = une feuille papier */ |
259 | 254 | } |
260 | | - } </style> |
| 255 | + } |
| 256 | + </style> |
261 | 257 | {% endblock %} |
262 | 258 |
|
263 | 259 | {% block scripts %} |
|
284 | 280 | </script> |
285 | 281 | <script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script> |
286 | 282 | <script> |
287 | | - // Si Paged.js n'a pas paginé (CDN bloqué, erreur), réinjecter des |
288 | | - // marges de page pour que l'impression reste lisible. |
| 283 | + // Filet de sécurité : si Paged.js n'a pas pu paginer (CDN bloqué, |
| 284 | + // erreur), réinjecter des marges pour que l'impression reste lisible. |
289 | 285 | window.addEventListener('beforeprint', () => { |
290 | 286 | if (!document.querySelector('.pagedjs_page')) { |
291 | 287 | const style = document.createElement('style'); |
|
0 commit comments