table of contents
other versions
other sections
mdoc(5) | File Formats Manual | mdoc(5) |
NAME¶
mdoc - Mono Documentation XML FormatDESCRIPTION¶
The assorted Mono documentation programs generate or manipulate XML files following the mono documentation schema:- mdoc update
- Creates or updates mono documentation XML for a set of assemblies.
- mdoc validate
- Validates the mono documentation XML against the mono documentation XML schema.
- mdoc assemble
- Converts the mono documentation XML within a directory structure into a set of files for use with monodoc(1).
- mdoc export-html
- Converts the mono documentation XML within a directory structure into a set of HTML files that can be viewed with a web browser.
FILE/DIRECTORY STRUCTURE¶
There are three sets of Mono documentation XML files:- *
- index.xml: contains a list of all assemblies within the containing directory, and all types and namespaces within those assemblies.
- *
- ns-*.xml: There is one ns-*.xml file for each
namespace within the assembly; these files are siblings to
index.xml .
- *
- NamespaceName/TypeName.xml: These files are within a
dotted NamespaceName directory, and TypeName is the name of
the type.
index.xml ns-System.xml ns-System.Collections.Generic.xml System/String.xml System.Collections.Generic/List`1.xml
DOCUMENTATION FORMAT¶
index.xml File Format¶
The index.xml file contains a list of the assemblies nested under the directory containing index.xml and all namespaces and types within those assemblies. It looks something like this:<Overview> <Assemblies> <Assembly Name="mscorlib" Version="2.0.0.0" /> <!-- other <Assembly/> elements... --> </Assemblies> <Remarks>To be added.</Remarks> <Copyright>To be added.</Copyright> <Types> <Namespace Name="System"> <Type Name="String" /> <!-- Other <Type/> elements --> </Namespace> <Namespace Name="System.Collections.Generic"> <Type Name="List`1" DisplayName="List<T>" /> <!-- Other <Type/> elements --> </Namespace> <!-- other <Namespace/> elements --> </Types> <Title>DocTest</Title> </Overview>
ns-*.xml File Format¶
The ns-*.xml files contain namespace documentation:<Namespace Name="System"> <Docs> <summary>To be added.</summary> <remarks>To be added.</remarks> </Docs> </Namespace>
NamespaceName/TypeName.xml File Format¶
The mono documentation format is similar to the Ecma documentation format, as described in ECMA-335 3rd Edition, Partition IV, Chapter 7. The principal difference from the ECMA format is that each type gets its own file, within a directory identical to the namespace of the type. There is a lot of information that is maintained automatically by mdoc(1); Most of the information within the documentation should not be edited. This includes the type name ( /Type/@FullName), implemented interfaces ( /Type/Interfaces), member information ( /Type/Members/Member/@MemberName, /Type/Members/Member/MemberSignature, /Type/Members/Member/MemberType, /Type/Members/Member/Parameters, etc.).<Type Name="DocAttribute" FullName="Mono.DocTest.DocAttribute"> <TypeSignature Language="C#" Value="public class DocAttribute : Attribute" /> <AssemblyInfo> <AssemblyName>DocTest</AssemblyName> <AssemblyVersion>0.0.0.0</AssemblyVersion> </AssemblyInfo> <Base> <BaseTypeName>System.Attribute</BaseTypeName> </Base> <Interfaces /> <Attributes> <Attribute> <AttributeName>System.AttributeUsage(System.AttributeTargets.All)</AttributeName> </Attribute> </Attributes> <Docs> <summary>To be added.</summary> <remarks>To be added.</remarks> </Docs> <Members> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="public DocAttribute (string docs);" /> <MemberType>Constructor</MemberType> <AssemblyInfo> <AssemblyVersion>0.0.0.0</AssemblyVersion> </AssemblyInfo> <Parameters> <Parameter Name="docs" Type="System.String" /> </Parameters> <Docs> <param name="docs">To be added.</param> <summary>To be added.</summary> <remarks>To be added.</remarks> </Docs> </Member> </Members> </Type>
Documentation XML Elements¶
The contents of the Docs element is identical in semantics and structure to the inline C# documentation format, consisting of these elements (listed in ECMA-334 3rd Edition, Annex E, Section 2). The following are used within the element descriptions:- CREF
- Refers to a class (or member) reference, and is a string in the format described below in the CREF FORMAT section.
- TEXT
- Non-XML text, and XML should not be nested.
- XML
- Only XML elements should be nested (which indirectly may contain text), but non-whitespace text should not be an immediate child node.
- XML_TEXT
- Free-form text and XML, so that other XML elements may be nested.
- <altmember cref="CREF" />
- <altmember/> is a top-level element, and
should be nested directly under the <Docs/> element.
<altmember cref="P:System.Exception.Message" />
- <block subset="SUBSET" type="TYPE">XML_TEXT</block>
- Create a block of text, similar in concept to a paragraph,
but is used to create divisions within the text. To some extent, a
<block/> is equivalent to the HTML <h2/> tag.
- <c>XML_TEXT</c>
- Set text in a code-like font (similar to the HTML
<tt/> element).
- <code lang="LANGUAGE" src="SOURCE">TEXT</code>
- Display multiple lines of text in a code-like font (similar
to the HTML <pre/> element).
- <example>XML_TEXT</example>
- Indicates an example that should be displayed specially.
For example:
<example> <para>An introductory paragraph.</para> <code lang="C#"> class Example { public static void Main () { System.Console.WriteLine ("Hello, World!"); } } </code> </example>
- <exception cref="CREF">XML_TEXT</exception>
- Identifies an exception that can be thrown by the
documented member.
<exception cref="T:System.ArgumentNullException"> <paramref name="foo" /> was <see langword="null" />. </exception>
- <format type="TYPE">XML_TEXT</format>
- The <format/> element is an "escape
hatch," for including (possibly XML) content that is not valid
mdoc(5) content. It's the moral equivalent of perlpod(1)
=begin format blocks.
<format type="text/html"> <table width="100%"> <tr><td style="color:red">Hello, world!</td></tr> </table> </format>
- <list>XML</list>
- Create a list or table of items. <list/> makes
use of nested <item>XML</item>,
<listheader>XML</listheader>,
<term>XML_TEXT</term>, and
<description>XML_TEXT</description> elements.
<list type="bullet"> <!-- or type="number" --> <item><term>Bullet 1</term></item> <item><term>Bullet 2</term></item> <item><term>Bullet 3</term></item> </list>
<list type="table"> <listheader> <!-- listheader bolds this row --> <term>Column 1</term> <description>Column 2</description> <description>Column 3</description> </listheader> <item> <term>Item 1-A</term> <description>Item 1-B</description> <description>Item 1-C</description> </item> <item> <term>Item 2-A</term> <description>Item 2-B</description> <description>Item 2-C</description> </item> </list>
- <para>XML_TEXT</para>
- Insert a paragraph of XML_TEXT. For example,
<para> This is a paragraph of text. </para>
- <param name="NAME">XML_TEXT</param>
- <param/> is a top-level element, and should be
nested directly under the <Docs/> element.
<param name="count"> A <see cref="T:System.Int32" /> containing the number of widgets to process. </param>
- <paramref name="NAME" />
- Indicates that NAME is a parameter.
- <permission cref="CREF">XML_TEXT</permission>
- Documents the security accessibility requirements of the
current member.
<permission cref="T:System.Security.Permissions.FileIOPermission"> Requires permission for reading and writing files. See <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Read" />, <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Write" />. </permission>
- <remarks>XML_TEXT</remarks>
- Contains detailed information about a member.
<remarks> Insert detailed information here. </remarks>
- <returns>XML_TEXT</returns>
-
<returns> A <see cref="T:System.Boolean" /> specifying whether or not the process can access <see cref="P:Mono.Unix.UnixFileSystemInfo.FullName" />. </returns>
- <see cref="CREF" />, <see langword="LANGWORD" />
- Creates a link to the specified member within the current
text:
<see cref="M:Some.Namespace.With.Type.Method" />
<see langword="null" />
- <seealso cref="CREF" />
- Do not use seealso, use altmember.
- <since version="VERSION" />
-
<since version="Gtk# 2.4" />
- <summary>XML_TEXT</summary>
-
- <typeparam name="NAME">XML_TEXT</typeparam>
- <typeparam/> is a top-level element, and
should be nested directly under the <Docs/> element.
<typeparam name="T"> The type of the underlying collection </typeparam>
- <typeparamref name="NAME">
- Used to indicate that NAME is a type parameter.
- <value>XML_TEXT</value>
- <value/> is a top-level element, and should be
nested directly under the <Docs/> element.
<value> A <see cref="T:System.String" /> containing a widget name. </value>
CREF FORMAT¶
String IDs ( CREFs) are used to refer to a type or member of a type. String IDs are documented in ECMA-334 3rd Edition, Annex E.3.1. They consist of a member type prefix, the full type name (namespace + name, separated by .), possibly followed by the member name and other information. Member type prefixes:- C:
- The CREF refers to a constructor. The (optional) parameter list is enclosed in parenthesis and follows the type name: C:System.String(System.Char,System.Int32).
- E:
- The CREF refers to an event. The event name follows the type name: E:System.AppDomain.AssemblyLoad.
- F:
- The CREF refers to a field. The field name follows the type name: F:System.Runtime.InteropServices.DllImportAttribute.SetLastError.
- M:
- Refers to a constructor or method. Constructors may append
.ctor to the type name (instead of using the above C:
constructor format), while methods append the method name and an
(optional) count of the number of generic parameters. Both constructors
and methods may append the method parameter list enclosed in parenthesis.
- N:
- Refers to a namespace, e.g. N:System.
- P:
- Refers to a property. If the property is an indexer or takes parameters, the parameter types are appended to the property name and enclosed with paranthesis: P:System.String.Length, P:System.String.Chars(System.Int32).
- T:
- The CREF refers to a type, with the number of generic types appended: T:System.String, T:System.Collections.Generic.List`1, T:System.Collections.Generic.List`1.Enumerator.
- *
- T:System.Collections.Generic.List`1
- *
- T:System.Collections.Generic.Dictionary`2
- *
- T:System.Collections.Generic.List{System.Int32}
- *
- T:System.Collections.Generic.List<System.Int32>
- *
- T:System.Collections.Generic.List<System.Int32>
- *
- T:System.Predicate{System.Action{System.String}}
class FooType { public static void Foo<T> (System.Predicate<T> predicate) { } }
SEE ALSO¶
mdoc(1), monodocer(1)MAILING LISTS¶
- Visit http://lists.ximian.com/mailman/listinfo/mono-docs-list for details.