Skip to content
Snippets Groups Projects
Commit 61fe49b3 authored by David Norlin's avatar David Norlin
Browse files

More doc. To be continued ...

Rev: .autodoc_xml:1.4
parent c79dc1e4
No related branches found
No related tags found
No related merge requests found
...@@ -100,10 +100,10 @@ has two member variables, a and b, that are documented as a group: ...@@ -100,10 +100,10 @@ has two member variables, a and b, that are documented as a group:
</module> </module>
</module> </module>
If all the children of a <docgroup> are of the same type, e.g. all are <method> If all the children of a <docgroup> are of the same type, e.g. all are
elements, then the <docgroup> has the attribute homogen-type (="method" in the <method> elements, then the <docgroup> has the attribute homogen-type
example). If all the children have identical name="..." attributes, then the (="method" in the example). If all the children have identical name="..."
<docgroup> gets a homogen-name="..." attribute aswell. attributes, then the <docgroup> gets a homogen-name="..." attribute aswell.
The <docgroup> has a <doc> child containing the docmentation for the other The <docgroup> has a <doc> child containing the docmentation for the other
children of the <docgroup>. An entity that cannot be grouped (class, module, children of the <docgroup>. An entity that cannot be grouped (class, module,
...@@ -115,7 +115,8 @@ d) Pike entities ...@@ -115,7 +115,8 @@ d) Pike entities
Pike entities - classes, modules, methods, variables, constants, &c, have some Pike entities - classes, modules, methods, variables, constants, &c, have some
things in common, and many parts of the xml format are the same for all of things in common, and many parts of the xml format are the same for all of
these entities. All entities are represented with an XML element, namely one of: these entities. All entities are represented with an XML element, namely one
of:
<class> <class>
<constant> <constant>
...@@ -202,7 +203,38 @@ entities: ...@@ -202,7 +203,38 @@ entities:
Only has a name. The element is empty (or has a <source-position> child.) Only has a name. The element is empty (or has a <source-position> child.)
<enum> <enum>
Works as a container ... ??? Works as a container. Has a <doc> child element with the documentation of
the enum itself, and <docgroup> elements with a <constant> for each enum
constant. So:
enum E
//! enum E
{
//! Three constants:
a, b, c,
//! One more:
d
}
becomes:
<enum name="E">
<doc><text><p>enum E</p></text></doc>
<docgroup homogen-type="constant">
<doc><text><p>Three constants:</p></text></doc>
<constant name="a"/>
<constant name="b"/>
<constant name="c"/>
</docgroup>
<docgroup homogen-name="d" homogen-type="constant">
<doc><text><p>One more:</p></text></doc>
<constant name="d"/>
</docgroup>
</enum>
Both the <enum> element and the <constant> elements could have
<source-position> children, of course.
<inherit> <inherit>
The name="..." attribute gives the name after the colon, if any. The name The name="..." attribute gives the name after the colon, if any. The name
...@@ -422,9 +454,9 @@ the document order place as a sibling of the <p> that contain the text: ...@@ -422,9 +454,9 @@ the document order place as a sibling of the <p> that contain the text:
Inside the <p> elements, there may also be some more "layout-ish" tags like Inside the <p> elements, there may also be some more "layout-ish" tags like
<b>, <code>, <tt>, <i>, needed to make the text more readable. Those tags are <b>, <code>, <tt>, <i>, needed to make the text more readable. Those tags are
expressed as @i{ ... @} in the doc markup. However there are no <br>. A paragraph expressed as @i{ ... @} in the doc markup. However there are no <br>. A
break is done by ending the <p> and beginning a new. A </p><p> is inserted for paragraph break is done by ending the <p> and beginning a new. A </p><p> is
each sequence of blank lines in the doc markup: inserted for each sequence of blank lines in the doc markup:
//! First paragraph. //! First paragraph.
//! //!
...@@ -436,6 +468,68 @@ each sequence of blank lines in the doc markup: ...@@ -436,6 +468,68 @@ each sequence of blank lines in the doc markup:
<p>First paragraph.</p><p>Second paragraph.</p> <p>First paragraph.</p><p>Second paragraph.</p>
Note that the text is trimmed from whitespaces in the end and in the beginning. Note that the text is trimmed from leading and ending whitespaces, and there
And there are never any empty <p> elements. are never any empty <p> elements.
In the example above the keyword `@mapping' translated into <mapping>, whereas
the keyword `@member string "zip-code"' translated into:
<member><type><string/></type><index>"zip-code"</index></member>
The translation of keyword->XML is done differently for each keyword. How it
is done can be seen in lib/modules/Tools.pmod/AutoDoc.pmod/DocParser.pmod. Most
keywords just interpret the arguments as a space-separated list, and put their
values in attributes to the element. In some cases (such as @member) though,
some more intricate parsing must be done, and the arguments may be complex
(like Pike types) and are represented as child elements of the element.
======================================================================
g) Top level sections of different Pike entities.
----------------------------------------------------------------------
In every doc comment there is an implicit "top container", and subsections can
be opened in it. E.g.:
//! A method.
//! @param x
//! The horizontal coordinate.
//! @param y
//! The vertical coordinate.
//! @returns
//! Nothing :)
void foo(int x, int y)
becomes:
<docgroup homogen-name="foo" homogen-type="method">
<doc>
<text><p>A method.</p></text>
<group>
<param name="x"/>
<text><p>The horizontal coordinate.</p></text>
</group>
<group>
<param name="y"/>
<text><p>The vertical coordinate.</p></text>
</group>
<group>
<returns/>
<text><p>Nothing :)</p></text>
</group>
</doc>
<method name="foo">
......
</method>
</docgroup>
Which "top container" subsections are allowed depends on what type of entity is
documented:
ALL - <bugs/>
<deprecated> ... </deprecated>
<example/>
<note/>
<seealso/>
<method> - <param name="..."/>
<returns/>
<throws/>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment