« MediaWiki:Gadget-autonum.css » : différence entre les versions
Aller à la navigation
Aller à la recherche
(Page créée avec « →* * Auto-number headings * * @source https://www.mediawiki.org/wiki/Snippets/Auto-number_headings * @author Krinkle * @version 2021-10-03 : →* * Fallback for pages without a TOC. This could in principle work for all pages, * but we want to ensure consistency between the TOC and heading numbers. : .tpl-autonum .mw-parser-output { counter-reset: autonum-h2 autonum-h3 autonum-h4 autonum-h5 autonum-h6; } .tpl-autonum .mw-parser-output h2 { counter-r... ») |
(Aucune différence)
|
Dernière version du 29 septembre 2023 à 09:38
1 /**
2 * Auto-number headings
3 *
4 * @source https://www.mediawiki.org/wiki/Snippets/Auto-number_headings
5 * @author Krinkle
6 * @version 2021-10-03
7 */
8 /**
9 * Fallback for pages without a TOC. This could in principle work for all pages,
10 * but we want to ensure consistency between the TOC and heading numbers.
11 */
12 .tpl-autonum .mw-parser-output {
13 counter-reset: autonum-h2 autonum-h3 autonum-h4 autonum-h5 autonum-h6;
14 }
15 .tpl-autonum .mw-parser-output h2 {
16 counter-reset: autonum-h3 autonum-h4 autonum-h5 autonum-h6;
17 }
18 .tpl-autonum .mw-parser-output h3 {
19 counter-reset: autonum-h4 autonum-h5 autonum-h6;
20 }
21 .tpl-autonum .mw-parser-output h4 {
22 counter-reset: autonum-h5 autonum-h6;
23 }
24 .tpl-autonum .mw-parser-output h5 {
25 counter-reset: autonum-h6;
26 }
27 .tpl-autonum .mw-parser-output h2 .mw-headline:before {
28 counter-increment: autonum-h2;
29 content: counter(autonum-h2) " ";
30 }
31 .tpl-autonum .mw-parser-output h3 .mw-headline:before {
32 counter-increment: autonum-h3;
33 content: counter(autonum-h2) "." counter(autonum-h3) " ";
34 }
35 .tpl-autonum .mw-parser-output h4 .mw-headline:before {
36 counter-increment: autonum-h4;
37 content: counter(autonum-h2) "." counter(autonum-h3) "." counter(autonum-h4) " ";
38 }
39 .tpl-autonum .mw-parser-output h5 .mw-headline:before {
40 counter-increment: autonum-h5;
41 content: counter(autonum-h2) "." counter(autonum-h3) "." counter(autonum-h4) "." counter(autonum-h5) " ";
42 }
43 .tpl-autonum .mw-parser-output h6 .mw-headline:before {
44 counter-increment: autonum-h6;
45 content: counter(autonum-h2) "." counter(autonum-h3) "." counter(autonum-h4) "." counter(autonum-h5) "." counter(autonum-h6) " ";
46 }