aboutsummaryrefslogtreecommitdiffstats
path: root/doc/manual.raw
blob: 65d9325a250b92421d42f0b183e187c81d93f870 (plain)
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
<!ENTITY efsd "<function>efsd</function>">
]>


<book id="efsd-documentation-howto">
  <bookinfo>
    <title>Enlightenment Documentation Howto</title>
    
    <authorgroup>
      <author>
	<firstname>FIRSTNAME</firstname>
	<othername>OTHER</othername>
	<surname>LASTNAME</surname>
	<affiliation>
	  <address>
	    <email>EMAIL</email>
	  </address>
	</affiliation>
      </author>
    </authorgroup>
    
    <copyright>
      <year>2001</year>
      <holder>Christian Kreibich</holder>
    </copyright>
    
    <legalnotice>
      <para>
	Permission is hereby granted, free of charge, to any person obtaining a copy
	of this software and associated documentation files (the "Software"), to
	deal in the Software without restriction, including without limitation the
	rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
	sell copies of the Software, and to permit persons to whom the Software is
	furnished to do so, subject to the following conditions:
      </para>
      <para>
	The above copyright notice and this permission notice shall be included in
	all copies of the Software and its documentation and acknowledgment shall be
	given in the documentation and software packages that this Software was
	used.
      </para>
      <para>
	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
	THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
	IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
      </para>
    </legalnotice>

    <releaseinfo>
      This is document is nowhere near being finished. Be patient.
    </releaseinfo>
    
  </bookinfo>

  <toc></toc>

  <chapter id="introduction">
    <title>Introduction</title>
    <para>
      This is some sample documentation for you project. You'll need to be
      familiar with <ulink url="http://docbook.org">DocBook</ulink>
      to make best use of Enlightenment's documentation scheme.
    </para>
    <para>
      See <link linkend="files" endterm="files.title"></link>
      for an explanation of the documentation setup in you project.
    </para>
    <para>
      <link linkend="comments" endterm="comments.title"></link> explains
      the way you have to structure your comments so that they can be
      extracted.
    </para>
    <para>
      <link linkend="samples" endterm="samples.title"></link> contains a few
      layout and markup examples to get you up to speed quickly.
    </para>
  </chapter>

  <chapter id="files">
    <title id="files.title">Documentation File Structure</title>
    <para>
      The entire documentation setup lives in the <filename>doc</filename>
      directory. The file you need to edit is called <filename>manual.raw</filename>.
      When you enter <command>make docs</command> in the toplevel directory,
      it gets translated into a standard SGML file using a Perl script.
      The script scans the file for any lines starting directly with the
      string <command>!I&lt;filename&gt;</command>. Here,
      <filename>filename</filename> is the name of a code
      file in which you have put extractable comments. The Perl script will
      then analyze the file and generate SGML DocBook statements for those
      comments right into the output file. 
    </para>
    <para>
      The resulting file of that step is called <filename>$PACKAGE-manual-$VERSION.sgml</filename>
      where PACKAGE and VERSION are automatically set during the build process.
      This sgml file can be postprocessed with any SGML processor to generate
      for example HTML, TeX or PDF output.
    </para>
    <para>
      Suppport for HTML generation is included already through the
      <command>make html-docs</command> target. In order to be able to use
      that, you'll need to have <command>jade</command> installed, and appropriate
      DocBook stylesheets. If the <command>configure</command> script doesn't automatically find
      you stylesheets (on a Debian system it should), you can specify them when
      calling <command>configure</command> or <command>autogen.sh</command> using
      the <command>--with-dbsheets=DIR</command> option.
    </para>
    <para>
      If everything worked out fine, you'll get a tarball of the HTML version
      of your documentation and the extracted version in the docs directory,
      named similarly to the SGML file.
    </para>
 
  </chapter>

  <chapter id="comments">
    <title id="comments.title">Writing Extractable Comments</title>
    <para>
      I'll simply give an example of a commented function here:

	  <programlisting>

