documentation 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. * Documentation
  2. Although most of the concepts from Microsoft.NET can
  3. be applied to the completed Mono platform, we do need to
  4. have a complete set of free documentation written specifically
  5. for Mono.
  6. The documentation license we have chosen is the GNU Free
  7. Documentation License (FDL), the standard for most documents
  8. in the free software world.
  9. We need documentation on a number of topics:
  10. <ul>
  11. * The development tools (compilers, assembler tools,
  12. language reference, design time features): these
  13. live in the `monodoc' CVS module.
  14. * Frequently Asked Question compilations.
  15. * HOWTO documents.
  16. * The Class Libraries (Both the original .NET class
  17. libraries as well as the class libraries produced by
  18. the project).
  19. * Tutorials on Mono and the specifics of running it.
  20. * A guide to Mono as compared to the Microsoft.NET
  21. Framework SDK
  22. </ul>
  23. * Class Library documentation
  24. We are moving to a new setup for documenting the class libraries,
  25. and you can read about it <a href="classlib-doc.html">here</a>.
  26. There are two classes of documentation: free documentation for
  27. existing .NET classes and documentation for the classes that
  28. we have developed on top of .NET.
  29. There is a large body of documentation that came from the ECMA
  30. standarization effort that has been checked into CVS. It does
  31. not contain everything Mono and .NET have, so they need to be
  32. updated and augmented.
  33. ** Gtk# documentation
  34. We also have a large body of class libraries that are specific
  35. to Mono, for example the documentation for Gtk#.
  36. We have checked in stub documentation for Gtk# into the CVS
  37. repository (on gtk-sharp/doc) and we need volunteers to help
  38. populate the documentation for it. Since Gtk# is a wrapper
  39. for Gtk, plenty of documentation exists in the <a
  40. href="http://developer.gnome.org/doc/API">Gnome developer
  41. site</a>.
  42. To get started:
  43. You need to download Gtk# from the CVS repository. The module
  44. name is `gtk-sharp'. You can obtain a copy from both the CVS
  45. repository or the anonymous CVS repository.
  46. To pull your copy type:
  47. <pre>
  48. cvs co gtk-sharp
  49. </pre>
  50. Documentation lives in gtk-sharp/doc/en. The "en" indicates the
  51. English language, the first one we are targeting. We can later
  52. do translations, but for now we are focusing on a single
  53. language.
  54. In that directory you will find the documentation organized by
  55. namespaces. One directory per namespace. In the directories
  56. you will find one XML file per class that needs to be
  57. documented. The mission is to fill in the data with useful
  58. information. Feel free to grab liberally information from the
  59. Gtk documentation from:
  60. <a href="http://developer.gnome.org/doc/API/">http://developer.gnome.org/doc/API/</a>
  61. Of course, the API does not apply directly. It only applies at
  62. a foundational level, so you can not really just copy and
  63. paste. Summaries, and remarks sections can probably be lifted
  64. with little or no effort.
  65. Gtk# uses properties to represent get/set operations in the C
  66. API, so you can also use some bits from there.
  67. Most of the documentation contains already place holders for
  68. text, we use the internationally approved phrase for this
  69. purpose, `To be added'. So the quest is to remove all of the
  70. "To be added" strings with information with resembles as closely
  71. as possible the toolkit reality.
  72. *** The pieces to be filled.
  73. Summaries are one or two line descriptions of the element
  74. (class, struct, interface, method, field, event, delegate), and
  75. its used to render summary pages. So it has to be short.
  76. The "remarks" section is used to describe in detail the element.
  77. **** Tags.
  78. As you document Gtk# you will have a number of tags that you can
  79. use inside the summary and remarks sections, these are:
  80. <pre>
  81. &lt;para&gt; &lt;/para&gt;
  82. </pre>
  83. Used to separate paragraphs.
  84. <pre>
  85. &lt;paramref name="param_name"/&gt;
  86. </pre>
  87. Used to reference a formal parameter to a function.
  88. <pre>
  89. &lt;see cref="T:SomeTypeName"/&gt;
  90. </pre>
  91. Use this to reference a type, this will include an hyper
  92. link to the page for type SomeTypeName.
  93. For example, to reference "System.Enum", do:
  94. <pre>
  95. &lt;see cref="T:System.Enum"/&gt;
  96. </pre>
  97. <pre>
  98. &lt;see cref="P:SomeTypeName.Property"/&gt;
  99. </pre>
  100. Use this to reference a property, this will include an hyper
  101. link to the page for the property `Property' of type `SomeTypeName'.
  102. For example, to reference the BaseType property in System.Type, do:
  103. <pre>
  104. &lt;see cref="P:System.Type.BaseType"/&gt;
  105. </pre>
  106. <pre>
  107. &lt;see cref="M:SomeTypeName.Method(type,type)"/&gt;
  108. </pre>
  109. Use this to reference a method, this will include an hyper
  110. link to the page for the method `Method' of type `SomeTypeName'.
  111. For example, to reference the ToString method in System.Object, do:
  112. <pre>
  113. &lt;see cref="M:System.Object.ToString()"/&gt;
  114. </pre>
  115. <pre>
  116. &lt;see langword="keyword"/&gt;
  117. </pre>
  118. Use this to link to a keyword in the C# language, for
  119. example to link to `true', do:
  120. <pre>
  121. &lt;see langword="true"/&gt;
  122. </pre>
  123. <pre>
  124. &lt;example&gt; ... &lt;/example&gt;
  125. </pre>
  126. Use example to insert an example. The example can
  127. contain explanatory text and code.
  128. <pre>
  129. &lt;code lang="C#"&gt;.. &lt;/code&gt;
  130. </pre>
  131. Use this to provide a sample C# program, typically used
  132. within the &lt;example&gt; tags.
  133. When providing examples, try to provide a full example,
  134. we would like to be able to have a button to compile and
  135. run samples embedded into the documentation, or pop up
  136. an editor to let the user play with the sample.
  137. You can link to an example like this:
  138. <pre>
  139. &lt;code lang="C#" source="file.cs"&gt; &lt;/code&gt;
  140. </pre>
  141. <pre>
  142. &lt;item&gt;
  143. </pre>
  144. <pre>
  145. &lt;list type="bullet"&gt; &lt;/list&gt;
  146. </pre>
  147. Use this to create lists. Lists contains &lt;item&gt;
  148. elements
  149. <pre>
  150. &lt;list type="table"&gt; &lt;/lits&gt;
  151. &lt;listheader&gt;
  152. &lt;term&gt;YOUR FIRST COLUMN&lt;/term&gt;
  153. &lt;description&gt;YOUR DESCRIPTION&lt;/description&gt;
  154. &lt;/listheader&gt;
  155. </pre>
  156. For two-column tables. Inside use:
  157. <pre>
  158. &lt;item&gt;
  159. &lt;term&gt;First&lt;/term&gt;
  160. &lt;description&gt;First descritpion&lt;/description&gt;
  161. &lt;/item&gt;
  162. &lt;item&gt;
  163. &lt;term&gt;Second&lt;/term&gt;
  164. &lt;description&gt;Second descirption&lt;/description&gt;
  165. &lt;/item&gt;
  166. </pre>
  167. ** Words of warning.
  168. A few words of warning and advice for class documentors:
  169. A well-documented API can ease hours of frustration; as Mono
  170. matures, robust and complete class library documentation will
  171. become increasingly important. As you write API documentation,
  172. whether it is embedded in source files or in external Monodoc XML,
  173. please keep the following in mind:
  174. Plagarism, even if it's unintentional, is a Bad Thing(TM).
  175. Microsoft's .NET Framework Class Library documentation is an
  176. excellent resource for understanding the behavior and properties of
  177. a type, and a lot of hard work went in to creating this (copyrighted)
  178. resource. Please don't copy from Microsoft's reference when
  179. documenting a type.
  180. To avoid this, I (<a href="mailto:[email protected]">[email protected]</a>)
  181. suggest that you read the complete Microsoft documentation for a type,
  182. ponder it for a while, and write the Mono documentation in your own
  183. words. While it's certainly okay to refer to the Microsoft
  184. documentation to clarify your understanding of behavior or properties,
  185. please don't open the Microsoft docs and refer to them for each member
  186. you document.
  187. There's a lot of domain expertise among the class library contributors;
  188. let's put the same personal stamp on the class library documentation
  189. that we have on the class libraries themselves.