1 | |
---|
2 | General |
---|
3 | ======= |
---|
4 | |
---|
5 | The files to edit manually are generated in the tmpl/ directory. |
---|
6 | Remember to use < or > instead of '<' and '>', in these files. |
---|
7 | |
---|
8 | The first part of each function/macro/struct etc. description should be |
---|
9 | a very short summary of what it is. This may be used at some point to |
---|
10 | produce a short reference guide which can be printed out. |
---|
11 | |
---|
12 | For macros which return a value just like a function, you must manually |
---|
13 | add a '@Returns: ' field. |
---|
14 | |
---|
15 | You may want to rearrange the functions/macros etc. to split them into |
---|
16 | related sections. To do this rearrange the MODULE-sections.txt |
---|
17 | files. You can also add <SUBSECTION> between functions. Currently this just |
---|
18 | results in a blank line between them in the synopsis. |
---|
19 | |
---|
20 | |
---|
21 | Abbreviations |
---|
22 | ============= |
---|
23 | |
---|
24 | These are expanded into appropriate DocBook tags, saving a lot of typing. |
---|
25 | I've used the Gnome ones (see gnome.txt) but also added '#'. |
---|
26 | |
---|
27 | Use function() to refer to functions or macros which take arguments. |
---|
28 | |
---|
29 | Use @param to refer to parameters. (I've also used this when referring to |
---|
30 | parameters of other functions, related to the one being described.) |
---|
31 | |
---|
32 | Use %constant to refer to a constant, e.g. %G_TRAVERSE_LEAFS. |
---|
33 | |
---|
34 | Use #symbol to refer to other types of symbol, e.g. structs and enums |
---|
35 | and macros which don't take arguments. |
---|
36 | |
---|
37 | |
---|
38 | |
---|
39 | Useful DocBook Tags |
---|
40 | =================== |
---|
41 | |
---|
42 | These are the DocBook tags which I have used or I think could be useful. |
---|
43 | Let me know if I'm doing something wrong! |
---|
44 | |
---|
45 | |
---|
46 | To link to another section in the GTK docs: |
---|
47 | |
---|
48 | <link linkend="glib-Hash-Tables">Hash Tables</link> |
---|
49 | |
---|
50 | The linkend is the SGML id on the top item of the page you want to link to. |
---|
51 | For most pages this is currently the part ("gtk", "gdk", glib") and then |
---|
52 | the page title ("Hash Tables"). For widgets it is just the class name. |
---|
53 | Spaces and underscores are converted to '-' to conform to SGML. |
---|
54 | |
---|
55 | |
---|
56 | To refer to an external function, e.g. a standard C function: |
---|
57 | |
---|
58 | <function>...</function> |
---|
59 | |
---|
60 | |
---|
61 | To include example code: |
---|
62 | |
---|
63 | <example> |
---|
64 | <title>Using a GHashTable.</title> |
---|
65 | <programlisting> |
---|
66 | ... |
---|
67 | </programlisting> |
---|
68 | </example> |
---|
69 | |
---|
70 | or possibly this, for very short code fragments which don't need a title: |
---|
71 | |
---|
72 | <informalexample> |
---|
73 | <programlisting> |
---|
74 | ... |
---|
75 | </programlisting> |
---|
76 | </informalexample> |
---|
77 | |
---|
78 | |
---|
79 | To include bulleted lists: |
---|
80 | |
---|
81 | <itemizedlist> |
---|
82 | |
---|
83 | <listitem> |
---|
84 | <para> |
---|
85 | ... |
---|
86 | </para> |
---|
87 | </listitem> |
---|
88 | |
---|
89 | <listitem> |
---|
90 | <para> |
---|
91 | ... |
---|
92 | </para> |
---|
93 | </listitem> |
---|
94 | |
---|
95 | </itemizedlist> |
---|
96 | |
---|
97 | |
---|
98 | To include a note which stands out from the text: |
---|
99 | |
---|
100 | <note> |
---|
101 | <para> |
---|
102 | Make sure you free the data after use. |
---|
103 | </para> |
---|
104 | </note> |
---|
105 | |
---|
106 | To refer to a type: |
---|
107 | |
---|
108 | <type>unsigned char</type> |
---|
109 | |
---|
110 | |
---|
111 | To refer to an external structure (not one described in the GTK docs): |
---|
112 | |
---|
113 | <structname>XFontStruct</structname> |
---|
114 | |
---|
115 | |
---|
116 | To refer to a field of a structure: |
---|
117 | |
---|
118 | <structfield>len</structfield> |
---|
119 | |
---|
120 | |
---|
121 | To refer to a class name, we could possibly use: |
---|
122 | |
---|
123 | <classname>GtkWidget</classname> |
---|
124 | |
---|
125 | but you'll probably be using #GtkWidget instead (to automatically create |
---|
126 | a link to the GtkWidget page - see the abbreviations above). |
---|
127 | |
---|
128 | |
---|
129 | To emphasize text: |
---|
130 | |
---|
131 | <emphasis>This is important</emphasis> |
---|
132 | |
---|
133 | but I haven't been using it so far. |
---|
134 | |
---|
135 | |
---|
136 | For filenames use: |
---|
137 | |
---|
138 | <filename>c:\windows</filename> |
---|
139 | |
---|