diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2019-02-09 22:02:21 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2019-02-09 22:02:21 +0000 |
commit | 5249dfefc53b3bfe1e8f314206e160617ae4b927 (patch) | |
tree | 0662979e147070d93a252d4bd055b050dfaee358 /Doc | |
parent | ab754b0c65e15e27b88752a629986bf879d41859 (diff) | |
parent | 08029e6642c817f4878964e7a489d18c5c55f966 (diff) | |
download | swig-5249dfefc53b3bfe1e8f314206e160617ae4b927.tar.gz |
Merge branch 'ZackerySpytz-OCaml-module-docstring'
* ZackerySpytz-OCaml-module-docstring:
[OCaml] Add support for the docstring option in the module directive
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/Manual/Contents.html | 4 | ||||
-rw-r--r-- | Doc/Manual/Ocaml.html | 45 |
2 files changed, 49 insertions, 0 deletions
diff --git a/Doc/Manual/Contents.html b/Doc/Manual/Contents.html index 22f6126de..06dd91ae6 100644 --- a/Doc/Manual/Contents.html +++ b/Doc/Manual/Contents.html @@ -1397,6 +1397,10 @@ </ul> <li><a href="Ocaml.html#Ocaml_nn31">Exceptions</a> </ul> +<li><a href="Ocaml.html#Ocaml_nn32">Documentation Features</a> +<ul> +<li><a href="Ocaml.html#Ocaml_nn33">Module docstring</a> +</ul> </ul> </div> <!-- INDEX --> diff --git a/Doc/Manual/Ocaml.html b/Doc/Manual/Ocaml.html index 62b5f926e..a3c60db02 100644 --- a/Doc/Manual/Ocaml.html +++ b/Doc/Manual/Ocaml.html @@ -53,6 +53,10 @@ </ul> <li><a href="#Ocaml_nn31">Exceptions</a> </ul> +<li><a href="#Ocaml_nn32">Documentation Features</a> +<ul> +<li><a href="#Ocaml_nn33">Module docstring</a> +</ul> </ul> </div> <!-- INDEX --> @@ -992,5 +996,46 @@ but not too useful example is provided by the throw_exception testcase in Examples/test-suite. You can provide your own exceptions, too. </p> +<H2><a name="Ocaml_nn32">33.3 Documentation Features</a></H2> + + +<p> +The features described in this section can be used to generate documentation +comments (colloquially referred to as "docstrings") that can be read by +<a href="https://caml.inria.fr/pub/docs/manual-ocaml/ocamldoc.html">OCamldoc</a>. +</p> + +<H3><a name="Ocaml_nn33">33.3.1 Module docstring</a></H3> + + +<p> +The first documentation comment of an <tt>mli</tt> file is the comment +associated with the entire module. SWIG supports this by setting an +option of the <tt>%module</tt> directive. For example: +</p> + +<div class="code"> +<pre> +%module(docstring="This is the example module's docstring") example +</pre> +</div> + +<p> +When you have more than just a line or so, you can retain the +readability of the <tt>%module</tt> directive by using a macro. For +example: +</p> + +<div class="code"> +<pre> +%define DOCSTRING +"The `XmlResource` class allows program resources defining menus, +controls on a panel, etc. to be loaded from an XML file." +%enddef + +%module(docstring=DOCSTRING) xrc +</pre> +</div> + </body> </html> |