@@ -6,18 +6,18 @@ as well as examples and templates.
6
6
7
7
Use this checklist for documenting a function or a method:
8
8
9
- * Base description
10
- * Parameters
11
- * What this function returns (if nothing, write 'none')
12
- * Return type (if exists)
13
- * Possible errors (if exist)
14
- * Complexity factors (if exist)
15
- * Usage with memtx and vinyl (if differs)
16
- * Example(s)
17
- * Extra information (if needed)
9
+ * General description
10
+ * :ref: ` Parameters < documenting_parameters >`
11
+ * What this function returns (if nothing, write 'none')
12
+ * Return type (if exists)
13
+ * Possible errors (if exist)
14
+ * Complexity factors (if exist)
15
+ * Usage with memtx and vinyl (if differs)
16
+ * Example(s)
17
+ * Extra information (if needed)
18
18
19
19
Documenting functions
20
- ~~~~~~~~~~~~~~~~~~~~~
20
+ ---------------------
21
21
22
22
We use the Sphinx directives ``.. module:: ``
23
23
and ``.. function:: `` to describe functions of Tarantool modules:
@@ -29,8 +29,12 @@ The resulting output looks like this:
29
29
30
30
.. include :: ./_includes/function_template.rst
31
31
32
+ .. note ::
33
+
34
+ The best practices for :ref: `parameter description <documenting_parameters >` are listed below.
35
+
32
36
Documenting class methods and data
33
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37
+ ----------------------------------
34
38
35
39
Methods are described similarly to functions, but the ``.. class:: ``
36
40
directive, unlike ``.. module:: ``, requires nesting.
@@ -46,3 +50,52 @@ the method and data of the ``index_object`` class:
46
50
And the resulting output looks like this:
47
51
48
52
.. include :: ./_includes/class_template.rst
53
+
54
+ .. note ::
55
+
56
+ The best practices for :ref: `parameter description <documenting_parameters >` are listed below.
57
+
58
+ .. _documenting_parameters :
59
+
60
+ Parameters in functions and classes
61
+ -----------------------------------
62
+
63
+ This section explains how to document specific function or class method parameters as described above.
64
+ To learn how to document :doc: `configuration parameters </reference/configuration/index >`
65
+ passed to Tarantool via the command line or in an initialization file,
66
+ see the :ref: `next section <documenting_confvals >`.
67
+
68
+ For every function or class method parameter, list the following details:
69
+
70
+ * General description
71
+ * Type
72
+ * If optional, indicate *(optional) * in parentheses
73
+ * Default value (if optional), possible values
74
+
75
+ In the "Possible errors" section of the function or class method,
76
+ consider explaining what happens if the parameter hasn't been defined or has the wrong value.
77
+
78
+ .. _documenting_confvals :
79
+
80
+ Configuration parameters
81
+ ------------------------
82
+
83
+ For every configuration parameter, list the following details:
84
+
85
+ * Since which Tarantool version
86
+ * General description
87
+ * Type
88
+ * Corresponding environment variable (if applicable)
89
+ * Default value
90
+ * Possible values
91
+ * Dynamic (yes or no)
92
+
93
+ Example
94
+ ^^^^^^^
95
+
96
+ .. literalinclude :: ./_includes/confval_template.rst
97
+ :language: rst
98
+
99
+ Result:
100
+
101
+ .. include :: ./_includes/confval_template.rst
0 commit comments