1 * MonoDoc XML Tag Reference
6 [This documentation is in progress. Comments to
7 <a href="mailto:jbarn@httcb.net">jbarn@httcb.net</a> and/or
8 <a href="mailto:mono-docs-list@ximian.com">mono-docs-list@ximian.com</a>.]
11 MonoDoc XML, our format for multilingual API documentation stored outside of
12 source files, is very similar to the output of Microsoft's csc /doc. Minor
13 alterations have been made to ease human parsing and hand-editing, but
14 the majority of the tags are identical. In fact, many of the descriptions
15 and examples below are taken from the ECMA C# Language Specification with
16 little or no alteration.
18 This document provides a list of all available MonoDoc XML tags, with
19 syntax and examples. A complete example can be found in
20 <a href="#appendix-a">Appendix A</a>, and both a <a href="#">DTD</a> and
21 <a href="#">XSD schema</a> will be available very shortly.
26 <dt><code><a href="#c"><c></a></code></dt>
27 <dd>Mark short sections of text as code.</dd>
29 <dt><code><code><a href="#code"><code></a></code></dt></code>
30 <dd>Mark one or more lines as code or output.</dd>
32 <dt><code><a href="#doc"><doc></a></dt></code>
33 <dd>Root element of documentation XML.</dd>
35 <dt><code><a href="#event"><event></a></dt></code>
36 <dd>Describe an event.</dd>
38 <dt><code><a href="#example"><example></a></dt></code>
41 <dt><code><a href="#exception"><exception></a></dt></code>
42 <dd>Specify an exception a method can throw.</dd>
44 <dt><code><a href="#field"><field></a></dt></code>
45 <dd>Describe a field.</dd>
47 <dt><code><a href="#list"><list></a></dt></code>
48 <dd>Create a list or table.</dd>
50 <dt><code><a href="#method"><method></a></dt></code>
51 <dd>Describe a method.</dd>
53 <dt><code><a href="#para"><para></a></dt></code>
54 <dd>Allow text to be structured in paragraphs.</dd>
56 <dt><code><a href="#param"><param></a></dt></code>
57 <dd>Specify a parameter for a method.</dd>
59 <dt><code><a href="#paramref"><paramref></a></dt></code>
60 <dd>Mark a word as a parameter.</dd>
62 <dt><code><a href="#permission"><permission></a></dt></code>
63 <dd>Define the access level of a member.</dd>
65 <dt><code><a href="#property"><property></a></dt></code>
66 <dd>Describe a property.</dd>
68 <dt><code><a href="#remarks"><remarks></a></dt></code>
69 <dd>Provide verbose information for a type or member.</dd>
71 <dt><code><a href="#returns"><returns></a></dt></code>
72 <dd>Specify the return value of a method.</dd>
74 <dt><code><a href="#see"><see></a></dt></code>
75 <dd>Specify a link.</dd>
77 <dt><code><a href="#seealso"><seealso></a></dt></code>
78 <dd>Specify a 'see also' entry.</dd>
80 <dt><code><a href="#summary"><summary></a></dt></code>
81 <dd>Provide a brief (usually one sentence) description of a member or type.</dd>
83 <dt><code><a href="#type"><type></a></dt></code>
84 <dd>Describe a type.</dd>
87 ** Definitions and Examples
89 *** <a name="c"><c></a>
91 This tag can be used to mark short, inline fragments of text that should
92 be considered source code or program output. User agents should render
93 this tag in a special -- likely monospace -- font. For larger sections,
94 use <a href="#code"><code><code></code></a>.
99 <c>code or output text</c>
106 Class <c>Point</c> models a point in two-dimensional space.
110 *** <a name="code"><code></a>
112 This tag can be used to mark one or more lines of text as source code or
113 program output. User agents should render this tag in a special (likely
114 monospace) font, and preserve both whitespace and newlines.
118 <code><code>source or program output</code></code>
124 This method changes the point's location by the given
126 <example lang="C#">
129 Point p = new Point(3, 5);
137 *** <a name="doc"><doc></a>
139 This tag is the root element of the documentation file. It can contain
140 any number of <type> elements.
144 <code><doc lang="language" assembly="assembly">typedocs</doc></code>
147 <em>lang="language"</em><br />
148 The two-letter ISO code that specifies what language the contained
149 documentation is written in.
155 <doc lang="en">
156 <type name="Graphics.Point">
162 *** <a name="event"><event></a>
164 This tag documents an event.
168 <code><event name="eventname">documentation</event></code>
171 <em>name="eventname"</em><br />
172 The name of the event being documented.
178 <event name="Click">
180 Occurs when the control is clicked.
183 The event handler receives an argument of type EventArgs
184 containing data related to this event.
187 <para>The ControlStyles.StandardClick style must be set
188 for this event to be raised.</para>
189 <para>For more information about handling events, see
190 Consuming Events.</para>
195 *** <a name="example"><example></a>
197 This tag marks a section of text as an example, and optionally specifies
198 what programming language <code><a href="#code"><code></a></code> portions of the example are written in.
202 <code><example lang="language">example text and code</example></code>
205 <em>lang="language"</em><br />
206 (optional) The name of the programming language <code><a href="#code"><code></a></code> blocks in this example
207 use. This information can be used by user agents to provide
208 intelligent access to examples in multiple languages.
213 See <code><a href="#code"><code><a/></code> for an example.
215 *** <a name="exception"><exception></a>
217 This tag provides a way to specify the exceptions a method can throw.
221 <code><exception cref="exception-type">description</exception></code>
224 <em>cref="exception-type"</em><br />
225 The name of an exception type.
231 <exception cref="System.IO.FileNotFoundException">
232 Thrown when the requested file is not found.
236 *** <a name="field"><field></a>
238 This tag is used to describe a field.
242 <code><field name="fieldname">documentation</field></code>
245 <em>name="fieldname"</em><br />
246 The name of the field being documented.
252 <field name="x">
254 Instance variable <c>x</c> represents the point's
260 *** <a name="list"><list></a>
262 This tag is used to create a list or table of items. It may contain a
263 <code><listheader></code> block to define the heading row of either a table or
264 definition list. (When defining a table, only an entry for 'term' in the
265 heading need be supplied.)
267 Each item in the list is specified with an <code><item></code> block. When creating a
268 definition list, both <code><term></code> and <code><description></code> must be specified.
269 However, for a table, bulleted list, or numbered list, only <code><description></code>
275 <list type="bullet" | "number" | "table">
277 <term>term</term>
278 <description>description</description>
281 <term>term</term>
282 <description>description</description>
292 The term to define, whose definition is in <code><description></code>.
294 <em>description</em><br />
295 Either an item in a bullet or numbered list, or the definition of a <code><term></code>.
301 <list type="bullet">
303 <description>Item 1</description>
306 <description>Item 2</description>
311 *** <a name="method"><method></a>
313 This tag is the overall containing tag for documenting a method.
317 <code><method name="methodname">documentation</method></code>
322 <method name="op_Equality(Graphics.Point,Graphics.Point)">
324 This operator determines whether two points have
327 <param name="p1">
328 <c>p1</c> is the first Point to be compared.
330 <param name="p2">
331 <c>p2</c> is the second Point to be compared.
334 True if the points have the same location and they
335 have the exact same type; otherwise, false.
337 <seealso cref="Equals(System.Object)" />
338 <seealso cref="op_Inequality(Graphics.Point,Graphics.Point)" />
342 *** <a name="para"><para></a>
345 This tag is for use inside other tags such as <code><remarks></code> or <code><returns></code>, and
346 allows text to be structured into paragraphs.
350 <code><para>text</para></code>
357 This is the entry point of the <c>Point</c> class testing
361 This program tests each method and operator, and
362 is intended to be run after any non-trivial maintenance has
363 been performed on the <c>Point</c> class.
368 *** <a name="param"><param></a>
370 This tag is used to describe a parameter for a method, constructor, or
375 <code><param name="name">description</param></code>
379 The name of the parameter.
386 This is the entry point of the <c>Point</c>
389 <param name="xor"><c>xor</c> is the new x-coordinate.</param>
390 <param name "yor"><c>yor</c> is the new y-coordinate.</param>
393 *** <a name="paramref"><paramref></a>
395 This tag is used to indicate that a word is a parameter. User agents
396 could use this information for special formatting or hyperlink insertion.
400 <code><paramref name="name" /></code>
404 The name of the parameter.
411 This constructor initializes the new Point to
412 (<paramref name="xor" />,<paramref name="yor" />).
414 <param name="xor"><c>xor</c> is the new x-coordinate.</param>
415 <param name "yor"><c>yor</c> is the new y-coordinate.</param>
418 *** <a name="permission"><permission></a>
420 This tag allows the security accessibility of a member to be documented.
424 <code><permission cref="member">description</permission></code>
427 <em>cref="member"</em><br />
428 The name of a member.</br>
434 <permission cref="System.Security.PermissionSet">
435 Everyone can access this method.
439 *** <a name="property"><property></a>
441 This tag is the overall containing tag for documenting a property.
445 <code><property name="propertyname">documentation</property></code>
448 <em>name="propertyname"</em><br />
449 The name of the property.
455 <property name="X">
457 Gets or sets the point's x-coordinate.
459 The point's x-coordinate.
465 *** <a name="remarks"><remarks></a>
467 This tag contains extended discussion and information about a member or
468 a type. <em>[jbarn: This differs from both the ECMA docs and
469 portions of Microsoft's documentation, but seems consistent with both
470 common usage, and, more importantly, NDoc convention.]</em>
474 <code><remarks>description</remarks></code>
479 <type name="Graphics.Point">
481 Models a point in a two-dimensional plane.
484 Herein I might have an extended discussion of
485 the validity of Cartesian coordinate systems,
486 with examples pro and con, and perhaps
494 *** <a name="returns"><returns></a>
496 This tag is used to describe the return value of a method.
500 <code><returns>description</returns></code>
505 <method name="op_Inequality(Graphics.Point,Graphics.Point)">
507 This operator determines whether two points have the
510 <param name="p1"><c>p1</c> is the first Point to be compared.</param>
511 <param name="p2"><c>p2</c> is the second Point to be compared.</param>
513 True if the points do not have the same location and they
514 have the exact same type; otherwise, false.
519 *** <a name="see"><see></a>
521 This tag allows a link to be specified within documentation text. (Use
522 <code><seealso></code> to indicate links that should appear in a 'See Also' section.)
526 <code><see cref="destination" /></code>
529 <em>cref="destination"</em><br />
530 A destination, such as a type or a member of a type.
537 This method changes the point's location to the given
538 coordinates. This is an asinine way to insert a link,
539 but <see cref="Equals(Object)" /> to understand
540 how points are compared.
544 *** <a name="seealso"><seealso></a>
546 This tag allows an entry to be generated for the 'See Also' section. (Use
547 <code><see></code> to specify a link from within text.)
551 <code><seealso cref="destination" /></code>
554 <em>cref="destination"</em><br />
555 A destination, such as a type or a member of a type.
562 This method determines whether two Points have the
565 <seealso cref="op_Equality(Graphics.Point,Graphics.Point)" />
566 <seealso cref="op_Inequality(Graphics.Point,Graphics.Point" />
569 *** <a name="summary"><summary></a>
571 This tag contains a short summary of a member or type,
572 often one sentence. <em>[jbarn: This differs from both the ECMA docs and
573 portions of Microsoft's documentation, but seems consistent with both
574 common usage, and, more importantly, NDoc convention.]</em>
578 <code><summary>description</summary></code>
584 This is the entry point of the <c>Point</c> class testing
588 This program tests each method an operator, and is intended
589 to be run after any non-trivial maintenance is performed
590 on the <c>Point</c> class.
594 *** <a name="type"><type></a>
596 This tag is the overall containing tag for documenting a type.
600 <code><type name="typename" assembly="assemblyname">documentation</type></code>
603 <em>name="typename"</em><br />
604 The name of the type being documented.
606 <em>assembly="assemblyname"</em><br />
607 The assembly this type resides in. This attribute is not required for nested types.
613 <type name="Graphics.Point" assembly="Point">
615 Models a point in two-dimensional space.
618 <!-- members -->
620 <field name="x">
622 Represents the point's x-coordinate.
628 ** <a name="appendix-a">Appendix A: Complete Example</a>
630 <em>[jbarn: Please, please, don't take the human-readable portions of
631 this example to be good guidelines for writing your own documentation.
632 this XML is intended only to show structure.]</em>
635 <?xml version="1.0" encoding="UTF-8"?>
636 <doc lang="en">
637 <type name="Graphics.Point" assembly="Point">
639 Models a point in a two-dimensional plane.
645 <!-- fields -->
646 <field name="x">
648 Instance variable <c>x</c> represents the point's x-coordinate.
652 <field name="y">
654 Instance variable <c>y</c> represents the point's y-coordinate.
658 <!-- methods -->
659 <method name="#ctor">
661 Initializes the new point to <c>(0,0)</c>.
665 <method name="#ctor(System.Int32,System.Int32)">
667 Initializes the new Point to (<paramref name="xor" />,<paramref name="yor" />).
669 <param name="xor"><c>xor</c> is the new x-coordinate.</param>
670 <param name="yor"><c>yor</c> is the new y-coordinate.</param>
673 <method name="Move(System.Int32,System.Int32)">
675 This method changes the point's location to the given coordinates.
677 <param name="xor"><c>xor</c> is the new x-coordinate.</param>
678 <param name="yor"><c>yor</c> is the new y-coordinate.</param>
679 <seealso cref="Translate(System.Int32,System.Int32)" />
682 <method name="Translate(System.Int32,System.Int32)">
683 <summary>This method changes the point's location by the given x- and y-offsets.</summary>
685 <example lang="C#">
688 Point p = new Point(3, 5);
691 This code results in <c>p</c> having the value (2,8).
694 <param name="xor"><c>xor</c> is the relative x-offset.</param>
695 <param name="yor"><c>yor</c> is the relative y-offset.</param>
696 <seealso cref="Move(System.Int32,System.Int32)" />
699 <method name="Equals(System.Object)">
700 <summary>This method determines whether two points have the same location.</summary>
701 <param name="o"><c>o</c> is the object to be compared to the current object.</param>
702 <returns>True if the Points have the same location and they have the exact same
703 type; otherwise, false.</returns>
704 <seealso cref="op_Equality(Graphics.Point,Graphics.Point)" />
705 <seealso cref="op_Inequality(Graphics.Point,Graphics.Point" />
708 <method name="ToString">
709 <summary>Report a point's location as a string.</summary>
710 <returns>A string representing a point's location, in the form (x,y), without any
711 leading, trailing, or embedded whitespace.</returns>
714 <method name="op_Equality(Graphics.Point,Graphics.Point)">
715 <summary>This operator determines whether two points have the same location.</summary>
716 <param name="p1"><c>p1</c> is the first Point to be compared.</param>
717 <param name="p2"><c>p2</c> is the second Point to be compared.</param>
718 <returns>True if the points have the same location and they have the exact same
719 type; otherwise, false.</returns>
720 <seealso cref="Equals(System.Object)" />
721 <seealso cref="op_Inequality(Graphics.Point,Graphics.Point)" />
724 <method name="op_Inequality(Graphics.Point,Graphics.Point)">
725 <summary>This operator determines whether two points have the same location.</summary>
726 <param name="p1"><c>p1</c> is the first Point to be compared.</param>
727 <param name="p2"><c>p2</c> is the second Point to be compared.</param>
728 <returns>True if the points do not have the same location and they have the exact same
729 type; otherwise, false.</returns>
730 <seealso cref="Equals(System.Object)" />
731 <seealso cref="op_Equality(Graphics.Point,Graphics.Point)" />
734 <method name="Main">
736 This is the entry point of the Point class testing program.
739 <para>This program tests each method and operator, and is intended to be run after
740 any non-trivial maintenance has been performed on the Point class.</para>
744 <!-- properties -->
745 <property name="X">
746 <value>Property <c>X</c> represents the point's x-coordinate.</value>
749 <property name="Y">
750 <value>Property <c>y</c> represents the point's y-coordinate.</value>