Imported Upstream version 1.8.15
[platform/upstream/doxygen.git] / doc / customize.doc
1 /******************************************************************************
2  *
3  * 
4  *
5  * Copyright (C) 1997-2015 by Dimitri van Heesch.
6  *
7  * Permission to use, copy, modify, and distribute this software and its
8  * documentation under the terms of the GNU General Public License is hereby 
9  * granted. No representations are made about the suitability of this software 
10  * for any purpose. It is provided "as is" without express or implied warranty.
11  * See the GNU General Public License for more details.
12  *
13  * Documents produced by Doxygen are derivative works derived from the
14  * input used in their production; they are not affected by this license.
15  *
16  */
17 /*! \page customize Customizing the output
18
19 \tableofcontents{html,latex}
20
21 Doxygen provides various levels of customization. 
22 The section \ref minor_tweaks "Minor Tweaks" discusses what to 
23 do if you want to do minor tweaking to the look and feel of the output. 
24 The section \ref layout "Layout" show how to reorder and hide certain 
25 information on a page. 
26 The section \ref xmlgenerator "XML output" show how to generate 
27 whatever output you want based on the XML output produced by doxygen.
28
29 \section minor_tweaks Minor Tweaks
30
31 The next subsections describe some aspects that can be tweaked with
32 little effort.
33
34 \subsection minor_tweaks_colors Overall Color
35
36 To change the overall color of the HTML output doxygen provides three options
37 - \ref cfg_html_colorstyle_hue "HTML_COLORSTYLE_HUE"
38 - \ref cfg_html_colorstyle_sat "HTML_COLORSTYLE_SAT"
39 - \ref cfg_html_colorstyle_gamma "HTML_COLORSTYLE_GAMMA"
40
41 to change the hue, saturation, and gamma correction of the colors respectively.
42
43 For your convenience the GUI frontend \ref doxywizard_usage "Doxywizard" 
44 has a control that allows you to see the effect of changing the values of these options 
45 on the output in real time.
46
47 \subsection minor_tweaks_treeview Navigation
48
49 By default doxygen shows navigation tabs on top of every HTML page,
50 corresponding with the following settings:
51
52 - \ref cfg_disable_index "DISABLE_INDEX" = \c NO
53 - \ref cfg_generate_treeview "GENERATE_TREEVIEW" = \c NO
54
55 you can switch to an interactive navigation tree as sidebar using
56
57 - \ref cfg_disable_index "DISABLE_INDEX" = \c YES
58 - \ref cfg_generate_treeview "GENERATE_TREEVIEW" = \c YES
59
60 or even have both forms of navigation:
61
62 - \ref cfg_disable_index "DISABLE_INDEX" = \c NO
63 - \ref cfg_generate_treeview "GENERATE_TREEVIEW" = \c YES
64
65 if you already use an external index (i.e. have one of the following
66 options enabled
67 \ref cfg_generate_htmlhelp "GENERATE_HTMLHELP",
68 \ref cfg_generate_eclipsehelp "GENERATE_ECLIPSEHELP",
69 \ref cfg_generate_qhp "GENERATE_QHP", or
70 \ref cfg_generate_docset "GENERATE_DOCSET")
71 then you can also disable all indices, like so:
72
73 - \ref cfg_disable_index "DISABLE_INDEX" = \c YES
74 - \ref cfg_generate_treeview "GENERATE_TREEVIEW" = \c NO
75
76 \subsection minor_tweaks_dynsection Dynamic Content
77
78 To make the HTML output more interactive, doxygen provides a number of options
79 that are disabled by default:
80 - enabling \ref cfg_html_dynamic_sections "HTML_DYNAMIC_SECTIONS" will make
81   doxygen hide certain content (like graphs) in the HTML by default, 
82   and let the reader expand these sections on request.
83 - enabling \ref cfg_have_dot "HAVE_DOT" along 
84   with \ref cfg_interactive_svg "INTERACTIVE_SVG" while setting 
85   \ref cfg_dot_image_format "DOT_IMAGE_FORMAT" to \c svg, will make doxygen
86   produce SVG images that will allow the user to zoom and pan (this only
87   happens when the size of the images exceeds a certain size).
88
89 \subsection minor_tweaks_header_css Header, Footer, and Stylesheet changes
90
91 To tweak things like fonts or colors, margins, or other look \& feel
92 aspects of the HTML output in detail, you can create a different 
93 <a href="https://www.w3schools.com/css/default.asp">cascading style sheet</a>. 
94 You can also let doxygen use a custom header and footer for each HTML 
95 page it generates, for instance to make the output conform to the style 
96 used on the rest of your web site.
97
98 To do this first run doxygen as follows:
99 \verbatim
100 doxygen -w html header.html footer.html customdoxygen.css 
101 \endverbatim
102
103 This will create 3 files:
104 - header.html is a HTML fragment which doxygen normally uses to start
105   a HTML page. Note that the fragment ends with a body tag and that is
106   contains a couple of commands of the form \$word. These will be replaced
107   by doxygen on the fly. 
108 - footer.html is a HTML fragment which doxygen normally uses to end 
109   a HTML page. Also here special commands can be used. This file contain the 
110   link to www.doxygen.org and the body and html end tags.
111 - customdoxygen.css is the default cascading style sheet
112   used by doxygen. It is recommended only to look into this file and overrule
113   some settings you like by putting them in a separate stylesheets and
114   referencing those extra files
115   via \ref cfg_html_extra_stylesheet "HTML_EXTRA_STYLESHEET".
116
117 You should edit these files and then reference them from the configuration file.
118 - \ref cfg_html_header "HTML_HEADER" = \c header.html
119 - \ref cfg_html_footer "HTML_FOOTER" = \c footer.html
120 - \ref cfg_html_extra_stylesheet "HTML_EXTRA_STYLESHEET" = \c my_customdoxygen.css
121
122 \note it is not longer recommended to use \ref cfg_html_stylesheet "HTML_STYLESHEET",
123 as it make it difficult to upgrade to a newer version of doxygen. Use
124 \ref cfg_html_extra_stylesheet "HTML_EXTRA_STYLESHEET" instead.
125
126 See the documentation of the \ref cfg_html_header "HTML_HEADER" tag
127 for more information about the possible meta commands you can use inside
128 your custom header.
129
130 \note You should not put the style sheet in the HTML output directory. Treat
131 it as a source file. Doxygen will copy it for you. 
132
133 \note If you use images or other external content in a custom header you
134 need to make sure these end up in the HTML output directory yourself,
135 for instance by writing a script that runs doxygen can then copies the
136 images to the output.
137
138 \warning The structure of headers and footers may change after upgrading to
139 a newer version of doxygen, so if you are using a custom header or footer, 
140 it might not produce valid output anymore after upgrading. 
141
142 \section layout Changing the layout of pages
143
144 In some cases you may want to change the way the output is structured.
145 A different style sheet or custom headers and footers do not help in such 
146 case.
147
148 The solution doxygen provides is a layout file, which you can
149 modify and doxygen will use to control what information is presented, 
150 in which order, and to some extent also how information is presented.
151 The layout file is an XML file. 
152
153 The default layout can be generated
154 by doxygen using the following command:
155 \verbatim
156 doxygen -l 
157 \endverbatim
158 optionally the name of the layout file can be specified, if omitted
159 \c DoxygenLayout.xml will be used.
160
161 The next step is to mention the layout file in the configuration file
162 \verbatim
163 LAYOUT_FILE = DoxygenLayout.xml
164 \endverbatim
165 To change the layout all you need to do is edit the layout file.
166
167 The toplevel structure of the file looks as follows:
168 \verbatim
169 <doxygenlayout version="1.0">
170   <navindex>
171     ...
172   </navindex>
173   <class>
174     ...
175   </class>
176   <namespace>
177     ...
178   </namespace>
179   <file>
180     ...
181   </file>
182   <group>
183     ...
184   </group>
185   <directory>
186     ...
187   </directory>
188 </doxygenlayout>
189 \endverbatim
190
191 The root element of the XML file is \c doxygenlayout, it has an attribute named
192 \c version, which will be used in the future to cope with changes that are
193 not backward compatible.
194
195 The first section, identified by the \c navindex element, represents the 
196 layout of the navigation tabs displayed at the top of each HTML page. At the
197 same time it also controls the items in the navigation tree in case
198 \ref cfg_generate_treeview "GENERATE_TREEVIEW" is enabled. 
199 Each tab is represented by a \c tab element in the XML file.
200
201 You can hide tabs by setting the \c visible attribute to \c no. 
202 You can also override the default title of a tab by specifying it as 
203 the value of the \c title attribute. If the title field is the empty string
204 (the default) then doxygen will fill in an appropriate language specific title.
205
206 You can reorder the tabs by moving the tab elements in the XML file
207 within the \c navindex element and even change the tree structure. 
208 Do not change the value of the \c type attribute however. 
209 Only a fixed set of types are supported, each representing a link to a 
210 specific index.
211
212 You can also add custom tabs using a type with name "user". Here is an
213 example that shows how to add a tab with title "Google" pointing to 
214 www.google.com:
215
216 \verbatim
217   <navindex>
218     ...
219     <tab type="user" url="http://www.google.com" title="Google"/>
220     ...
221   </navindex>
222 \endverbatim
223
224 The url field can also be a relative URL. If the URL starts with \@ref
225 the link will point to a documented entities, such as a class, a function, 
226 a group, or a related page. Suppose we have defined a page using \@page with 
227 label mypage, then a tab with label "My Page" to this page would look 
228 as follows:
229
230 \verbatim
231   <navindex>
232     ...
233     <tab type="user" url="@ref mypage" title="My Page"/>
234     ...
235   </navindex>
236 \endverbatim
237
238 You can also group tabs together in a custom group using a tab with
239 type "usergroup". The following example puts the above tabs in a user
240 defined group with title "My Group":
241
242 \verbatim
243   <navindex>
244     ...
245     <tab type="usergroup" title="My Group">
246       <tab type="user" url="http://www.google.com" title="Google"/>
247       <tab type="user" url="@ref mypage" title="My Page"/>
248     </tab>
249     ...
250   </navindex>
251 \endverbatim
252
253 Groups can be nested to form a hierarchy. 
254
255 By default a usergroup entry in the navigation tree is a link to
256 a landing page with the contents of the group. You can link to a
257 different page using the `url` attribute just like you can for the
258 `<tab>` element and prevent any link using `url="[none]"`, i.e.
259
260 \verbatim
261    <tab type="usergroup" title="Group without link" url="[none]">
262    ...
263    </tab>
264 \endverbatim
265
266 The elements after \c navindex represent the layout of the different 
267 pages generated by doxygen:
268 - The \c class element represents the layout of all pages generated for
269   documented classes, structs, unions, and interfaces.
270 - The \c namespace element represents the layout of all pages generated for
271   documented namespaces (and also Java packages).
272 - The \c file element represents the layout of all pages generated for
273   documented files.
274 - The \c group element represents the layout of all pages generated for
275   documented groups (or modules).
276 - The \c directory element represents the layout of all pages generated for
277   documented directories.
278
279 Each XML element within one of the above page elements represents a certain
280 piece of information. Some pieces can appear in each type of page,
281 others are specific for a certain type of page.
282 Doxygen will list the pieces in the order in which they appear 
283 in the XML file. 
284
285 The following generic elements are possible for each page:
286 <dl>
287 <dt>\c briefdescription
288   <dd>Represents the brief description on a page.
289 <dt>\c detaileddescription
290   <dd>Represents the detailed description on a page.
291 <dt>\c authorsection
292   <dd>Represents the author section of a page (only used for man pages). This is
293       a separate section for man pages with a text like:
294       `Generated automatically by Doxygen for My Project from the source code.`
295       This should not be misinterpreted with the doxygen commands \ref cmdauthor
296       "\\author" or \ref cmdauthors "\\authors" that generate an author paragraph
297       inside a detailed description.
298 <dt>\c memberdecl
299   <dd>Represents the quick overview of members on a page (member declarations).
300       This elements has child elements per type of member list.
301       The possible child elements are not listed in detail in the document, 
302       but the name of the element should be a good indication of the type 
303       of members that the element represents.
304 <dt>\c memberdef
305   <dd>Represents the detailed member list on a page (member definition).
306       Like the \c memberdecl element, also this element has a number of 
307       possible child elements. 
308 </dl>
309
310 The class page has the following specific elements:
311 <dl>
312 <dt>\c includes
313   <dd>Represents the include file needed to obtain the definition for 
314       this class.
315 <dt>\c inheritancegraph
316   <dd>Represents the inheritance relations for a class. 
317       Note that the CLASS_DIAGRAM option determines
318       if the inheritance relation is a list of base and derived classes or
319       a graph. 
320 <dt>\c collaborationgraph
321   <dd>Represents the collaboration graph for a class.
322 <dt>\c allmemberslink
323   <dd>Represents the link to the list of all members for a class.
324 <dt>\c usedfiles
325   <dd>Represents the list of files from which documentation for the class was
326       extracted.
327 </dl>
328
329 The file page has the following specific elements:
330 <dl>
331 <dt>\c includes
332   <dd>Represents the list of \#include statements contained in this file.
333 <dt>\c includegraph
334   <dd>Represents the include dependency graph for the file.
335 <dt>\c includedbygraph
336   <dd>Represents the included by dependency graph for the file.
337 <dt>\c sourcelink
338   <dd>Represents the link to the source code of this file.
339 </dl>
340
341 The group page has a specific \c groupgraph element which represents the
342 graph showing the dependencies between groups.
343
344 Similarly, the directory page has a specific \c directorygraph element 
345 which represents the graph showing the dependencies between the directories 
346 based on the \#include relations of the files inside the directories.
347
348 Some elements have a \c visible attribute which can be 
349 used to hide the fragment from the generated output, by setting the attribute's
350 value to "no". You can also use the value of a configuration option to 
351 determine the visibility, by using 
352 its name prefixed with a dollar sign, e.g.
353 \verbatim
354   ...
355   <includes visible="$SHOW_INCLUDE_FILES"/>
356   ...
357 \endverbatim
358 This was mainly added for backward compatibility.
359 Note that the \c visible attribute is just a hint for doxygen. 
360 If no relevant information is available for a certain piece it is 
361 omitted even if it is set to \c yes (i.e. no empty sections are generated). 
362
363 Some elements have a \c title attribute. This attribute can be used
364 to customize the title doxygen will use as a header for the piece.
365
366 @warning at the moment you should not remove elements from the layout file
367 as a way to hide information. Doing so can cause broken links in the 
368 generated output!
369
370
371 \section xmlgenerator Using the XML output
372
373 If the above two methods still do not provide enough flexibility, you
374 can also use the XML output produced by doxygen as a basis to
375 generate the output you like. To do this set GENERATE_XML to YES.
376
377 The XML output consists of an index file named \c index.xml which
378 lists all items extracted by doxygen with references to the other XML files
379 for details. The structure of the index is described by a schema file
380 \c index.xsd. All other XML files are described by the schema file 
381 named \c compound.xsd. If you prefer one big XML file 
382 you can combine the index and the other files using the 
383 XSLT file \c combine.xslt.
384
385 You can use any XML parser to parse the file or use the one that can be found
386 in the \c addon/doxmlparser directory of doxygen source distribution. 
387 Look at \c addon/doxmlparser/include/doxmlintf.h for the interface of the
388 parser and in \c addon/doxmlparser/example for examples.
389
390 The advantage of using the doxmlparser is that it
391 will only read the index file into memory and then only those XML 
392 files that you implicitly load via navigating through the index. As a 
393 result this works even for very large projects where reading all XML
394 files as one big DOM tree would not fit into memory.
395
396 See <a href="https://github.com/michaeljones/breathe">the Breathe project</a> for
397 an example that uses doxygen XML output from Python to bridge it with the 
398 <a href="http://www.sphinx-doc.org/en/stable/">Sphinx</a> document generator.
399
400
401 \htmlonly
402 Go to the <a href="custcmd.html">next</a> section or return to the
403  <a href="index.html">index</a>.
404 \endhtmlonly
405
406  */