<a id="reference-markup-label"></a>

# Markup

A *markup block* is a freeform text annotation written in Markdown. Markup blocks support
basic text formatting and can embed traceable references to other entities in the
specification.

A markup block appears in two positions:

* As the **body of a requirement** — placed after the `is` keyword, making the
  requirement informal (see [Requirement](entity.md#reference-requirement-label)).
* As a **standalone annotation** on any entity — placed before the entity keyword, it
  serves as freeform rationale or commentary.

**Syntax**

```none
@@ <RICH_TEXT|REFERENCE>* @@
```

**Example — annotation and informal requirement body**

```req
package Aircraft
  @@
    The **main propulsion unit** of the aircraft. Its constraints start at
    [[Aircraft::Engine_thrust]].
  @@
  part Engine
    let max_thrust in real \ N \
  part

  requirement Engine_thrust top
    on Engine
  is
    @@
      The [[Engine]] thrust shall stay within the structural limits.
    @@
  requirement

  requirement Thrust_bound bottom
    on Engine::max_thrust
    refines Engine_thrust
  is
    @@
      The [[Engine::max_thrust]] shall not exceed the structural limit
      at any operating altitude.
    @@
  requirement
package
```

## Format

### Rich Text

The body of a markup block is written in Markdown, conforming to the
[CommonMark](https://commonmark.org/) specification.

Commonly used formatting elements include:

* Emphasis: `*text*` or `_text_`
* Strong: `**text**`
* Headings: `# Heading`
* Inline code: \`\` code \`\`
* Unordered list: `- item`
* Maths (LatEx): `$ math $`

#### NOTE
Not all CommonMark elements may be supported by every output format. Consult the
documentation of the tool you use for rendering details.

### Reference

A *reference* embeds a traceable link to another entity directly within a markup block.
The target is identified by its path (see [Reference](entity.md#reference-reference-label)). A reference can also name a
member of a [type](entity.md#reference-type-label), `[[Door_state::closed]]`: it then links to the type.

**Syntax**

```none
[[PATH]]
```

A reference is written on a single line. Its path is made of letters, digits, `_`, `-`
and `:`, and contains no space. Any `[[` that does not start a valid reference, such as
`[[a b]]`, `[[]]` or a `[[` that is not closed on the same line, is ordinary text and
is not an error. So are the characters `{` and `}`, which can be used freely, for
instance in LaTeX (`\frac{a}{b}`).

Two references written next to each other, `[[a]][[b]]`, are two references.

#### ATTENTION
Escape sequences for a literal `@@` or for a literal `[[PATH]]` within a markup body
are not yet specified.
