From 7b70213b553b959c8b0cc0ede323f328d48c2910 Mon Sep 17 00:00:00 2001 From: Rob Beezer Date: Wed, 13 May 2026 16:08:00 -0700 Subject: [PATCH] HTML: thread heading-level parameter through block templates Co-Authored-By: Claude Opus 4.7 --- xsl/pretext-common.xsl | 9 +- xsl/pretext-html.xsl | 489 +++++++++++++++++++++++++++++++------- xsl/pretext-runestone.xsl | 13 +- 3 files changed, 415 insertions(+), 96 deletions(-) diff --git a/xsl/pretext-common.xsl b/xsl/pretext-common.xsl index 0e8f10c92..b8297cd83 100644 --- a/xsl/pretext-common.xsl +++ b/xsl/pretext-common.xsl @@ -5867,6 +5867,7 @@ Book (with parts), "section" at level 3 + @@ -5934,6 +5935,7 @@ Book (with parts), "section" at level 3 + @@ -5972,9 +5974,12 @@ Book (with parts), "section" at level 3 + - + + + @@ -5991,10 +5996,12 @@ Book (with parts), "section" at level 3 + + diff --git a/xsl/pretext-html.xsl b/xsl/pretext-html.xsl index 5c41edfb2..c1b5181e3 100644 --- a/xsl/pretext-html.xsl +++ b/xsl/pretext-html.xsl @@ -520,14 +520,18 @@ along with MathBook XML. If not, see . - + + + - + + + @@ -1177,6 +1181,7 @@ along with MathBook XML. If not, see . +
@@ -1189,6 +1194,7 @@ along with MathBook XML. If not, see . + @@ -1197,6 +1203,7 @@ along with MathBook XML. If not, see . +
@@ -1806,6 +1813,7 @@ along with MathBook XML. If not, see . +
@@ -1813,6 +1821,7 @@ along with MathBook XML. If not, see . +
@@ -1922,43 +1931,27 @@ along with MathBook XML. If not, see . - - - - - - - - - - - - + + + + + - - - 1 - 0 - - - + + + + + + + PTX:BUG: "hN" template reached without a $heading-level parameter on element <> at /; defaulting to h2 + 2 @@ -2135,7 +2128,9 @@ along with MathBook XML. If not, see . + + @@ -2154,7 +2149,9 @@ along with MathBook XML. If not, see . + + @@ -2177,7 +2174,9 @@ along with MathBook XML. If not, see . + + ( @@ -2199,7 +2198,9 @@ along with MathBook XML. If not, see . + + @@ -2225,7 +2226,9 @@ along with MathBook XML. If not, see . + + @@ -2237,7 +2240,9 @@ along with MathBook XML. If not, see . + + @@ -2290,8 +2295,10 @@ along with MathBook XML. If not, see . + + @@ -2342,7 +2349,9 @@ along with MathBook XML. If not, see . + + @@ -2398,7 +2407,9 @@ along with MathBook XML. If not, see . + + @@ -2553,6 +2564,7 @@ along with MathBook XML. If not, see . + @@ -2561,6 +2573,7 @@ along with MathBook XML. If not, see . + @@ -2568,6 +2581,7 @@ along with MathBook XML. If not, see . + @@ -2575,14 +2589,17 @@ along with MathBook XML. If not, see . + + + @@ -2600,7 +2617,9 @@ along with MathBook XML. If not, see . - + + + @@ -2610,6 +2629,7 @@ along with MathBook XML. If not, see . + @@ -2671,12 +2691,18 @@ along with MathBook XML. If not, see . - + + + + - + + + + @@ -2687,10 +2713,12 @@ along with MathBook XML. If not, see . + + @@ -2716,12 +2744,18 @@ along with MathBook XML. If not, see . - + + + + - + + + + @@ -2732,10 +2766,12 @@ along with MathBook XML. If not, see . + + @@ -2762,12 +2798,18 @@ along with MathBook XML. If not, see . - + + + + - + + + + @@ -2785,6 +2827,7 @@ along with MathBook XML. If not, see . + @@ -2793,6 +2836,7 @@ along with MathBook XML. If not, see . + @@ -2801,6 +2845,7 @@ along with MathBook XML. If not, see . + @@ -2828,12 +2873,18 @@ along with MathBook XML. If not, see . - + + + + - + + + + @@ -2844,10 +2895,12 @@ along with MathBook XML. If not, see . + + @@ -2873,12 +2926,18 @@ along with MathBook XML. If not, see . - + + + + - + + + + @@ -2889,11 +2948,13 @@ along with MathBook XML. If not, see . + + @@ -2921,12 +2982,18 @@ along with MathBook XML. If not, see . - + + + + - + + + + @@ -2934,6 +3001,7 @@ along with MathBook XML. If not, see . + @@ -3087,6 +3155,7 @@ along with MathBook XML. If not, see . + @@ -3098,6 +3167,7 @@ along with MathBook XML. If not, see . + @@ -3113,6 +3183,7 @@ along with MathBook XML. If not, see .
+
@@ -3131,6 +3202,7 @@ along with MathBook XML. If not, see . + @@ -3148,6 +3220,7 @@ along with MathBook XML. If not, see .
+
@@ -3181,12 +3254,18 @@ along with MathBook XML. If not, see . - + + + + - + + + + @@ -3196,9 +3275,11 @@ along with MathBook XML. If not, see . + + @@ -3228,7 +3309,10 @@ along with MathBook XML. If not, see . - + + + + @@ -3236,8 +3320,10 @@ along with MathBook XML. If not, see . + + @@ -3262,12 +3348,18 @@ along with MathBook XML. If not, see . - + + + + - + + + + @@ -3275,8 +3367,10 @@ along with MathBook XML. If not, see . + + @@ -3305,12 +3399,18 @@ along with MathBook XML. If not, see . - + + + + - + + + + @@ -3318,8 +3418,10 @@ along with MathBook XML. If not, see . + + @@ -3364,12 +3466,18 @@ along with MathBook XML. If not, see . - + + + + - + + + + @@ -3380,6 +3488,7 @@ along with MathBook XML. If not, see . + @@ -3388,6 +3497,7 @@ along with MathBook XML. If not, see . +
@@ -3396,6 +3506,7 @@ along with MathBook XML. If not, see . + @@ -3428,7 +3539,10 @@ along with MathBook XML. If not, see . - + + + + @@ -3441,14 +3555,18 @@ along with MathBook XML. If not, see . + + + + @@ -3522,12 +3640,18 @@ along with MathBook XML. If not, see . - + + + + - + + + + @@ -3536,8 +3660,10 @@ along with MathBook XML. If not, see . + +
@@ -3553,10 +3679,12 @@ along with MathBook XML. If not, see . +
+
@@ -3681,10 +3809,16 @@ along with MathBook XML. If not, see . - + + + + - + + + + @@ -3729,6 +3863,7 @@ along with MathBook XML. If not, see . + @@ -3741,12 +3876,14 @@ along with MathBook XML. If not, see . + + @@ -3763,12 +3900,15 @@ along with MathBook XML. If not, see . - + + + + @@ -3784,6 +3924,7 @@ along with MathBook XML. If not, see . + @@ -3794,6 +3935,7 @@ along with MathBook XML. If not, see . + @@ -3804,6 +3946,7 @@ along with MathBook XML. If not, see . + @@ -3814,6 +3957,7 @@ along with MathBook XML. If not, see . + @@ -3861,7 +4005,10 @@ along with MathBook XML. If not, see . - + + + + @@ -3878,6 +4025,7 @@ along with MathBook XML. If not, see . + @@ -3895,12 +4043,15 @@ along with MathBook XML. If not, see . - + + + + @@ -3909,6 +4060,7 @@ along with MathBook XML. If not, see . + @@ -3966,6 +4118,7 @@ along with MathBook XML. If not, see . + @@ -3979,6 +4132,7 @@ along with MathBook XML. If not, see . + @@ -3986,10 +4140,12 @@ along with MathBook XML. If not, see . + + @@ -3998,6 +4154,7 @@ along with MathBook XML. If not, see . + @@ -4005,6 +4162,7 @@ along with MathBook XML. If not, see . + @@ -4015,6 +4173,7 @@ along with MathBook XML. If not, see . + @@ -4024,6 +4183,7 @@ along with MathBook XML. If not, see . + @@ -4056,12 +4216,18 @@ along with MathBook XML. If not, see . - + + + + - + + + + @@ -4073,6 +4239,7 @@ along with MathBook XML. If not, see . + @@ -4088,6 +4255,7 @@ along with MathBook XML. If not, see . + @@ -4096,6 +4264,7 @@ along with MathBook XML. If not, see . + @@ -4157,6 +4326,7 @@ along with MathBook XML. If not, see . + @@ -4198,6 +4368,7 @@ along with MathBook XML. If not, see . + @@ -4210,12 +4381,14 @@ along with MathBook XML. If not, see . + + @@ -4256,9 +4429,12 @@ along with MathBook XML. If not, see . + - + + + @@ -4268,7 +4444,10 @@ along with MathBook XML. If not, see . - + + + + @@ -4279,10 +4458,12 @@ along with MathBook XML. If not, see . + + @@ -4308,12 +4489,18 @@ along with MathBook XML. If not, see . - + + + + - + + + + @@ -4324,16 +4511,19 @@ along with MathBook XML. If not, see . + + + @@ -4377,6 +4567,7 @@ along with MathBook XML. If not, see . + @@ -4392,6 +4583,7 @@ along with MathBook XML. If not, see . + @@ -4402,11 +4594,13 @@ along with MathBook XML. If not, see . + + @@ -4420,6 +4614,7 @@ along with MathBook XML. If not, see . + @@ -4436,6 +4631,7 @@ along with MathBook XML. If not, see . + @@ -4449,18 +4645,21 @@ along with MathBook XML. If not, see . + + +
@@ -4528,12 +4727,18 @@ along with MathBook XML. If not, see . - + + + + - + + + + @@ -4544,11 +4749,13 @@ along with MathBook XML. If not, see . + + @@ -4583,18 +4790,26 @@ along with MathBook XML. If not, see . - + + + + + - + + + - + + + @@ -4608,10 +4823,12 @@ along with MathBook XML. If not, see . + + @@ -4637,12 +4854,18 @@ along with MathBook XML. If not, see . - + + + + - + + + + @@ -4650,8 +4873,10 @@ along with MathBook XML. If not, see . + + @@ -4690,7 +4915,10 @@ along with MathBook XML. If not, see . - + + + + @@ -4785,11 +5013,14 @@ along with MathBook XML. If not, see . +
- + + + @@ -4917,15 +5148,24 @@ along with MathBook XML. If not, see . - + + + + - + + + + - + + + + @@ -4935,8 +5175,10 @@ along with MathBook XML. If not, see . + + @@ -4961,7 +5203,9 @@ along with MathBook XML. If not, see . + + @@ -4981,7 +5225,10 @@ along with MathBook XML. If not, see . - + + + + @@ -5005,6 +5252,7 @@ along with MathBook XML. If not, see . + @@ -5031,11 +5279,15 @@ along with MathBook XML. If not, see . - + + + - + + + @@ -5048,9 +5300,11 @@ along with MathBook XML. If not, see . + + @@ -5073,6 +5327,7 @@ along with MathBook XML. If not, see . + @@ -5111,15 +5366,21 @@ along with MathBook XML. If not, see . - + + + + + - + + + @@ -5135,6 +5396,7 @@ along with MathBook XML. If not, see . + @@ -5152,8 +5414,11 @@ along with MathBook XML. If not, see . + - + + + @@ -5167,6 +5432,7 @@ along with MathBook XML. If not, see . +
@@ -5189,6 +5455,7 @@ along with MathBook XML. If not, see . + @@ -5209,6 +5476,7 @@ along with MathBook XML. If not, see . + @@ -5234,6 +5502,7 @@ along with MathBook XML. If not, see . + @@ -5279,12 +5548,18 @@ along with MathBook XML. If not, see . - + + + + - + + + + @@ -5298,12 +5573,16 @@ along with MathBook XML. If not, see . +
- + + + +
@@ -5335,6 +5614,7 @@ along with MathBook XML. If not, see . + @@ -5350,6 +5630,7 @@ along with MathBook XML. If not, see . +
@@ -5368,11 +5649,14 @@ along with MathBook XML. If not, see . +
- + + + @@ -5571,6 +5855,7 @@ along with MathBook XML. If not, see . + @@ -5582,6 +5867,7 @@ along with MathBook XML. If not, see . + @@ -5590,6 +5876,7 @@ along with MathBook XML. If not, see . + @@ -5681,6 +5968,7 @@ along with MathBook XML. If not, see . + @@ -5724,6 +6012,7 @@ along with MathBook XML. If not, see . + @@ -5787,6 +6076,7 @@ along with MathBook XML. If not, see . +
@@ -5804,6 +6094,7 @@ along with MathBook XML. If not, see . +
@@ -6609,6 +6900,7 @@ along with MathBook XML. If not, see . + @@ -6648,6 +6940,7 @@ along with MathBook XML. If not, see . + @@ -9699,15 +9992,21 @@ along with MathBook XML. If not, see . + - + + + + + + @@ -9723,6 +10022,7 @@ along with MathBook XML. If not, see . + @@ -9789,7 +10089,9 @@ along with MathBook XML. If not, see .
- + + +
@@ -14246,9 +14548,12 @@ TODO: +
- + + +
diff --git a/xsl/pretext-runestone.xsl b/xsl/pretext-runestone.xsl index 389371356..b09bef1d9 100644 --- a/xsl/pretext-runestone.xsl +++ b/xsl/pretext-runestone.xsl @@ -2806,6 +2806,7 @@ along with PreTeXt. If not, see . +
@@ -2818,7 +2819,9 @@ along with PreTeXt. If not, see .
- + + +
@@ -2833,7 +2836,9 @@ along with PreTeXt. If not, see . )
- + + +
@@ -2841,7 +2846,9 @@ along with PreTeXt. If not, see .
- + + +