Hi hackers,
Currently the `body.attributes` template in
doc/src/sgml/stylesheet-html-common.xsl unconditionally adds
`class="container-fluid col-10"` to every HTML output. Those classes only
make sense when the “website” stylesheet (docs-complete.css, which
includes Bootstrap’s grid) is actually loaded, i.e. when you build with
make STYLE=website html
In a normal local build (`make html`), `$website.stylesheet` is zero,
docs-complete.css is not pulled in, and the Bootstrap classes are
“hanging” in the markup without any effect. This can confuse both
users and downstream tooling, and generally clutters the output with
unused attributes.
This patch wraps that `<xsl:attribute name="class">container-fluid
col-10</xsl:attribute>`
inside an `<xsl:if test="$website.stylesheet != 0">…</xsl:if>` so that the
container classes are only emitted when the website CSS bundle is in use.
Local builds remain unchanged (no container classes), while `STYLE=website`
builds continue to get the proper 10/12-column layout.
Equipment tested:
- `make html` produces <body id="docContent"> with no class attribute
- `make STYLE=website html` produces
<body id="docContent" class="container-fluid col-10"> and
the docs-complete.css bundle correctly constrains the width
Discussion:
This keeps the default (offline) documentation clean of Bootstrap-specific
markup, but preserves the exact site look when desired.
Any feedback or suggestions are very welcome!
--
Best wishes,
Lev Nikolaev,
Tantor Labs LLC
From 93196137a32678813a017fc454d8fb60a00c0d2a Mon Sep 17 00:00:00 2001
From: Lev Nikolaev <lev.nikol...@tantorlabs.com>
Date: Wed, 9 Jul 2025 14:54:23 +0300
Subject: [PATCH] stylesheet-html-common: only apply Bootstrap container
classes in website build
Author: Lev Nikolaev <lev.nikol...@tantorlabs.com>
co-Author: Anatoliy Kraev <anatoliy.kr...@tantorlabs.com>
---
doc/src/sgml/stylesheet-html-common.xsl | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/doc/src/sgml/stylesheet-html-common.xsl b/doc/src/sgml/stylesheet-html-common.xsl
index 9dcf96c02e5..8bfe36c0050 100644
--- a/doc/src/sgml/stylesheet-html-common.xsl
+++ b/doc/src/sgml/stylesheet-html-common.xsl
@@ -33,7 +33,9 @@
-->
<xsl:template name="body.attributes">
<xsl:attribute name="id">docContent</xsl:attribute>
- <xsl:attribute name="class">container-fluid col-10</xsl:attribute>
+ <xsl:if test="$website.stylesheet != 0">
+ <xsl:attribute name="class">container-fluid col-10</xsl:attribute>
+ </xsl:if>
</xsl:template>
<!-- Change display of some elements -->
--
2.34.1