## Documentation annotations

Documentation can be added to all elements of the specification that support annotations:

    @doc("The lower limit sensor of the elevator.")
    @doc("Safety sensor.")
    input bool ElevatorDownSensor;

The documentation may span multiple lines, by using explicit newline characters:

    @doc(
        "doc with multiple\n" +
        "lines of\n" +
        "text"
    )
    input bool i;

This also may be abbreviated as follows, by using multiple arguments:

    @doc(
        "doc with multiple",
        "lines of",
        "text",
    )
    input bool i;

It is also possible to use for instance constants from the model in the documentation text:

    const int MAX_NR_OF_PRODUCTS = 3;

    @doc(fmt("Sensor 1/%d.", MAX_NR_OF_PRODUCTS))
    input bool s1;

This documentation can then be used by CIF tools in various ways. For instance, if the CIF code generator is used to generate Java code for the above example, then the documentation is included in the generated code:

    /**
     * Input variable "ElevatorDownSensor".
     *
     * <p>
     * The lower limit sensor of the elevator.
     * </p>
     *
     * <p>
     * Safety sensor.
     * </p>
     */
    public boolean ElevatorDownSensor;

For more detailed information on documentation annotations, see the reference manual.