mdoc.5 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794
  1. .\"
  2. .\" mdoc(5) manual page.
  3. .\" (C) 2008 Jonathan Pryor
  4. .\" Author:
  5. .\" Jonathan Pryor ([email protected])
  6. .\"
  7. .de Sp \" Vertical space (when we can't use .PP)
  8. .if t .sp .5v
  9. .if n .sp
  10. ..
  11. .TH "mdoc" 5
  12. .SH NAME
  13. mdoc \- Mono Documentation XML Format
  14. .SH DESCRIPTION
  15. The assorted Mono documentation programs generate or manipulate XML files
  16. following the mono documentation schema:
  17. .TP
  18. .I mdoc update
  19. Creates or updates mono documentation XML for a set of assemblies.
  20. .TP
  21. .I mdoc validate
  22. Validates the mono documentation XML against the mono documentation XML
  23. schema.
  24. .TP
  25. .I mdoc assemble
  26. Converts the mono documentation XML within a directory structure into a set
  27. of files for use with \fBmonodoc\fR(1).
  28. .TP
  29. .I mdoc export-html
  30. Converts the mono documentation XML within a directory structure into a set
  31. of HTML files that can be viewed with a web browser.
  32. .PP
  33. All of these tools (and more) use the common XML schema described in this man
  34. page.
  35. .SH FILE/DIRECTORY STRUCTURE
  36. There are three sets of Mono documentation XML files:
  37. .TP
  38. .B *
  39. .B index.xml:
  40. contains a list of all assemblies within the containing directory, and all
  41. types and namespaces within those assemblies.
  42. .TP
  43. .B *
  44. .B ns\-*.xml:
  45. There is one ns-*.xml file for each namespace within the assembly; these
  46. files are siblings to
  47. .I index.xml
  48. \&.
  49. .Sp
  50. Examples of
  51. .I ns\-*.xml
  52. files include: \fIns-System.xml\fR, \fIns-System.Collections.xml\fR, and
  53. \fIns-.xml\fR (for the root namespace, though it is recommended to NOT place
  54. types into the root namespace, as \fBmonodoc\fR(1) doesn't display them).
  55. .Sp
  56. The
  57. .I ns\-*.xml
  58. files contain per-namespace documentation.
  59. .TP
  60. .B *
  61. .B NamespaceName/TypeName.xml:
  62. These files are within a dotted
  63. .I NamespaceName
  64. directory, and
  65. .I TypeName
  66. is the name of the type.
  67. .Sp
  68. Examples include:
  69. .I RootType.xml
  70. (if the type has no namespace),
  71. \fISystem/String.xml\fR,
  72. \fISystem.Collections/IEnumerable.xml\fR, and
  73. \fISystem.Collections.Generic/List`1+Enumerator.xml\fR
  74. (the
  75. .I `1
  76. is the number of generic type parameters the type accepts, and everything
  77. after the
  78. .I +
  79. is a nested type).
  80. .PP
  81. Thus, typical directory contents would resemble:
  82. .nf
  83. index.xml
  84. ns-System.xml
  85. ns-System.Collections.Generic.xml
  86. System/String.xml
  87. System.Collections.Generic/List`1.xml
  88. .fi
  89. .SH DOCUMENTATION FORMAT
  90. .SS "\fBindex.xml File Format\fR"
  91. .PP
  92. The
  93. .I index.xml
  94. file contains a list of the assemblies nested under the directory containing
  95. .I index.xml
  96. and all namespaces and types within those assemblies. It looks something like
  97. this:
  98. .nf
  99. <Overview>
  100. <Assemblies>
  101. <Assembly Name="mscorlib" Version="2.0.0.0" />
  102. <!-- other <Assembly/> elements... -->
  103. </Assemblies>
  104. <Remarks>To be added.</Remarks>
  105. <Copyright>To be added.</Copyright>
  106. <Types>
  107. <Namespace Name="System">
  108. <Type Name="String" />
  109. <!-- Other <Type/> elements -->
  110. </Namespace>
  111. <Namespace Name="System.Collections.Generic">
  112. <Type Name="List`1" DisplayName="List&lt;T&gt;" />
  113. <!-- Other <Type/> elements -->
  114. </Namespace>
  115. <!-- other <Namespace/> elements -->
  116. </Types>
  117. <Title>DocTest</Title>
  118. </Overview>
  119. .fi
  120. Most of this is maintained automatically, in particular the
  121. .I /Overview/Assemblies
  122. and
  123. .I /Overview/Types
  124. elements.
  125. .PP
  126. The
  127. .I //Namespace/@Name
  128. attribute corresponds to a directory which contains files named
  129. \fI//Type/@Name\fR.xml, while the \fI//Type/@DisplayName\fR attribute contains
  130. a C# type name (if \fI//Type/@DisplayName\fR isn't found, then
  131. \fI//Type/@Name\fR is used as the display name). There should also be a
  132. \fIns-[//Namespace/@Name].xml\fR file.
  133. .PP
  134. There are three elements of interest to authors:
  135. \fI/Overview/Remarks\fR, \fI/Overview/Copyright\fR, and
  136. \fI/Overview/Title\fR, which contain assembly-level documentation.
  137. These elements can contain any of the following XML elements (documented in
  138. the \fBDocumentation XML Elements\fR section):
  139. \fIblock\fR,
  140. \fIcode\fR,
  141. \fIexample\fR,
  142. \fIlist\fR,
  143. \fIpara\fR,
  144. \fIparamref\fR,
  145. \fItypeparamref\fR,
  146. \fIsee\fR, and
  147. \fIul\fR.
  148. .SS "\fBns-*.xml File Format\fR"
  149. The \fIns-*.xml\fR files contain namespace documentation:
  150. .nf
  151. <Namespace Name="System">
  152. <Docs>
  153. <summary>To be added.</summary>
  154. <remarks>To be added.</remarks>
  155. </Docs>
  156. </Namespace>
  157. .fi
  158. The \fI/Namespace/Docs/summary\fR and \fI/Namespace/Docs/remarks\fR elements
  159. should contain namespace documentation.
  160. .PP
  161. The \fIremarks\fR and \fIsummary\fR elements are documented in the
  162. \fBDocumentation XML Elements\fR section.
  163. .SS "\fBNamespaceName/TypeName.xml File Format\fR"
  164. The
  165. .I mono documentation format
  166. is similar to the Ecma documentation format, as described
  167. in ECMA-335 3rd Edition, Partition IV, Chapter 7.
  168. The principal difference from the ECMA format is that each type gets its own
  169. file, within a directory identical to the namespace of the type. There is a
  170. lot of information that is maintained automatically by \fBmdoc\fR(1);
  171. Most of the information within the documentation should
  172. .I not
  173. be edited. This includes the type name (\fI/Type/@FullName\fR), implemented
  174. interfaces (\fI/Type/Interfaces\fR), member information
  175. (\fI/Type/Members/Member/@MemberName\fR,
  176. \fI/Type/Members/Member/MemberSignature\fR,
  177. \fI/Type/Members/Member/MemberType\fR,
  178. \fI/Type/Members/Member/Parameters\fR, etc.).
  179. .nf
  180. <Type Name="DocAttribute" FullName="Mono.DocTest.DocAttribute">
  181. <TypeSignature Language="C#" Value="public class DocAttribute : Attribute" />
  182. <AssemblyInfo>
  183. <AssemblyName>DocTest</AssemblyName>
  184. <AssemblyVersion>0.0.0.0</AssemblyVersion>
  185. </AssemblyInfo>
  186. <Base>
  187. <BaseTypeName>System.Attribute</BaseTypeName>
  188. </Base>
  189. <Interfaces />
  190. <Attributes>
  191. <Attribute>
  192. <AttributeName>System.AttributeUsage(System.AttributeTargets.All)</AttributeName>
  193. </Attribute>
  194. </Attributes>
  195. <Docs>
  196. <summary>To be added.</summary>
  197. <remarks>To be added.</remarks>
  198. </Docs>
  199. <Members>
  200. <Member MemberName=".ctor">
  201. <MemberSignature Language="C#" Value="public DocAttribute (string docs);" />
  202. <MemberType>Constructor</MemberType>
  203. <AssemblyInfo>
  204. <AssemblyVersion>0.0.0.0</AssemblyVersion>
  205. </AssemblyInfo>
  206. <Parameters>
  207. <Parameter Name="docs" Type="System.String" />
  208. </Parameters>
  209. <Docs>
  210. <param name="docs">To be added.</param>
  211. <summary>To be added.</summary>
  212. <remarks>To be added.</remarks>
  213. </Docs>
  214. </Member>
  215. </Members>
  216. </Type>
  217. .fi
  218. The only elements that normally need to be edited are children of the
  219. \fI//Docs\fR elements, which usually contain the text
  220. .I To be added.
  221. The \fI/Type/Docs\fR element contains type-level documentation, while the
  222. \fI/Type/Members/Member/Docs\fR element contains per-member documentation.
  223. .PP
  224. The \fI//Docs\fR elements can contain the following elements:
  225. \fIaltcompliant\fR,
  226. \fIaltmember\fR,
  227. \fIexample\fR,
  228. \fIexception\fR,
  229. \fIparam\fR,
  230. \fIpermission\fR,
  231. \fIremarks\fR,
  232. \fIreturns\fR,
  233. \fIsince\fR,
  234. \fIsummary\fR,
  235. \fIthreadsafe\fR,
  236. \fItypeparam\fR, and
  237. \fIvalue\fR.
  238. .PP
  239. Nested types are not members; they are types, and are documented in their own
  240. file. Consequently, the \fINamespaceName/TypeName.xml\fR files are not
  241. recursive; you do not store a \fI<Type/>\fR element within a \fI<Type/>\fR
  242. element.
  243. .SS "\fBDocumentation XML Elements\fR"
  244. The contents of the \fIDocs\fR element is \fIidentical\fR
  245. in semantics and structure to the inline C# documentation format, consisting
  246. of these elements (listed in ECMA-334 3rd Edition, Annex E, Section 2). The
  247. following are used within the element descriptions:
  248. .TP
  249. .I CREF
  250. Refers to a class (or member) reference, and is a string in the format
  251. described below in the \fBCREF FORMAT\fR section.
  252. .TP
  253. .I TEXT
  254. Non-XML text, and XML should not be nested.
  255. .I
  256. .TP
  257. .I XML
  258. Only XML elements should be nested (which indirectly may contain text), but
  259. non-whitespace text should not be an immediate child node.
  260. .TP
  261. .I XML_TEXT
  262. Free-form text and XML, so that other XML elements may be nested.
  263. .PP
  264. The following elements are used in documentation:
  265. .TP
  266. .I <altmember cref="CREF" />
  267. .I <altmember/>
  268. is a top-level element, and should be nested directly under the
  269. .I <Docs/>
  270. element.
  271. .Sp
  272. Allows an entry to be generated for the \fISee Also\fR section. Use
  273. \fI<see/>\fR to specify a link from within text.
  274. .nf
  275. <altmember cref="P:System.Exception.Message" />
  276. .fi
  277. .TP
  278. .I <block subset="SUBSET" type="TYPE">XML_TEXT</block>
  279. Create a block of text, similar in concept to a paragraph, but is used to
  280. create divisions within the text. To some extent, a <block/> is equivalent to
  281. the HTML <h2/> tag.
  282. .Sp
  283. .I SUBSET
  284. should always be the value \fI"none"\fR.
  285. .Sp
  286. .I TYPE
  287. specifies the heading and formatting to use. Recognized types are:
  288. .Sp
  289. .I behaviors
  290. Creates a section with the heading \fIOperation\fR.
  291. .Sp
  292. .I note
  293. Creates a section with the heading \fINote:\fR.
  294. .Sp
  295. .I overrides
  296. Creates a section with the heading \fINote to Inheritors\fR.
  297. .Sp
  298. .I usage
  299. Creates a section with the heading \fIUsage\fR.
  300. .Sp
  301. The \fIblock\fR element can contain the following elements:
  302. \fIblock\fR,
  303. \fIc\fR,
  304. \fIcode\fR,
  305. \fIlist\fR,
  306. \fIpara\fR,
  307. \fIparamref\fR,
  308. \fIsee\fR,
  309. \fIsubscript\fR,
  310. \fIsup\fR, and
  311. \fItypeparamref\fR.
  312. .TP
  313. .I <c>XML_TEXT</c>
  314. Set text in a code-like font (similar to the HTML <tt/> element).
  315. .Sp
  316. The \fIc\fR element can contain the following elements:
  317. \fIcode\fR,
  318. \fIpara\fR,
  319. \fIparamref\fR,
  320. \fIsee\fR, and
  321. \fItypeparamref\fR.
  322. .TP
  323. .I <code lang="LANGUAGE">TEXT</code>
  324. Display multiple lines of text in a code-like font (similar to the HTML <pre/>
  325. element).
  326. .I LANGUAGE
  327. is the language this code block is for. For example, if \fILANGUAGE\fR is
  328. \fBC#\fR, then \fITEXT\fR will get syntax highlighting for the C# language
  329. within the Mono Documentation Browser.
  330. .TP
  331. .I <example>XML_TEXT</example>
  332. Indicates an example that should be displayed specially. For example:
  333. .nf
  334. <example>
  335. <para>An introductory paragraph.</para>
  336. <code lang="C#">
  337. class Example {
  338. public static void Main ()
  339. {
  340. System.Console.WriteLine ("Hello, World!");
  341. }
  342. }
  343. </code>
  344. </example>
  345. .fi
  346. The \fIexample\fR element can contain the following elements:
  347. \fIc\fR,
  348. \fIcode\fR,
  349. \fIlist\fR,
  350. \fIpara\fR, and
  351. \fIsee\fR.
  352. .TP
  353. .I <exception cref="CREF">XML_TEXT</exception>
  354. Identifies an exception that can be thrown by the documented member.
  355. .Sp
  356. .I <exception/>
  357. is a top-level element, and should be nested directly under the
  358. .I <Docs/>
  359. element.
  360. .Sp
  361. .I CREF
  362. is the exception type that is thrown, while
  363. .I XML_TEXT
  364. contains the circumstances that would cause
  365. .I CREF
  366. to be thrown.
  367. .nf
  368. <exception cref="T:System.ArgumentNullException">
  369. <paramref name="foo" /> was <see langword="null" />.
  370. </exception>
  371. .fi
  372. The \fIexception\fR element can contain the following elements:
  373. \fIblock\fR,
  374. \fIpara\fR,
  375. \fIparamref\fR,
  376. \fIsee\fR, and
  377. \fItypeparamref\fR.
  378. .TP
  379. .I <list>XML</list>
  380. Create a list or table of items.
  381. .I <list/>
  382. makes use of nested \fI<item>XML</item>\fR, \fI<listheader>XML</listheader>\fR,
  383. \fI<term>XML_TEXT</term>\fR, and \fI<description>XML_TEXT</description>\fR
  384. elements.
  385. .Sp
  386. \fILists\fR have the syntax:
  387. .nf
  388. <list type="bullet"> <!-- or type="number" -->
  389. <item><term>Bullet 1</term></item>
  390. <item><term>Bullet 2</term></item>
  391. <item><term>Bullet 3</term></item>
  392. </list>
  393. .fi
  394. .Sp
  395. .I Tables
  396. have the syntax:
  397. .nf
  398. <list type="table">
  399. <listheader> <!-- listheader bolds this row -->
  400. <term>Column 1</term>
  401. <description>Column 2</description>
  402. <description>Column 3</description>
  403. </listheader>
  404. <item>
  405. <term>Item 1-A</term>
  406. <description>Item 1-B</description>
  407. <description>Item 1-C</description>
  408. </item>
  409. <item>
  410. <term>Item 2-A</term>
  411. <description>Item 2-B</description>
  412. <description>Item 2-C</description>
  413. </item>
  414. </list>
  415. .fi
  416. The \fIitem\fR and \fIdescription\fR elements can each contain text and
  417. the following elements:
  418. \fIblock\fR,
  419. \fIc\fR,
  420. \fIpara\fR,
  421. \fIparamref\fR,
  422. \fIsee\fR,
  423. \fIsup\fR, and
  424. \fItypeparamref\fR.
  425. .TP
  426. .I <para>XML_TEXT</para>
  427. Insert a paragraph of \fIXML_TEXT\fR.
  428. For example,
  429. .nf
  430. <para>
  431. This is a paragraph of text.
  432. </para>
  433. .fi
  434. The \fIpara\fR element can contain the following elements:
  435. \fIblock\fR,
  436. \fIc\fR,
  437. \fIexample\fR,
  438. \fIlink\fR,
  439. \fIlist\fR,
  440. \fIonequarter\fR,
  441. \fIparamref\fR,
  442. \fIsee\fR,
  443. \fIsub\fR,
  444. \fIsup\fR,
  445. \fItypeparamref\fR, and
  446. \fIul\fR.
  447. .TP
  448. .I <param name="NAME">XML_TEXT</param>
  449. .I <param/>
  450. is a top-level element, and should be nested directly under the
  451. .I <Docs/>
  452. element.
  453. .Sp
  454. Describes the parameter \fINAME\fR of the current constructor, method, or
  455. property:
  456. .nf
  457. <param name="count">
  458. A <see cref="T:System.Int32" /> containing the number
  459. of widgets to process.
  460. </param>
  461. .fi
  462. The \fIparam\fR element can contain the following elements:
  463. \fIblock\fR,
  464. \fIc\fR,
  465. \fIexample\fR,
  466. \fIpara\fR,
  467. \fIparamref\fR,
  468. \fIsee\fR, and
  469. \fItypeparamref\fR.
  470. .TP
  471. .I <paramref name="NAME" />
  472. Indicates that \fINAME\fR is a parameter.
  473. .Sp
  474. This usually renders \fINAME\fR as italic text, so it is frequently
  475. (ab)used as an equivalent to the HTML <i/> element. See the
  476. \fI<exception/>\fR documentation (above) for an example.
  477. .Sp
  478. .TP
  479. .I <permission cref="CREF">XML_TEXT</permission>
  480. Documents the security accessibility requirements of the current member.
  481. .Sp
  482. .I <permission/>
  483. is a top-level element, and should be nested directly under the
  484. .I <Docs/>
  485. element.
  486. .Sp
  487. \fICREF\fR is a type reference to the security permission required, while
  488. \fIXML_TEXT\fR is a description of why the permission is required.
  489. .nf
  490. <permission cref="T:System.Security.Permissions.FileIOPermission">
  491. Requires permission for reading and writing files. See
  492. <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Read" />,
  493. <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Write" />.
  494. </permission>
  495. .fi
  496. The \fIpermission\fR element can contain the following elements:
  497. \fIblock\fR,
  498. \fIpara\fR,
  499. \fIparamref\fR,
  500. \fIsee\fR, and
  501. \fItypeparamref\fR.
  502. .TP
  503. .I <remarks>XML_TEXT</remarks>
  504. Contains detailed information about a member.
  505. .Sp
  506. .I <remarks/>
  507. is a top-level element, and should be nested directly under the
  508. .I <Docs/>
  509. element.
  510. .nf
  511. <remarks>
  512. Insert detailed information here.
  513. </remarks>
  514. .fi
  515. The \fIremarks\fR element can contain the following elements:
  516. \fIblock\fR,
  517. \fIc\fR,
  518. \fIcode\fR,
  519. \fIexample\fR,
  520. \fIlist\fR,
  521. \fIpara\fR,
  522. \fIparamref\fR,
  523. \fIsee\fR, and
  524. \fItypeparamref\fR.
  525. .TP
  526. .I <returns>XML_TEXT</returns>
  527. .Sp
  528. .I <returns/>
  529. is a top-level element, and should be nested directly under the
  530. .I <Docs/>
  531. element.
  532. .Sp
  533. Describes the return value of a method:
  534. .nf
  535. <returns>
  536. A <see cref="T:System.Boolean" /> specifying whether
  537. or not the process can access
  538. <see cref="P:Mono.Unix.UnixFileSystemInfo.FullName" />.
  539. </returns>
  540. .fi
  541. The \fIreturns\fR element can contain the following elements:
  542. \fIlist\fR,
  543. \fIpara\fR,
  544. \fIparamref\fR,
  545. \fIsee\fR, and
  546. \fItypeparamref\fR.
  547. .TP
  548. \fI<see cref="CREF" />\fR, \fI<see langword="LANGWORD" />\fR
  549. Creates a link to the specified member within the current text:
  550. .nf
  551. <see cref="M:Some.Namespace.With.Type.Method" />
  552. .fi
  553. or specifies that \fILANGWORD\fR is a language keyword:
  554. .nf
  555. <see langword="null" />
  556. .fi
  557. .TP
  558. .I <seealso cref="CREF" />
  559. Do not use \fIseealso\fR, use \fIaltmember\fR.
  560. .TP
  561. .I <since version="VERSION" />
  562. .Sp
  563. .I <since/>
  564. is a top-level element, and should be nested directly under the
  565. \fI<Docs/>\fR element.
  566. .Sp
  567. Permits specification of which version introduced the specified type or
  568. member.
  569. .nf
  570. <since version="Gtk# 2.4" />
  571. .fi
  572. This generally isn't required, as the \fI//AssemblyInfo/AssemblyVersion\fR
  573. elements track which assembly versions contain type or member.
  574. .TP
  575. .I <summary>XML_TEXT</summary>
  576. .Sp
  577. .I <summary/>
  578. is a top-level element, and should be nested directly under the
  579. .I <Docs/>
  580. element.
  581. .Sp
  582. Provides a (brief!) overview about a type or type member.
  583. .Sp
  584. This is usually displayed as part of a class declaration, and should be a
  585. reasonably short description of the type/member. Use
  586. .I <remarks/>
  587. for more detailed information.
  588. .Sp
  589. The \fIsummary\fR element can contain the following elements:
  590. \fIblock\fR,
  591. \fIlist\fR,
  592. \fIpara\fR,
  593. \fIparamref\fR,
  594. \fIsee\fR, and
  595. \fItypeparamref\fR.
  596. .TP
  597. .I <typeparam name="NAME">XML_TEXT</typeparam>
  598. .I <typeparam/>
  599. is a top-level element, and should be nested directly under the
  600. .I <Docs/>
  601. element.
  602. .Sp
  603. This is used to document a type parameter for a generic type or generic method.
  604. .Sp
  605. .I NAME
  606. is the name of the type parameter, while
  607. .I XML_TEXT
  608. contains a description of the parameter (what it's used for, what restrictions
  609. it must meet, etc.).
  610. .nf
  611. <typeparam name="T">
  612. The type of the underlying collection
  613. </typeparam>
  614. .fi
  615. The \fItypeparam\fR element can contain the following elements:
  616. \fIblock\fR,
  617. \fIc\fR,
  618. \fIpara\fR,
  619. \fIparamref\fR,
  620. \fIsee\fR, and
  621. \fItypeparamref\fR.
  622. .TP
  623. .I <typeparamref name="NAME">
  624. Used to indicate that \fINAME\fR is a type parameter.
  625. .TP
  626. .I <value>XML_TEXT</value>
  627. .I <value/>
  628. is a top-level element, and should be nested directly under the
  629. .I <Docs/>
  630. element.
  631. .Sp
  632. Allows a property to be described.
  633. .nf
  634. <value>
  635. A <see cref="T:System.String" /> containing a widget name.
  636. </value>
  637. .fi
  638. The \fIvalue\fR element can contain the following elements:
  639. \fIblock\fR,
  640. \fIc\fR,
  641. \fIexample\fR,
  642. \fIlist\fR,
  643. \fIpara\fR,
  644. \fIparamref\fR,
  645. \fIsee\fR, and
  646. \fItypeparamref\fR.
  647. .PP
  648. .SH CREF FORMAT
  649. String IDs (\fICREF\fRs) are used to refer to a type or member of a type.
  650. String IDs are documented in ECMA-334 3rd Edition, Annex E.3.1. They consist
  651. of a \fImember type prefix\fR, the full type name (namespace + name, separated
  652. by \fI.\fR), possibly followed by the member name and other information.
  653. .PP
  654. Member type prefixes:
  655. .TP
  656. .I "C:"
  657. The CREF refers to a constructor. The (optional) parameter list is
  658. enclosed in parenthesis and follows the type name:
  659. \fIC:System.String(System.Char,System.Int32)\fR.
  660. .TP
  661. .I "E:"
  662. The CREF refers to an event. The event name follows the type name:
  663. \fIE:System.AppDomain.AssemblyLoad\fR.
  664. .TP
  665. .I "F:"
  666. The CREF refers to a field. The field name follows the type name:
  667. \fIF:System.Runtime.InteropServices.DllImportAttribute.SetLastError\fR.
  668. .TP
  669. .I "M:"
  670. Refers to a constructor or method. Constructors may append
  671. .I .ctor
  672. to the type name (instead of using the above
  673. .I C:
  674. constructor format), while methods append the method name and an (optional)
  675. count of the number of generic parameters. Both constructors and methods
  676. may append the method parameter list enclosed in parenthesis.
  677. .Sp
  678. Examples:
  679. \fIM:System.Object..ctor\fR,
  680. \fIM:System.String..ctor(System.Char[])\fR,
  681. \fIM:System.String.Concat(System.Object)\fR,
  682. \fIM:System.Array.Sort``1(``0[])\fR,
  683. \fIM:System.Collections.Generic.List`1..ctor\fR,
  684. \fIM:System.Collections.Generic.List`1.Add(`0)\fR.
  685. .TP
  686. .I "N:"
  687. Refers to a namespace, e.g. \fIN:System\fR.
  688. .TP
  689. .I "P:"
  690. Refers to a property. If the property is an indexer or takes parameters,
  691. the parameter types are appended to the property name and enclosed with
  692. paranthesis:
  693. \fIP:System.String.Length\fR,
  694. \fIP:System.String.Chars(System.Int32)\fR.
  695. .TP
  696. .I "T:"
  697. The CREF refers to a type, with the number of generic types appended:
  698. \fIT:System.String\fR,
  699. \fIT:System.Collections.Generic.List`1\fR,
  700. \fIT:System.Collections.Generic.List`1.Enumerator\fR.
  701. .PP
  702. To make matters more interesting, generic types & members have two
  703. representations: the "unbound" representation (shown in examples above), in
  704. which class names have the count of generic parameters appended to their name.
  705. There is also a "bound" representation, in which the binding of generic
  706. parameters is listed within '{' and '}' or '<' and '>'.
  707. (Use of '<' and '>' is less common, as within an XML document their escaped
  708. character entities must instead be used, leading to '&lt;' and '&gt;'.)
  709. .PP
  710. .B Unbound:
  711. .TP
  712. .B *
  713. .I T:System.Collections.Generic.List`1
  714. .TP
  715. .B *
  716. .I T:System.Collections.Generic.Dictionary`2
  717. .PP
  718. .B Bound:
  719. .TP
  720. .B *
  721. .I T:System.Collections.Generic.List{System.Int32}
  722. .TP
  723. .B *
  724. .I T:System.Collections.Generic.List<System.Int32>
  725. .TP
  726. .B *
  727. .I T:System.Collections.Generic.List&lt;System.Int32&gt;
  728. .TP
  729. .B *
  730. .I T:System.Predicate{System.Action{System.String}}
  731. .PP
  732. As you can see, bound variants can be arbitrarily complex (just like
  733. generics).
  734. .PP
  735. Furthermore, if a generic parameter is bound to the generic parameter of a
  736. type or method, the "index" of the type/method's generic parameter is used
  737. as the binding, so given
  738. .nf
  739. class FooType {
  740. public static void Foo<T> (System.Predicate<T> predicate)
  741. {
  742. }
  743. }
  744. .fi
  745. The CREF for this method is
  746. \fIM:FooType.Foo``1(System.Predicate{``0})\fR,
  747. .I ``0
  748. is the 0th generic parameter index which is bound to
  749. \fISystem.Predicate<T>\fR.
  750. .SH SEE ALSO
  751. mdoc(1), monodocer(1)
  752. .SH MAILING LISTS
  753. .TP
  754. Visit http://lists.ximian.com/mailman/listinfo/mono-docs-list for details.
  755. .SH WEB SITE
  756. Visit http://www.mono-project.com for details