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:
parent
5451eaeb9e
commit
7933ed76c6
2 changed files with 21 additions and 9 deletions
|
@ -3,10 +3,16 @@
|
|||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
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:
|
||||
- 'non-root': executable as user
|
||||
- 'config': execute as root, with no special formatting
|
|
@ -89,8 +89,9 @@ done</xsl:variable>
|
|||
|
||||
<!-- end parameters and global variables -->
|
||||
|
||||
<!-- include the templates for the screen children of role="install" sect2 -->
|
||||
<xsl:include href="gen-install.xsl"/>
|
||||
<!-- include the template for processing screen children of
|
||||
role="install" sect2 -->
|
||||
<xsl:include href="process-install.xsl"/>
|
||||
|
||||
<!--=================== Begin processing ========================-->
|
||||
|
||||
|
@ -275,13 +276,18 @@ echo Start Time: ${SECONDS} >> $INFOLOG
|
|||
</xsl:text>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:apply-templates
|
||||
mode="installation"
|
||||
<xsl:call-template name="process-install">
|
||||
<xsl:with-param
|
||||
name="instruction-tree"
|
||||
select=".//screen[not(@role = 'nodump') and ./userinput] |
|
||||
.//para/command[contains(text(),'check') or
|
||||
contains(text(),'test')]">
|
||||
contains(text(),'test')]"/>
|
||||
<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:if test="$sudo = 'y'">
|
||||
|
|
Reference in a new issue