/** 
 * efsd_wait_event - blocking wait for next Efsd event.
 * @ec: The Efsd connection
 * @ev: Pointer to an allocated EfsdEvent.
 *
 * Blocks until an efsd event arrives, then returns it by filling
 * in the @ev structure. Returns -1 when there was an error,
 * >= 0 otherwise.
 */
int            efsd_wait_event(EfsdConnection *ec, EfsdEvent *ev);
	  </programlisting>
      As you can see, it's not hard -- just use two asterisks
      to signal the start of an extractable comment. In the first
      line, begin with the function name and a one-liner description.
      Then, put each parameter in the following lines. Add an empty
      line, and then a more verbose description. That's basically
      it, you can also markup items differently as follows:

	<itemizedlist mark="opencircle">
	  <listitem>
	    <para><command>funcname()</command> for function names</para>
          </listitem>
	  <listitem>
	    <para><command>$ENVVAR</command> for environment variables</para>
          </listitem>
	  <listitem>
	    <para><command>&amp;struct_name</command> for structures</para>
          </listitem>
	  <listitem>
	    <para><command>%CONST</command> for constants/para>
          </listitem>
	</itemizedlist>
    </para>
  </chapter>

  <chapter id="samples">
    <title id="samples.title">DocBook Examples</title>
    <section>
      <title>Lists</title>
      <para>
	<itemizedlist mark="opencircle">
	  <listitem>
	    <para>This</para>
          </listitem>
	  <listitem>
	    <para>is</para>
          </listitem>
	  <listitem>
	    <para>a</para>
          </listitem>
	  <listitem>
	    <para>list</para>
          </listitem>
	</itemizedlist>
      </para>
    </section>
    <section>
      <title>Code</title>
      <para>
	  <programlisting>

EfsdConnection *ec;

if ( (ec = efsd_open()) == NULL)
  {
     /* Oops. Couldn't establish connection.
      * Is Efsd really running ? 
      */
  }

/* ... various efsd commands ... */

if (efsd_close(ec) < 0)
  {
     /* Ouch. Error when closing connection. */
  }
	  </programlisting>
      </para>
    </section>
    <section>
      <title>Images</title>
      <para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/sampleimage.eps" format="eps">
          </imageobject>
          <imageobject>
            <imagedata fileref="figures/sampleimage.gif" format="gif">
          </imageobject>
          <textobject>
            <phrase>Sample image</phrase>
          </textobject>
          <caption>
            <para>This is how you display images.</para>
          </caption>
        </mediaobject>

      </para>
    </section>
    <section>
      <title>Warnings, Notes</title>
      <para>
	<note>
	  <title>This is an example of a note.</title>
	  <para>
            It's really simple to use.
	  </para>
	</note
      </para>
      <para>
	<caution>
          <title>This is a warning.</title>
          <para>
	    It's used just like a note.
          </para>
	</caution>
      </para>
    </section>
  </chapter>
  
  <bibliography>

    <biblioentry id="bib-unp">
      <bookbiblio>
	<author>	  
	  <firstname>W. R.</firstname>
	  <surname>Stevens</surname>
	</author>
	<title>UNIX Network Programming</title>
	<edition>Second Edition</edition>
	<volumenum>Volume 1</volumenum>
	<publisher>
	  <publishername>Prentice-Hall</publishername>
	</publisher>
	<date>1998</date>
      </bookbiblio>
    </biblioentry>	
      
    <biblioentry id="bib-apue">
      <bookbiblio>
	<author>
	  <firstname>W. R.</firstname>
	  <surname>Stevens</surname>
	</author>
	<title>Advanced Programming in the UNIX Environment</title>
	<publisher>
	  <publishername>Addison-Wesley</publishername>
	</publisher>
	<date>1992</date>
      </bookbiblio>
    </biblioentry>	

  </bibliography>
      
</book>