1 | |
---|
2 | How to Set Up an Application or Library to use GTK-Doc |
---|
3 | ====================================================== |
---|
4 | |
---|
5 | This assumes that you are using autoconf & automake to build your package. |
---|
6 | |
---|
7 | |
---|
8 | 1. Insert the code from examples/configure.in into your configure.in. |
---|
9 | (somewhere before the call to AC_OUTPUT.) |
---|
10 | |
---|
11 | 2. Create a directory in which you want the docs to be built, |
---|
12 | e.g. 'myproject/docs/reference'. |
---|
13 | |
---|
14 | 3. Copy examples/Makefile.am to this directory and edit the variables at |
---|
15 | the top of the file. (See the GTK+ source for an example.) |
---|
16 | |
---|
17 | 4. Add the new Makefile to your configure.in's AC_OUTPUT call, and make sure |
---|
18 | all the SUBDIRS variables are set properly so the docs directory is built. |
---|
19 | |
---|
20 | 5. If your library or application includes GtkObjects/GObjects, and you want |
---|
21 | their signals, arguments/parameters and position in the hierarchy to be |
---|
22 | documented: |
---|
23 | |
---|
24 | Create a MODULE.types file in the docs directory, e.g. "myproject.types". |
---|
25 | This should contain any '#include' directives needed to compile a program |
---|
26 | with your module, and a list of functions to initialize all of the widgets |
---|
27 | and objects in the library. For example, the gtk.types file starts like |
---|
28 | this: |
---|
29 | |
---|
30 | #include <gtk/gtk.h> |
---|
31 | |
---|
32 | gtk_accel_label_get_type |
---|
33 | gtk_adjustment_get_type |
---|
34 | gtk_alignment_get_type |
---|
35 | gtk_arrow_get_type |
---|
36 | |
---|
37 | |
---|
38 | That's it! If you now build the application or library you should get a |
---|
39 | complete set of documentation. (Note that due to make being awkward the build |
---|
40 | may fail the first time, but if you run make again it should work.) |
---|
41 | |
---|
42 | |
---|
43 | You can tweak the output in several ways: |
---|
44 | |
---|
45 | o modify the main SGML file to add introductory sections or to split the |
---|
46 | documentation into several chapters. |
---|
47 | |
---|
48 | o modify the MODULE-sections.txt file to rearrange the documentation into |
---|
49 | different sections or a different order (see sections-file.txt for info). |
---|
50 | |
---|
51 | o add a MODULE-overrides.txt to override particular declarations. |
---|
52 | |
---|
53 | |
---|
54 | Damon |
---|