Next: , Previous: Mixing Code and Documentation, Up: Documenting Your Code


3.11 Abbreviated Syntax

When you have many similar elements to document the traditional syntax can be somewhat cumbersome.

     Example: Constants documented one by one  
      1  const
      2    {** Constant: Black -- Black color }
      3    Black = 0;
      4
      5    {** Constant: Blue -- Blue color }
      6    Blue = 1;
      7
      8    {** Constant: Green -- Green color }
      9    Green = 2;
     10
     11    {** Constant: Yellow -- Yellow color }
     12    Yellow = 3;
     13
     14    {** Constant: Red -- Red color }
     15    Red = 4;

Using Elements header or one of its synonyms can save you some typing. A Elements header is used as a Sub Elements header except that the elements of the list that follows are not considered as of sub elements but as elements in the current level.

     Example: Constants documented using Elements  
      1  const
      2    {** Elements:
      3          - Black  -- Black color
      4          - Blue   -- Blue color
      5          - Green  -- Green color
      6          - Yellow -- Yellow color
      6          - Red    -- Red color   }
      7    Black = 0;
      8    Blue = 1;
      9    Green = 2;
     10    Yellow = 3;
     11    Red = 4;