Refactoring the output of installation instructions:

Create a template which processes the instruction tree fragment (only header
for now, the content is bogus), and call it from main sheet.
This commit is contained in:
Pierre Labastie 2019-08-13 15:03:39 +00:00
parent 5451eaeb9e
commit 7933ed76c6
2 changed files with 21 additions and 9 deletions

View file

@ -3,10 +3,16 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"> version="1.0">
<!-- $Id$ --> <!-- $Id: gen-install.xsl 4107 2019-06-15 15:26:23Z pierre $ -->
<xsl:template name="process-install">
<xsl:param name="instruction-tree"/>
<xsl:param name="want-stats"/>
<xsl:param name="root-seen"/>
<xsl:param name="install-seen"/>
<xsl:param name="test-seen"/>
<xsl:param name="doc-seen"/>
<xsl:template match="screen" mode="installation">
<xsl:param name="want-stats" select="false"/>
<!-- "nature" variables: <!-- "nature" variables:
- 'non-root': executable as user - 'non-root': executable as user
- 'config': execute as root, with no special formatting - 'config': execute as root, with no special formatting

View file

@ -89,8 +89,9 @@ done</xsl:variable>
<!-- end parameters and global variables --> <!-- end parameters and global variables -->
<!-- include the templates for the screen children of role="install" sect2 --> <!-- include the template for processing screen children of
<xsl:include href="gen-install.xsl"/> role="install" sect2 -->
<xsl:include href="process-install.xsl"/>
<!--=================== Begin processing ========================--> <!--=================== Begin processing ========================-->
@ -275,13 +276,18 @@ echo Start Time: ${SECONDS} >> $INFOLOG
</xsl:text> </xsl:text>
</xsl:if> </xsl:if>
<xsl:apply-templates <xsl:call-template name="process-install">
mode="installation" <xsl:with-param
name="instruction-tree"
select=".//screen[not(@role = 'nodump') and ./userinput] | select=".//screen[not(@role = 'nodump') and ./userinput] |
.//para/command[contains(text(),'check') or .//para/command[contains(text(),'check') or
contains(text(),'test')]"> contains(text(),'test')]"/>
<xsl:with-param name="want-stats" select="$want-stats"/> <xsl:with-param name="want-stats" select="$want-stats"/>
</xsl:apply-templates> <xsl:with-param name="root-seen" select="boolean(0)"/>
<xsl:with-param name="install-seen" select="boolean(0)"/>
<xsl:with-param name="test-seen" select="boolean(0)"/>
<xsl:with-param name="doc-seen" select="boolean(0)"/>
</xsl:call-template>
<xsl:text> <xsl:text>
</xsl:text> </xsl:text>
<xsl:if test="$sudo = 'y'"> <xsl:if test="$sudo = 'y'">