VirtualBox

Changeset 56565 in vbox for trunk/doc


Ignore:
Timestamp:
Jun 19, 2015 11:25:00 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
101191
Message:

Implemented itemizedlist; fixed lost space between arg and replaceable; underlined refsect1 and refsect2 titles.

Location:
trunk/doc/manual
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/manual/Makefile.kmk

    r56560 r56565  
    921921$(evalcall2 def_vbox_replace_paths_in_xslt,docbook-refentry-to-H-help.xsl,)
    922922
     923$(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-C-help.xsl: $(VBOX_PATH_MANUAL_SRC)/common-formatcfg.xsl # manual dependency.
     924
    923925$(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.cpp.ts \
    924926+| $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.cpp: \
  • trunk/doc/manual/docbook-refentry-to-C-help.xsl

    r56533 r56565  
    2424
    2525  <xsl:import href="@VBOX_PATH_MANUAL_SRC@/string.xsl"/>
     26  <xsl:import href="@VBOX_PATH_MANUAL_SRC@/common-formatcfg.xsl"/>
    2627
    2728  <xsl:output method="text" version="1.0" encoding="utf-8" indent="yes"/>
    2829  <xsl:strip-space elements="*"/>
    2930
     31  <xsl:variable name="g_sUnderlineRefSect1">
     32    <xsl:text>===================================================================================================================</xsl:text>
     33  </xsl:variable>
     34  <xsl:variable name="g_sUnderlineRefSect2">
     35    <xsl:text>-------------------------------------------------------------------------------------------------------------------</xsl:text>
     36  </xsl:variable>
     37
    3038
    3139  <!-- Default action, do nothing. -->
    3240  <xsl:template match="node()|@*"/>
    33 
    3441
    3542  <!--
     
    114121    <xsl:text>
    115122    {   REFENTRYSTR_SCOPE_GLOBAL,
    116         "Usage:" },</xsl:text>
     123        "Usage" },
     124    {   REFENTRYSTR_SCOPE_SAME,
     125        "=====" },
     126    {   REFENTRYSTR_SCOPE_SAME,
     127        "" },</xsl:text>
    117128        <xsl:apply-templates select="./refsynopsisdiv/node()"/>
    118129
     
    122133      <xsl:if test="text()"><xsl:message terminate="yes">No text supported in refsect1.</xsl:message></xsl:if>
    123134      <xsl:if test="not(./remark[@role='help-skip'])">
     135        <xsl:variable name="sTitle">
     136          <xsl:apply-templates select="./title/node()"/>
     137        </xsl:variable>
    124138        <xsl:text>
    125139    {   </xsl:text><xsl:call-template name="calc-scope-refsect1"/><xsl:text>, "" },
    126140    {   REFENTRYSTR_SCOPE_SAME,
    127         "</xsl:text><xsl:apply-templates select="title/node()"/><xsl:text>:" },</xsl:text>
    128         <xsl:apply-templates select="./*[position() > 1]"/>
     141        "</xsl:text><xsl:value-of select="$sTitle"/><xsl:text>" },
     142    {   REFENTRYSTR_SCOPE_SAME,
     143        "</xsl:text>
     144        <xsl:value-of select="substring($g_sUnderlineRefSect1, 1, string-length($sTitle))"/>
     145        <xsl:text>" },</xsl:text>
     146
     147        <xsl:apply-templates select="./*[name() != 'title']"/>
    129148      </xsl:if>
    130149    </xsl:for-each>
     
    191210
    192211  <xsl:template match="replaceable">
    193     <xsl:text>&lt;</xsl:text>
    194     <xsl:apply-templates select="node()|@*"/>
    195     <xsl:text>&gt;</xsl:text>
    196   </xsl:template>
    197 
     212    <xsl:choose>
     213      <xsl:when test="not(ancestor::cmdsynopsis) or ancestor::arg">
     214        <xsl:apply-templates />
     215      </xsl:when>
     216      <xsl:otherwise>
     217        <xsl:text>&lt;</xsl:text>
     218        <xsl:apply-templates />
     219        <xsl:text>&gt;</xsl:text>
     220      </xsl:otherwise>
     221    </xsl:choose>
     222  </xsl:template>
     223
     224  <!-- duplicated in docbook2latex.xsl -->
    198225  <xsl:template match="arg|group">
    199226    <!-- separator char if we're not the first child -->
    200227    <xsl:if test="position() > 1">
    201228      <xsl:choose>
     229        <xsl:when test="parent::group"><xsl:value-of select="$arg.or.sep"/></xsl:when>
    202230        <xsl:when test="ancestor-or-self::*/@sepchar"><xsl:value-of select="ancestor-or-self::*/@sepchar"/></xsl:when>
    203231        <xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
     
    206234    <!-- open wrapping -->
    207235    <xsl:choose>
    208       <xsl:when test="@choice = 'opt' or not(@choice) or @choice = ''"> <xsl:text>[</xsl:text></xsl:when>
    209       <xsl:when test="@choice = 'req'">                                 <xsl:text></xsl:text></xsl:when>
     236      <xsl:when test="not(@choice) or @choice = ''">  <xsl:value-of select="$arg.choice.def.open.str"/></xsl:when>
     237      <xsl:when test="@choice = 'opt'">               <xsl:value-of select="$arg.choice.opt.open.str"/></xsl:when>
     238      <xsl:when test="@choice = 'req'">               <xsl:value-of select="$arg.choice.req.open.str"/></xsl:when>
    210239      <xsl:when test="@choice = 'plain'"/>
    211240      <xsl:otherwise><xsl:message terminate="yes">Invalid arg choice: "<xsl:value-of select="@choice"/>"</xsl:message></xsl:otherwise>
    212241    </xsl:choose>
     242
    213243    <!-- render the arg (TODO: may need to do more work here) -->
    214     <xsl:apply-templates select="node()|@*"/>
     244    <xsl:apply-templates />
     245
    215246    <!-- repeat wrapping -->
    216247    <xsl:choose>
    217248      <xsl:when test="@rep = 'norepeat' or not(@rep) or @rep = ''"/>
    218       <xsl:when test="@rep = 'repeat'">                                 <xsl:text>...</xsl:text></xsl:when>
     249      <xsl:when test="@rep = 'repeat'">               <xsl:value-of select="$arg.rep.repeat.str"/></xsl:when>
    219250      <xsl:otherwise><xsl:message terminate="yes">Invalid rep choice: "<xsl:value-of select="@rep"/>"</xsl:message></xsl:otherwise>
    220251    </xsl:choose>
    221252    <!-- close wrapping -->
    222253    <xsl:choose>
    223       <xsl:when test="@choice = 'opt' or not(@choice) or @choice = ''"> <xsl:text>]</xsl:text></xsl:when>
    224       <xsl:when test="@choice = 'req'">                                 <xsl:text></xsl:text></xsl:when>
     254      <xsl:when test="not(@choice) or @choice = ''">  <xsl:value-of select="$arg.choice.def.close.str"/></xsl:when>
     255      <xsl:when test="@choice = 'opt'">               <xsl:value-of select="$arg.choice.opt.close.str"/></xsl:when>
     256      <xsl:when test="@choice = 'req'">               <xsl:value-of select="$arg.choice.req.close.str"/></xsl:when>
    225257    </xsl:choose>
    226258  </xsl:template>
     
    236268
    237269    <!-- title / command synopsis - sets the scope. -->
     270    <xsl:variable name="sTitle">
     271      <xsl:apply-templates select="./title/text()"/>
     272    </xsl:variable>
    238273    <xsl:text>
    239274    {   </xsl:text><xsl:call-template name="calc-scope-refsect2"/><xsl:text>, "" },
    240275    {   REFENTRYSTR_SCOPE_SAME,
    241276        "</xsl:text><xsl:call-template name="emit-indentation"/>
    242     <xsl:apply-templates select="./title/text()"/>
    243     <xsl:text>" },</xsl:text>
     277    <xsl:value-of select="$sTitle"/>
     278    <xsl:text>" },
     279    {   REFENTRYSTR_SCOPE_SAME,
     280        "</xsl:text><xsl:call-template name="emit-indentation"/>
     281    <xsl:value-of select="substring($g_sUnderlineRefSect2, 1, string-length($sTitle))"/>
     282    <xsl:text>" },
     283    {   REFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
    244284
    245285    <!-- Format the text in the section -->
     
    275315      <xsl:message terminate="yes">Only varlistentry elements are supported in variablelist</xsl:message>
    276316    </xsl:if>
    277     <xsl:if test="position() != 1">
    278       <xsl:text>
    279     {   REFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
    280     </xsl:if>
    281317    <xsl:for-each select="./varlistentry">
    282318      <xsl:if test="count(*) != 2 or not(term) or not(listitem)">
    283319        <xsl:message terminate="yes">Expected exactly one term and one listentry member in varlistentry element.</xsl:message>
    284320      </xsl:if>
     321      <xsl:if test="not(@spacing) or @spacing != 'compact'">
     322        <xsl:text>
     323    {   REFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
     324      </xsl:if>
    285325      <xsl:apply-templates select="*"/>
    286326    </xsl:for-each>
     
    292332
    293333  <xsl:template match="varlistentry/listitem">
     334    <xsl:if test="text() or *[not(self::para or self::itemizedlist)]">
     335      <xsl:message terminate="yes">Expected varlistentry/listitem to only contain para elements</xsl:message>
     336    </xsl:if>
     337    <xsl:apply-templates select="*"/>
     338  </xsl:template>
     339
     340
     341  <!--
     342    itemizedlist
     343    -->
     344  <xsl:template match="itemizedlist">
     345    <xsl:if test="*[not(self::listitem)]|text()">
     346      <xsl:message terminate="yes">Only listitem elements are supported in itemizedlist.</xsl:message>
     347    </xsl:if>
     348    <xsl:if test="parent::para">
     349      <xsl:message terminate="yes">itemizedlist inside a para is current not supported. <!-- no newline
     350        -->Close the para before the list, it makes no difference to html and latex/pdf output.</xsl:message>
     351    </xsl:if>
     352    <xsl:if test="position() != 1 and (not(@spacing) or @spacing != 'compact')">
     353      <xsl:text>
     354    {   REFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
     355    </xsl:if>
     356    <xsl:for-each select="./listitem">
     357      <xsl:apply-templates select="*"/>
     358    </xsl:for-each>
     359  </xsl:template>
     360
     361  <xsl:template match="itemizedlist/listitem">
    294362    <xsl:if test="text() or *[not(self::para)]">
    295       <xsl:message terminate="yes">Expected varlistentry/listitem to only contain para elements</xsl:message>
     363      <xsl:message terminate="yes">Expected itemizedlist/listitem to only contain para elements</xsl:message>
     364    </xsl:if>
     365    <xsl:if test="position() != 1 and @spaceing != 'compact'">
     366      <xsl:text>
     367    {   REFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
    296368    </xsl:if>
    297369    <xsl:apply-templates select="*"/>
     
    376448      </xsl:otherwise>
    377449    </xsl:choose>
     450
     451    <!-- Ugly whitespace hack! Mainly for <arg>-_-cpu <replaceable>id</replaceable></arg> -->
     452    <xsl:if test="substring(.,string-length(.)) = ' ' and position() != last()">
     453      <xsl:text> </xsl:text>
     454    </xsl:if>
     455
    378456  </xsl:template>
    379457
    380458  <!-- Elements producing non-breaking strings (single line). -->
    381   <xsl:template match="command/text()|option/text()|computeroutput/text()" name="escape_fixed_text">
     459  <xsl:template match="command/text()|option/text()|computeroutput/text()|arg/text()" name="escape_fixed_text">
    382460    <xsl:param name="sText" select="."/>
    383461    <xsl:choose>
     
    628706
    629707  <!--
    630     Calculates and emits indentation.
     708    Calculates and emits indentation list markup.
    631709    -->
    632710  <xsl:template name="emit-indentation">
    633     <xsl:if test="ancestor::refsect1|ancestor::refsynopsisdiv">
    634       <xsl:text>  </xsl:text>
    635     </xsl:if>
    636     <xsl:if test="ancestor::refsect2">
    637       <xsl:text>  </xsl:text>
    638     </xsl:if>
    639     <xsl:if test="ancestor::refsect3">
    640       <xsl:text>  </xsl:text>
    641     </xsl:if>
    642     <xsl:if test="ancestor::varlistentry">
    643       <xsl:if test="ancestor-or-self::term">
    644         <xsl:text> </xsl:text>
    645       </xsl:if>
    646       <xsl:if test="ancestor-or-self::listitem">
    647         <xsl:text>    </xsl:text>
    648       </xsl:if>
    649     </xsl:if>
     711    <xsl:variable name="iDepth" select="count(ancestor-or-self::*)"/>
     712    <xsl:for-each select="ancestor-or-self::*">
     713      <xsl:choose>
     714        <xsl:when test="self::refsect1
     715                      | self::refsect2
     716                      | self::refsect3
     717                      | self::refsynopsisdiv">
     718          <xsl:text>  </xsl:text>
     719        </xsl:when>
     720        <xsl:when test="self::term"/> <!-- currently no indent. -->
     721        <xsl:when test="self::listitem and parent::varlistentry">
     722          <xsl:text>    </xsl:text>
     723        </xsl:when>
     724        <xsl:when test="self::listitem and parent::itemizedlist and (position() + 1) = $iDepth">
     725          <xsl:text>  * </xsl:text>
     726        </xsl:when>
     727        <xsl:when test="self::listitem and parent::itemizedlist">
     728          <xsl:text>    </xsl:text>
     729        </xsl:when>
     730      </xsl:choose>
     731    </xsl:for-each>
    650732  </xsl:template>
    651733
  • trunk/doc/manual/docbook2latex.xsl

    r56532 r56565  
    787787  </xsl:template>
    788788
     789  <!-- duplicated in docbook2latex.xsl -->
    789790  <xsl:template match="arg|group">
    790791    <!-- separator char if we're not the first child -->
  • trunk/doc/manual/en_US/man_VBoxManage-debugvm.xml

    r56533 r56565  
    269269        <varlistentry>
    270270          <term><replaceable>reg-set.reg-name</replaceable></term>
    271           <listitem><para>One of more registers, each having one of the following forms:
     271          <listitem>
     272            <para>One of more registers, each having one of the following forms:</para>
    272273            <itemizedlist>
    273               <listitem><para><computeroutput>register-set.register-name.sub-field</computeroutput></para></listitem>
    274               <listitem><para><computeroutput>register-set.register-name</computeroutput></para></listitem>
    275               <listitem><para><computeroutput>cpu-register-name.sub-field</computeroutput></para></listitem>
    276               <listitem><para><computeroutput>cpu-register-name</computeroutput></para></listitem>
    277               <listitem><para><computeroutput>all</computeroutput></para></listitem>
     274              <listitem><para><replaceable>register-set.register-name.sub-field</replaceable></para></listitem>
     275              <listitem><para><replaceable>register-set.register-name</replaceable></para></listitem>
     276              <listitem><para><replaceable>cpu-register-name.sub-field</replaceable></para></listitem>
     277              <listitem><para><replaceable>cpu-register-name</replaceable></para></listitem>
     278              <listitem><para><replaceable>all</replaceable></para></listitem>
    278279            </itemizedlist>
    279             The <replaceable>all</replaceable> form will cause all registers
    280             to be shown (no sub-fields).  The registers names are case-insensitive.
    281           </para></listitem>
     280            <para>The <replaceable>all</replaceable> form will cause all registers
     281              to be shown (no sub-fields).  The registers names are case-insensitive.
     282            </para>
     283          </listitem>
    282284        </varlistentry>
    283285        <varlistentry>
     
    299301        <varlistentry>
    300302          <term><replaceable>reg-set.reg-name=value</replaceable></term>
    301           <listitem><para>One of more register assignment, each having one of the following forms:
     303          <listitem>
     304            <para>One of more register assignment, each having one of the following forms:</para>
    302305            <itemizedlist>
    303               <listitem><para><computeroutput>register-set.register-name.sub-field=value</computeroutput></para></listitem>
    304               <listitem><para><computeroutput>register-set.register-name=value</computeroutput></para></listitem>
    305               <listitem><para><computeroutput>cpu-register-name.sub-field=value</computeroutput></para></listitem>
    306               <listitem><para><computeroutput>cpu-register-name=value</computeroutput></para></listitem>
     306              <listitem><para><replaceable>register-set.register-name.sub-field=value</replaceable></para></listitem>
     307              <listitem><para><replaceable>register-set.register-name=value</replaceable></para></listitem>
     308              <listitem><para><replaceable>cpu-register-name.sub-field=value</replaceable></para></listitem>
     309              <listitem><para><replaceable>cpu-register-name=value</replaceable></para></listitem>
    307310            </itemizedlist>
    308             The value format should be in the same style as what <command>getregisters</command>
    309             displays, with the exception that both octal and decimal can be used instead of
    310             hexadecimal.
    311           </para></listitem>
     311            <para>The value format should be in the same style as what
     312              <command>getregisters</command> displays, with the exception that
     313              both octal and decimal can be used instead of hexadecimal.</para>
     314          </listitem>
    312315        </varlistentry>
    313316        <varlistentry>
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