documentation 8.6 KB

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