~drizzle-trunk/drizzle/development

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
.. _documentation-label:

Contributing Documentation
==========================

Our documentation is written using
`Sphinx Documentation Generator <http://sphinx.pocoo.org/>`_
which uses the `reStructuredText <http://docutils.sf.net/rst.html>`_ format.

All our documentation is stored in the main source reposatory in the docs/
directory, and every merge into trunk triggers a rebuild of our
`documentation site <http://docs.drizzle.org/>`_.

Requirements
------------

We require a minimum of python-sphinx 0.6 to compile the documentation but not
all of it will build correctly in that version.  For correct documentation
version 1.0 is required.

When building the documentation warnings are treated as errors, so the documentation
needs to be warning free in 1.0.

Documentation Files
-------------------

The documentation files have the .rst extension and are stored in the ``docs/``
directory.

Contents
^^^^^^^^

To add a new document to the contents you will need to add it to a relevent
section in the ``docs/index.rst`` file.

Plugins
^^^^^^^

To document plugins you need to create a ``docs/`` subdirectory in your plugin
directory containing an index.rst file.  This will be automatically added during
the ``config/autorun.sh`` phase.

Documentation Format
--------------------

The documentation is in the reStructured text format which is a wiki-like markup
language ideal for documentation.

Headings
^^^^^^^^

Headings take the form of just the text with a diffent style of underline to
signify the level, for example:

.. code-block:: rest
   
   Heading Level 1
   ===============

   Heading Level 2
   ---------------

   Heading Level 3
   ^^^^^^^^^^^^^^^

Tables
^^^^^^

There are two ways of generating a table, the first is basically drawing the
entire table in ascii art as follows:

.. code-block:: rest

   +----+--------+-----+
   | ID | name   | age |
   +====+========+=====+
   | 1  | Fred   | 23  |
   +----+--------+-----+
   | 2  | Joe    | 48  |
   +----+--------+-----+
   | 3  | Sophie | 32  |
   +----+--------+-----+

Which generates:

+----+--------+-----+
| ID | name   | age |
+====+========+=====+
| 1  | Fred   | 23  |
+----+--------+-----+
| 2  | Joe    | 48  |
+----+--------+-----+
| 3  | Sophie | 32  |
+----+--------+-----+

As an alternative there is a simplified form as follows:

.. code-block:: rest

   ----- ----- ------
     A     B   Result
   ===== ===== ======
   False False False
   False True  True
   True  False True
   True  True  False
   ===== ===== =====

Gives this table:

===== ===== ======
  A     B   Result
===== ===== ======
False False False
False True  True
True  False True
True  True  False
===== ===== ======

In this form there must be more than one row to the table and the first column
can only have a single line.

Syntax Highlighting
^^^^^^^^^^^^^^^^^^^

Sphinx supports syntax highlighting using the `Pygments <http://pygments.org/>`_
engine.  For example, with the *mysql* syntax highlighter you can do the
following:

.. code-block:: rest

   .. code-block:: mysql

      SELECT * FROM t1 WHERE a=1;

Which will generate:

.. code-block:: mysql

   SELECT * FROM t1 WHERE a=1;

You can also add line numbers as follows:

.. code-block:: rest

   .. code-block:: c
      :linenos:

      #include <stdio.h>

      main()
      {
        printf("hello world");
      }

Which will generate:

.. code-block:: c
   :linenos:

   #include <stdio.h>

   main()
   {
     printf("hello world");
   }

.. seealso::

   `Pygments Demo <http://pygments.org/demo/>`_ - A demo of the available syntax
   highlighting types.

Footnotes
^^^^^^^^^

Footnotes in their most simple form can be generated using ``[1]_`` in the text
and then a section of the bottom of the page as follows [1]_:

.. code-block:: rest

   .. rubric:: Footnotes

   .. [1] Like this

Which generates:

.. rubric:: Footnotes

.. [1] Like this

Notes, Warnings, Todo and See Also
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Notes, warnings and todos all take similar forms:

.. code-block:: rest

   .. note::
      This is a note

   .. warning::
      This is a warning

   .. todo::
      This is a todo

   .. seealso::
      This is a See Also

Which generates:

.. note::
   This is a note

.. warning::
   This is a warning

.. todo::
   This is a todo

.. seealso::
   This is a See Also

Summary
^^^^^^^

.. seealso::

   * `Sphinx documentation <http://sphinx.pocoo.org/contents.html>`_
   * `Openalea Sphinx Cheatsheet <http://openalea.gforge.inria.fr/doc/openalea/doc/_build/html/source/sphinx/rest_syntax.html>`_

Building Documentation
----------------------

The documentation is compiled from the ``.rst`` files during ``make``, but to
create HTML files from this you will need to run ``make html``.

To see other possible formats run ``make sphinx-help``.

Committing Documentation
------------------------

Documentation needs to be committed and merged in exactly the same way as
regular development files.  For more information on this please see the
:ref:`contributing code <code-label>` page.