This file is indexed.

/usr/share/doc/gnat-gps/html/Documentation-Generation.html is in gnat-gps-doc 5.0-6.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<html lang="en">
<head>
<title>Documentation Generation - Using the GNAT Programming Studio</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using the GNAT Programming Studio">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Tools.html#Tools" title="Tools">
<link rel="prev" href="Code-Fixing.html#Code-Fixing" title="Code Fixing">
<link rel="next" href="Metrics.html#Metrics" title="Metrics">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 2002-2010 AdaCore.

This document is free; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This document is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, see `http://www.gnu.org/licenses/'.-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
pre.smallexample {background-color:rgb(240,240,240);
                     font-family: courier new,courier,fixed;
                     font-size: 14px;
                     margin: 0px 40px 0px 40px;
                     border-width: 1px 2px 2px 1px;
                     border-top-style: dotted;
                     border-left-style: dotted;
                     border-right-style: solid;
                     border-bottom-style: solid;
                     border-color: black;}
   code             {color:black;
                     font-family: courier new,courier,fixed;
                     font-size: 14px;}
   body             {font-family: arial,helvetica,sans-serif;
                     font-size: 16px;
                     max-width: 800px;
                     text-align: justify}
   samp             {font-family: courier new,courier,fixed;
                     font-size: 14px}
                    
--></style>
</head>
<body>
<div class="node">
<a name="Documentation-Generation"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Metrics.html#Metrics">Metrics</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Code-Fixing.html#Code-Fixing">Code Fixing</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Tools.html#Tools">Tools</a>
<hr>
</div>

<h3 class="section">13.5 Documentation Generation</h3>

<p><a name="index-documentation-generation-620"></a>GPS provides a documentation generator which processes source files
and generates annotated HTML files.

   <p>It is based on the source cross-reference information (e.g. generated by
GNAT for Ada files). This means that you should ensure that cross-reference
information has been generated before generating the documentation. 
It also relies on standard comments that it extracts from the source code. 
Note that unlike other similar tools, no macro needs to be put in your
comments. The engine in charge of extracting them coupled with the
cross-reference engine gives GPS all the flexibility needed to generate
accurate documentation.

   <p>The documentation is put by default into a directory called <samp><span class="file">doc</span></samp>, created
under the object directory of the root project loaded in GPS. If no such object
directory exists, then it is directly created in the same directory as the root
project. This behavior can be modified by specifying the attribute
Documentation_Dir in the package IDE of your root project:
<pre class="smallexample">     project P is
        package IDE is
           for Documentation_Dir use "html";
        end IDE;
     end P;
</pre>
   <p>Once the documentation is generated, the main documentation file is loaded
in your default browser.

   <p>The documentation generator uses a set of templates files to control the final
rendering. This means that you can control precisely the rendering of the
generated documentation. The templates used for generating the documentation
can be found under <samp><span class="file">&lt;install_dir&gt;/share/gps/docgen2</span></samp>. If you need a
different layout as the proposed one, you can change directly those files.

   <p>In addition, user-defined structured comments can be used to improve the
generated documentation. The structured comments use xml-like tags. To define
your own set of tags, please refer to the GPS python extension documentation
(from GPS Help menu, choose 'Python extensions').

   <p>The string values inside those tags are handled very roughly the same way as in
regular xml: duplicated spaces and line returns are ignored. One exception is
that the layout is preserved in the following cases:
     <dl>
<dt><code>The line starts with "- " or "* "</code><dd>In this case, GPS makes sure that a proper line return precedes the line. This
is to allow lists in comments
<br><dt><code>The line starts with a capital letter</code><dd>GPS then supposes that the preceding line return was intended, so it is kept
</dl>

   <p>Some default tags have been already defined by GPS in
<samp><span class="file">&lt;install_dir&gt;/share/gps/plug-ins/docgen_base_tags.py</span></samp>. The tags handled
are:

     <dl>
<dt><code>summary</code><dd>Short summary of what a package or method is doing. 
<br><dt><code>description</code><dd>Full description of what a package or method is doing. 
<br><dt><code>parameter (attribute "name" is expected)</code><dd>Description of the parameter named "name". 
<br><dt><code>exception</code><dd>Description of possible exceptions raised by the method. 
<br><dt><code>seealso</code><dd>Reference to another package, method, type, etc. 
<br><dt><code>c_version</code><dd>For bindings, the version of the C file. 
<br><dt><code>group</code><dd>For packages, this builds an index of all packages in the project grouped by
categories. 
<br><dt><code>code</code><dd>When the layout of the value of the node needs to be preserved. The text is
displayed using a fixed font (monospace). 
</dl>

   <p>The following sample shows how those tags are translated:
<pre class="smallexample">     --  &lt;description&gt;
     --    This is the main description for this package. It can contain a complete
     --    description with some xml characters as &lt; or &gt;.
     --  &lt;/description&gt;
     --  &lt;group&gt;Group1&lt;/group&gt;
     --  &lt;c_version&gt;1.0.0&lt;/c_version&gt;
     package Pkg is
     
        procedure Test (Param : Integer);
        --  &lt;summary&gt;Test procedure with a single parameter&lt;/summary&gt;
        --  &lt;parameter name="Param"&gt;An Integer&lt;/parameter&gt;
        --  &lt;exception&gt;No exception&lt;/exception&gt;
        --  &lt;seealso&gt;Test2&lt;/seealso&gt;
     
        procedure Test2 (Param1 : Integer; Param2 : Natural);
        --  &lt;summary&gt;Test procedure with two parameters&lt;/summary&gt;
        --  &lt;parameter name="Param1"&gt;An Integer&lt;/parameter&gt;
        --  &lt;parameter name="Param2"&gt;A Natural&lt;/parameter&gt;
        --  &lt;exception&gt;System.Assertions.Assert_Failure if Param1 &lt; 0&lt;/exception&gt;
        --  &lt;seealso&gt;Test&lt;/seealso&gt;
     
     end Pkg;
</pre>
   <p>Its documentation will be:

   <p><a name="index-screen-shot-621"></a><img src="docgen.jpg" alt="docgen.jpg">

<!-- For a description of the -->
<!-- documentation generator renderer @pxref{Defining a documentation format}. -->
   <p>The documentation generator can be invoked from two places inside GPS:

     <dl>
<dt><b><a href="The-Tools-Menu.html#The-Tools-Menu">The Tools Menu</a></b><dd>
          <dl>
<dt><samp><span class="command">Generate project</span></samp><dd>Generate documentation for all files from the loaded project.

          <br><dt><samp><span class="command">Generate projects &amp; subprojects</span></samp><dd>Generate documentation for all files from the loaded project as well all
its subprojects.

          <br><dt><samp><span class="command">Generate current file</span></samp><dd>Generate documentation for the file you are currently editing.

          <br><dt><samp><span class="command">Generate for...</span></samp><dd>This will open a File Selector Dialog (see <a href="The-File-Selector.html#The-File-Selector">The File Selector</a>) and
documentation will be generated for the file you select.

     </dl>

     <br><dt><b>The Contextual Menu</b><dd>
When relevant (depending on the context), right-clicking with your mouse
will show a <code>Documentation</code> contextual menu.

     <p>From a source file contextual menu, you have one option called
<samp><span class="command">Generate for &lt;filename&gt;</span></samp>, that will generate documentation
for this file and if needed its corresponding body
(see <a href="The-Preferences-Dialog.html#The-Preferences-Dialog">The Preferences Dialog</a>).

     <p>From a project contextual menu (see <a href="The-Project-View.html#The-Project-View">The Project View</a>), you will have the
choice between generating documentation for all files from the selected project
only or from the selected project recursively.

     <p>You will find the list of all documentation options in
<a href="The-Preferences-Dialog.html#The-Preferences-Dialog">The Preferences Dialog</a>.

     <p>Note that the documentation generator relies on the ALI files created by
GNAT. Depending on the version of GNAT used, the following restrictions may
or may not apply:

          <ul>
<li>A type named <i>type</i> may be generated in the type index.

          <li>Parameters and objects of private generic types may be considered as
types. 
</ul>
     </dl>

   </body></html>