문제

Does the DocBook standard contain any elements that are equivalent to the JavaDoc @since tag?

I'm specifically trying to do this in a "refentry" element, but nothing seems appropriate.

도움이 되었습니까?

해결책

I'm quite certain that there is no semantic equivalent of the Javadoc @since tag. DocBook's <refentry> is modeled on man pages, and there is no specific markup for this purpose in groff (man macros) either, AFAIK. For example, The mmap man page has several "since" annotations that are simply included as follows in the groff source:

.BR MAP_32BIT " (since Linux 2.4.20, 2.6)"

dbdoclet is tool that converts Javadoc to DocBook XML. For a class that has a @since tag in its top-level documentation comment, it outputs markup like this:

<variablelist>
    <varlistentry>
      <term><emphasis>Since</emphasis></term>
      <listitem>
        <para><simplelist type="inline"><member>January 8, 2014</member></simplelist></para>
      </listitem>
    </varlistentry>
</variablelist>

There is nothing "wrong" with this, but it is rather verbose.


I suggest keeping it simple. Just add the "since" information to whatever markup container that seems appropriate. For example:

  • The title of a refsection:

    <refsection>
       <title>TITLE HERE (since release X.Y.Z)</title>
        ...
    </refsection> 
    
  • A paragraph (perhaps with a role attribute):

    <para role="since">Since release X.Y.Z</para>
    

다른 팁

Maybe the tag revhistory with sub tag revision, can be used for it.

Below a small example to capture the idea:

<section  title="Section with history information">
  <revhistory>
    <revision>
      <revnumber>0.9</revnumber>
      <date>1996-12-11</date>
    </revision>
  </revhistory>

  <para>
    <revhistory>
      <revision>
        <revnumber>0.8</revnumber>
        <date>1996-11-11</date>
      </revision>
    </revhistory>
    This paragraph has it's own revision history.
  </para>
</section>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top