RST Documentation Trick for reference links

Matthew Pickering matthewtpickering at gmail.com
Fri Jul 1 11:14:56 UTC 2022


Hello,

I noticed myself writing things like:

```
and enable the eventlog using :rts-flag:`-l ⟨flags⟩`.
```

When in fact what I wanted was to create a link the eventlog options
but render the link as just -l rather than -l <flags>.. but I thought
I had to write the whole thing to get the linter to not complain.

It turns out can achieve this goal using the following syntax:

```
and enable the eventlog using :rts-flag:`-l <-l ⟨flags⟩>`.
```

ie, include the thing you actually want to reference in angular
brackets < > and the text you want to render before that.

Yet another thing which has changed my life for good.

Cheers,

Matt


More information about the ghc-devs mailing list