# How to document your library
Odoc is built to produce documentation for your **libraries**, and the unit of organisation is the **module**. Documentation is written by putting special **doc comments** into the source of the **module** *or* **module interface**, and correctly placing these is critical to producing good output. Odoc expects the documentation to be structured in a logical way, and will work best if the following conventions are applied.
The overall structure is that modules start with a **preamble** or 'Lead Section' that serves as an overview of the most important information about module. This is followed by the content of the module, organised into **sections** and **subsections**, the structure of which will be used to populate a **table of contents** which will be placed immediately after the preamble.
The first paragraph of the preamble will be treated as the module **synopsis**, and will be used as a short description of the module when it appears in a list of modules elsewhere in the documentation of the library.