Grouping
Automatic Grouping

Natural Docs will normally group things in the documentation by type.

    public void Function1 () { ... }
    public void Function2 () { ... }
    public void Function3 () { ... }
    public int Property1 { get }
    public int Property2 { get }
    public int variable1;
    public int variable2;

For this reason it's recommended that you group your code elements together in your source files, though many people already do that. However, you also have the option of manually controlling the grouping.

Manual Grouping

To manually make a group, use the Group keyword to create a standalone comment with the group name. You don't have to include a description if you don't want to.

    // Group: Number Functions
    public void Function1 () { ... }
    public void Function2 () { ... }

    // Group: Letter Functions
    public void FunctionA () { ... }
    public void FunctionB () { ... }

    // Group: Properties
    public int Property1 { get }
    public int Property2 { get }

    // Group: Variables
    public int variable1;
    public int variable2;

However, adding a group comment will turn off all automatic grouping for that class. If you were to only add the Number and Letter Functions groups above and not Properties or Variables, the result would look like this:

If you have multiple classes in the same source file you can have one be manually grouped and the other be automatic. The behavior is per-class, or if you're documenting globals, per-file.

Tips

Group comments can have descriptions if you want, though it's optional. Both of these are valid:

    // Group: Lock Functions
    // These functions manage the locks for thread safety.

    // Group: Support Functions

You can also use them to group things by access level:

    // Group: Public Functions

    // Group: Protected Functions

Since Natural Docs can detect and remove lines, another thing you can do is add horizontal lines to better depict the separation when scrolling through your source files:

    // Group: Functions
    // _____________________________________

    public void Function1 () { ... }
    public void Function2 () { ... }

    // Group: Properties
    // _____________________________________

    public int Property1 { get }
    public int Property2 { get }

Next: Styles