# Code Formatting Preferences Page

This page of the Preferences dialogue box is used to configure the format of source code that CodeSnip writes to file or copies to the clipboard. The page is accessed by selecting the Tools | Preferences menu item then clicking on Code Formatting in the list on the left of the window.

## Source code formatting

Descriptions of snippets can be included as comments in generated source code. The placing of such comments can be customised using the Commenting style drop down list. Options are:

- No descriptive comments – descriptions are not included.
- Comments after snippet header – comments appear between a snippet's header and the body of the snippet. For functions and procedures the header is the function or procedure prototype. For types and constants the comment is placed after the type or const keyword and before any other code.
- Comments before snippet – comments are placed before the snippet. The snippet's name is included in the comment.

A preview of the commenting style is displayed below the drop down list.

Some snippets have multi-paragraph descriptions, all of which normally appear in the snippet's comment in generated code. You can limit the comment to use just the first paragraph of the snippet's description by ticking the Truncate comments to one paragraph check box.

Note: Descriptive comments are not applicable to freeform or unit snippets.

## File formatting

The default format of output files is configurable. The available output types are HTML, rich text and two types of unformatted text, i.e. Pascal files and plain text files. You choose the default output type using the Output file type drop down list.

HTML and rich text file types can be syntax highlighted. To enable this option check the Enable syntax highlighting check box. The highlighting can be customised using the Syntax Highlighter preferences page.

You can override the default format when saving source code to file by choosing a different format in the save dialogue box.