VirtualBox

Ignore:
Timestamp:
Apr 21, 2023 9:59:02 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
157010
Message:

manual,VBoxManage,isomaker/viso: Require all refsect1 and refsect2 elements to have @id attributes in manpages (refentry) to make these predictable and the split up topic files easier to handle for the docs team. Also requires these @id values to start with the refentry @id + '-'. Corrected a few bogus ones. Because 'controlvm' has too many sub-commands, HELP_SCOPE_ IDs will not be generated for 'See Also' and 'Examples' sections. bugref:10302

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/manual/docbook-refentry-to-C-help.xsl

    r99118 r99513  
    149149    <!-- Then comes the description and other refsect1 -->
    150150    <xsl:for-each select="./refsect1">
     151      <!-- assertions -->
    151152      <xsl:if test="name(*[1]) != 'title'"><xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>Expected title as the first element in refsect1.</xsl:message></xsl:if>
    152153      <xsl:if test="text()"><xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>No text supported in refsect1.</xsl:message></xsl:if>
     154      <xsl:if test="not(@id)"><xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>refsect1 must have an @id attribute.</xsl:message></xsl:if>
     155      <xsl:if test="not(starts-with(@id, concat(../@id, '-')))"><xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>Wrong @id refsect1 prefix: '<xsl:value-of select="@id"/>', expected it to start with '<xsl:value-of select="../@id"/>-'</xsl:message></xsl:if>
     156
     157      <!-- .... -->
    153158      <xsl:if test="not(./remark[@role='help-skip'])">
    154159        <xsl:variable name="sTitle">
     
    321326    <xsl:if test="text()"><xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>refsect2 shouldn't contain text</xsl:message></xsl:if>
    322327    <xsl:if test="count(./title) != 1"><xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>refsect2 requires a title (<xsl:value-of select="ancestor-or-self::*[@id][1]/@id"/>)</xsl:message></xsl:if>
     328    <xsl:if test="not(@id)"><xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>refsect2 must have an @id attribute.</xsl:message></xsl:if>
     329    <xsl:if test="not(starts-with(@id, concat(../../@id, '-')))"><xsl:message terminate="yes"><xsl:call-template name="error-prefix"/>Wrong @id refsect2 prefix: '<xsl:value-of select="@id"/>', expected it to start with '<xsl:value-of select="../../@id"/>-'</xsl:message></xsl:if>
    323330
    324331    <!-- title / command synopsis - sets the scope. -->
     
    731738  <xsl:template name="calc-scope-refsect1">
    732739    <xsl:choose>
    733       <xsl:when test="title[text() = 'Description']">
     740      <xsl:when test="contains(@id, '-description') or title[text() = 'Description']">
    734741        <xsl:text>RTMSGREFENTRYSTR_SCOPE_GLOBAL</xsl:text>
    735742      </xsl:when>
    736       <xsl:when test="@id or remark[@role='help-scope']">
     743      <xsl:when test="(@id and not(contains(@id, '-see-also')) and not(contains(@id, '-examples'))) or remark[@role='help-scope']">
    737744        <xsl:call-template name="calc-scope-from-remark-or-id"/>
    738745      </xsl:when>
     
    746753  <xsl:template name="calc-scope-refsect2">
    747754    <xsl:choose>
    748       <xsl:when test="@id or remark[@role='help-scope']">
     755      <xsl:when test="(@id and not(contains(@id, '-see-also')) and not(contains(@id, '-examples'))) or remark[@role='help-scope']">
    749756        <xsl:call-template name="calc-scope-from-remark-or-id"/>
    750757      </xsl:when>
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette