# QLDoc specification¶

This document is a specification for QLDoc comments in QL source files.

## Notation¶

A ‘QLDoc comment’ is a valid QL comment that begins with /** and ends with */.

The ‘content’ of a QLDoc comment is the textual body of the comment, omitting the initial /**, the trailing */, and the leading whitespace followed by * on each internal line.

A QLDoc comment ‘precedes’ the next QL syntax element after it in the file.

## Association¶

A QLDoc comment may be ‘associated with’ any of the following QL syntax elements:

• Class declarations
• Predicate declarations
• Method declarations
• Modules

For class, method, and predicate declarations, the associated QLDoc comment (if any) is the closest preceding QLDoc comment.

For modules, the associated QLDoc comment (if any) is the QLDoc comment which is the first element in the file, and moreover is not associated with any other QL element.

## Inheritance¶

If a method has no directly associated QLDoc and overrides a set of methods which all have the same QLDoc, then the method inherits that QLDoc.

## Content¶

The content of a QLDoc comment is interpreted as standard Markdown, with the following extensions:

• Fenced code blocks using `s.