diff options
Diffstat (limited to 'docs/usage.xsl')
| -rw-r--r-- | docs/usage.xsl | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/docs/usage.xsl b/docs/usage.xsl index 14dd31886b..3c0d2bfb73 100644 --- a/docs/usage.xsl +++ b/docs/usage.xsl @@ -22,6 +22,8 @@ <xsl:text> </xsl:text> </xsl:for-each> +<xsl:text> </xsl:text> + <!-- List options (any variable list in a section called "Options"). --> <xsl:for-each select=".//*[title='Options']/variablelist"> <xsl:if test="position() = 1"> Options: </xsl:if> @@ -34,9 +36,15 @@ </xsl:for-each> </xsl:for-each> +<!-- Any paragraphs which have been marked as role="usage" (principally for global flags). --> +<xsl:text> </xsl:text> +<xsl:for-each select="//para[@role='usage']"> +<xsl:value-of select="normalize-space(.)"/><xsl:text> </xsl:text> +</xsl:for-each> + <!-- List commands (any first-level variable list in a section called "Commands"). --> <xsl:for-each select=".//*[title='Commands']/variablelist | .//*[title='Commands']/refsect2/variablelist"> - <xsl:if test="position() = 1"> Commands: </xsl:if> + <xsl:if test="position() = 1">Commands: </xsl:if> <xsl:for-each select="varlistentry"> <xsl:text> </xsl:text> <xsl:apply-templates select="term"/> @@ -45,21 +53,15 @@ <xsl:text> </xsl:text> </xsl:for-each> -<!-- Any paragraphs which have been marked as role="usage" (principally for global flags). --> -<xsl:for-each select="//para[@role='usage']"> -<xsl:value-of select="normalize-space(.)"/><xsl:text> </xsl:text> -</xsl:for-each> - -<!-- Any second-level variable lists (principally for options for subcommands). --> -<xsl:for-each select=".//*[title='Commands']//variablelist//variablelist"> - <xsl:for-each select="varlistentry"><<xsl:apply-templates select="term"/>> - <xsl:apply-templates select="listitem"/> - <xsl:text> </xsl:text> - </xsl:for-each> - <xsl:text> </xsl:text> +<!-- Any second-level variable lists (for options for subcommands). --> +<xsl:for-each select=".//*[title='Commands']//varlistentry[@role='usage-has-option-list']"> +<<xsl:value-of select="term/option[@role='usage-option-list']/replaceable"/>> must be a member of the list [<xsl:for-each select="listitem/variablelist/varlistentry"><xsl:apply-templates select="term"/><xsl:if test="not(position() = last())">, </xsl:if></xsl:for-each>]. </xsl:for-each> </xsl:template> +<xsl:template match="option">[<xsl:apply-templates/>]</xsl:template> + <xsl:template match="replaceable"><<xsl:value-of select="normalize-space(.)"/>></xsl:template> </xsl:stylesheet> |
