docs: Move 'html including' from page.xsl to site.xsl

Strip down the main template as much as possible.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2024-02-07 15:08:16 +01:00
parent 799e38ef31
commit 8c0e313339
2 changed files with 14 additions and 14 deletions

View File

@ -7,18 +7,12 @@
exclude-result-prefixes="xsl exsl html" exclude-result-prefixes="xsl exsl html"
version="1.0"> version="1.0">
<xsl:param name="builddir" select="'..'"/>
<xsl:template match="node() | @*" mode="content"> <xsl:template match="node() | @*" mode="content">
<xsl:copy> <xsl:copy>
<xsl:apply-templates select="node() | @*" mode="content"/> <xsl:apply-templates select="node() | @*" mode="content"/>
</xsl:copy> </xsl:copy>
</xsl:template> </xsl:template>
<xsl:template match="html:div[@id='include']" mode="content">
<xsl:call-template name="include"/>
</xsl:template>
<!-- This is the master page structure --> <!-- This is the master page structure -->
<xsl:template match="/" mode="page"> <xsl:template match="/" mode="page">
<xsl:param name="pagesrc"/> <xsl:param name="pagesrc"/>
@ -125,14 +119,6 @@
</html> </html>
</xsl:template> </xsl:template>
<xsl:template name="include">
<xsl:variable name="inchtml">
<xsl:copy-of select="document(concat($builddir, '/docs/', @filename))"/>
</xsl:variable>
<xsl:apply-templates select="exsl:node-set($inchtml)/html:html/html:body/*" mode="content"/>
</xsl:template>
<xsl:template match="html:h1 | html:h2 | html:h3 | html:h4 | html:h5 | html:h6" mode="content"> <xsl:template match="html:h1 | html:h2 | html:h3 | html:h4 | html:h5 | html:h6" mode="content">
<xsl:element name="{name()}"> <xsl:element name="{name()}">
<xsl:apply-templates mode="copy" /> <xsl:apply-templates mode="copy" />

View File

@ -8,6 +8,20 @@
<xsl:import href="page.xsl"/> <xsl:import href="page.xsl"/>
<xsl:param name="builddir" select="'..'"/>
<xsl:template match="html:div[@id='include']" mode="content">
<xsl:call-template name="include"/>
</xsl:template>
<xsl:template name="include">
<xsl:variable name="inchtml">
<xsl:copy-of select="document(concat($builddir, '/docs/', @filename))"/>
</xsl:variable>
<xsl:apply-templates select="exsl:node-set($inchtml)/html:html/html:body/*" mode="content"/>
</xsl:template>
<xsl:output <xsl:output
method="xml" method="xml"
encoding="UTF-8" encoding="UTF-8"