VirtualBox

Changeset 56483 in vbox for trunk


Ignore:
Timestamp:
Jun 17, 2015 4:04:03 PM (10 years ago)
Author:
vboxsync
Message:

syntax diagram tweaking.

Location:
trunk/doc/manual
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/manual/common-formatcfg.xsl

    r56482 r56483  
    5656</xsl:attribute-set>
    5757
     58<!-- command synopsis -->
     59<xsl:variable name="arg.choice.opt.open.str">[</xsl:variable>
     60<xsl:variable name="arg.choice.opt.close.str">]</xsl:variable>
     61<xsl:variable name="arg.choice.req.open.str">&lt;</xsl:variable>
     62<xsl:variable name="arg.choice.req.close.str">&gt;</xsl:variable>
     63<xsl:variable name="arg.choice.plain.open.str"><xsl:text> </xsl:text></xsl:variable>
     64<xsl:variable name="arg.choice.plain.close.str"><xsl:text> </xsl:text></xsl:variable>
     65<xsl:variable name="arg.choice.def.open.str">[</xsl:variable>
     66<xsl:variable name="arg.choice.def.close.str">]</xsl:variable>
     67<xsl:variable name="arg.rep.repeat.str">...</xsl:variable>
     68<xsl:variable name="arg.rep.norepeat.str"></xsl:variable>
     69<xsl:variable name="arg.rep.def.str"></xsl:variable>
     70<xsl:variable name="arg.or.sep"> | </xsl:variable>
     71<xsl:variable name="cmdsynopsis.hanging.indent">4pi</xsl:variable>
    5872
    5973<!--
  • trunk/doc/manual/docbook2latex.xsl

    r56482 r56483  
    3838
    3939  <xsl:import href="string.xsl"/>
     40  <xsl:import href="common-formatcfg.xsl"/>
    4041
    4142  <xsl:variable name="g_nlsChapter">
     
    779780    <xsl:if test="position() > 1">
    780781      <xsl:choose>
     782        <xsl:when test="parent::group"><xsl:value-of select="$arg.or.sep"/></xsl:when>
    781783        <xsl:when test="ancestor-or-self::*/@sepchar"><xsl:value-of select="ancestor-or-self::*/@sepchar"/></xsl:when>
    782784        <xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
     
    785787    <!-- open wrapping -->
    786788    <xsl:choose>
    787       <xsl:when test="@choice = 'opt' or not(@choice) or @choice = ''"> <xsl:text>[</xsl:text></xsl:when>
    788       <xsl:when test="@choice = 'req'">                                 <xsl:text>{</xsl:text></xsl:when>
     789      <xsl:when test="not(@choice) or @choice = ''">  <xsl:value-of select="$arg.choice.def.open.str"/></xsl:when>
     790      <xsl:when test="@choice = 'opt'">               <xsl:value-of select="$arg.choice.opt.open.str"/></xsl:when>
     791      <xsl:when test="@choice = 'req'">               <xsl:value-of select="$arg.choice.req.open.str"/></xsl:when>
    789792      <xsl:when test="@choice = 'plain'"/>
    790793      <xsl:otherwise><xsl:message terminate="yes">Invalid arg choice: "<xsl:value-of select="@choice"/>"</xsl:message></xsl:otherwise>
    791794    </xsl:choose>
     795
    792796    <!-- render the arg (TODO: may need to do more work here) -->
    793797    <xsl:apply-templates />
     798
    794799    <!-- repeat wrapping -->
    795800    <xsl:choose>
    796801      <xsl:when test="@rep = 'norepeat' or not(@rep) or @rep = ''"/>
    797       <xsl:when test="@rep = 'repeat'">                                 <xsl:text>...</xsl:text></xsl:when>
     802      <xsl:when test="@rep = 'repeat'">               <xsl:value-of select="$arg.rep.repeat.str"/></xsl:when>
    798803      <xsl:otherwise><xsl:message terminate="yes">Invalid rep choice: "<xsl:value-of select="@rep"/>"</xsl:message></xsl:otherwise>
    799804    </xsl:choose>
    800805    <!-- close wrapping -->
    801806    <xsl:choose>
    802       <xsl:when test="@choice = 'opt' or not(@choice) or @choice = ''"> <xsl:text>]</xsl:text></xsl:when>
    803       <xsl:when test="@choice = 'req'">                                 <xsl:text>}</xsl:text></xsl:when>
     807      <xsl:when test="not(@choice) or @choice = ''">  <xsl:value-of select="$arg.choice.def.close.str"/></xsl:when>
     808      <xsl:when test="@choice = 'opt'">               <xsl:value-of select="$arg.choice.opt.close.str"/></xsl:when>
     809      <xsl:when test="@choice = 'req'">               <xsl:value-of select="$arg.choice.req.close.str"/></xsl:when>
    804810    </xsl:choose>
    805811  </xsl:template>
     
    807813  <xsl:template match="replaceable">
    808814    <xsl:choose>
    809       <xsl:when test="not(ancestor::cmdsynopsis)">
     815      <xsl:when test="not(ancestor::cmdsynopsis) or ancestor::arg">
    810816        <xsl:text>\texttt{\textit{</xsl:text>
    811817        <xsl:apply-templates />
     
    813819      </xsl:when>
    814820      <xsl:otherwise>
    815         <xsl:text>\textit{</xsl:text>
    816         <xsl:apply-templates />
    817         <xsl:text>}</xsl:text>
     821        <xsl:text>\textit{&lt;</xsl:text>
     822        <xsl:apply-templates />
     823        <xsl:text>&gt;}</xsl:text>
    818824      </xsl:otherwise>
    819825    </xsl:choose>
     
    825831    -->
    826832  <xsl:template match="//text()">
     833
    827834    <xsl:variable name="subst1">
    828835      <xsl:call-template name="str:subst">
     
    833840      </xsl:call-template>
    834841    </xsl:variable>
     842
    835843    <xsl:choose>
    836844      <xsl:when test="(name(..)='screen') or (name(../..)='screen')">
    837845        <xsl:value-of select="." />
    838846      </xsl:when>
     847
    839848      <xsl:when test="(name(..) = 'computeroutput') or (name(../..) = 'computeroutput')
    840849                   or (name(..) = 'code')           or (name(../..) = 'code')
     
    901910          </xsl:call-template>
    902911        </xsl:variable>
    903         <xsl:value-of select="$subst8" />
    904       </xsl:when>
     912        <xsl:choose>
     913          <xsl:when test="parent::arg or parent::command">
     914            <xsl:variable name="subst9">
     915              <xsl:call-template name="str:subst">
     916                <xsl:with-param name="text" select="$subst8" />
     917                <xsl:with-param name="replace" select="' '" />
     918                <xsl:with-param name="with" select="'~'" />
     919                <xsl:with-param name="disable-output-escaping" select="no" />
     920              </xsl:call-template>
     921            </xsl:variable>
     922            <xsl:value-of select="$subst9" />
     923          </xsl:when>
     924          <xsl:otherwise>
     925            <xsl:value-of select="$subst8" />
     926          </xsl:otherwise>
     927        </xsl:choose>
     928      </xsl:when>
     929
    905930      <xsl:when test="(name(..)='address') or (name(../..)='address')">
    906931        <xsl:variable name="subst2">
     
    914939        <xsl:value-of select="$subst2" />
    915940      </xsl:when>
     941
    916942      <xsl:otherwise>
    917943        <xsl:variable name="subst2">
Note: See TracChangeset for help on using the changeset viewer.

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