Documenting a Variable

CMinx supports documenting variables. The process is identical to documenting a function or macro, except that the documentation comment precedes a set command. An example:

#[[[
# This is an example of variable documentation.
# This variable is a list of string values.
#]]
set(MyList "Value" "Value 2")


#[[[
# This is an example of variable documentation.
# This variable is a single string value
#]]
set(MyList "Value")

#[[[
# This is an example of variable documentation.
# This is an UNSET declaration
#]]
set(MyList)

which generates:

#####################
test_samples.variable
#####################

.. module:: test_samples.variable


.. data:: MyList

   This is an example of variable documentation.
   This variable is a list of string values.
   

   :Default value: "Value" "Value 2"

   :type: list


.. data:: MyList

   This is an example of variable documentation.
   This variable is a single string value
   

   :Default value: Value

   :type: str


.. data:: MyList

   This is an example of variable documentation.
   This is an UNSET declaration
   

   :Default value: None

   :type: UNSET