Skip to content

Commit d61f9ff

Browse files
committed
doc/dev/config: Document how to use :confval: directive for config options
Add comprehensive guide for documenting configuration options using the :confval: directive, including naming conventions and cross-referencing. Previously, the documentation lacked guidance on using the :confval: directive and the important distinction between regular config options and mgr module options (which require the mgr/<module>/ namespace prefix). This change provides detailed examples and best practices for properly documenting and referencing both types of configuration options. Signed-off-by: Kefu Chai <[email protected]>
1 parent 0e4eb99 commit d61f9ff

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

doc/dev/config.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,3 +281,52 @@ Flags
281281
.. describe:: create
282282

283283
option only affects daemon creation
284+
285+
Documentation of Configuration Values
286+
=====================================
287+
288+
Ceph configuration options are documented on-demand using the ``:confval:``
289+
directive rather than in a centralized location.
290+
291+
Documenting Configuration Options
292+
---------------------------------
293+
294+
To document a configuration option, use the ``:confval:`` directive:
295+
296+
.. code-block:: rst
297+
298+
The check interval can be customized by the ``check_interval`` option:
299+
300+
.. confval:: mgr/inbox/check_interval
301+
302+
.. note::
303+
Ceph-mgr module options must include the ``mgr/<module>/``
304+
namespace prefix. In the example above, ``check_interval`` belongs to the
305+
``inbox`` module, so it's documented as ``mgr/inbox/check_interval``.
306+
307+
Referencing Configuration Options
308+
---------------------------------
309+
310+
Once documented, reference options using the ``:confval:`` role:
311+
312+
.. code-block:: rst
313+
314+
With the :confval:`mgr/inbox/check_interval` setting, you can customize the
315+
check interval.
316+
317+
For regular Ceph options (non-mgr modules), the process is the same but without the module prefix:
318+
319+
.. code-block:: rst
320+
321+
You can set the initial monitor members with :confval:`mon_initial_members`:
322+
323+
.. confval:: mon_initial_members
324+
325+
Naming Conventions
326+
------------------
327+
328+
* **Mgr module options**: Use ``mgr/<module>/<option_name>`` format
329+
* **Regular options**: Use the option name directly (e.g., ``mon_initial_members``)
330+
331+
This approach ensures consistent cross-referencing throughout the documentation
332+
while maintaining proper namespacing for different configuration contexts.

0 commit comments

Comments
 (0)