Conditional content in MyST

The MyST forms of the specimens on Conditional content, each rendered live by this page’s own Markdown parser.

Builder tags

Builder tags

```{only} html
Every build of this site shows this line.
```

```{only} not ubc
You are reading the Sphinx build.
```

```{only} ubc and not pdf
You are reading the `ubc build html` build.
```

```{only} pdf
You are reading the `ubc build pdf` build.
```

Every build of this site shows this line.

You are reading the Sphinx build.

Variant conditions

Variant conditions

```{if} var.stage == "review"
Shown while the `stage` is `review`.
```

```{if} var.stage == "published"
Left out until the `stage` is `published`.
```

Shown while the stage is review.

One branch of several

One branch of several

````{choose}
```{when} var.stage == "draft"
Drafting: nothing is reviewed yet.
```

```{when} var.stage == "review"
In review: this branch is the one taken.
```

```{otherwise}
Published.
```
````

In review: this branch is the one taken.

Raw output for one format

Raw HTML

```{raw} html
<p>Press <kbd>Ctrl</kbd> + <kbd>S</kbd> to save the page.</p>
```

Press Ctrl + S to save the page.