Skip to content

Commit 0e41903

Browse files
Add more explanatory text to the C-LINK section
The new text explains how to add regular markdown links and how to add link targets. In particular it makes it clear that rustdoc link targets go at the end of the docstring rather than inline.
1 parent 26999a3 commit 0e41903

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/documentation.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,25 @@ The unsafe [`std::ptr::read`] requires the following of the caller.
146146
<a id="c-link"></a>
147147
## Prose contains hyperlinks to relevant things (C-LINK)
148148

149-
Links to methods within the same type usually look like this:
149+
Regular links can be added inline with the usual markdown syntax of
150+
`[text](url)`. Links to other types can be added by marking them with
151+
``[`text`]``, then adding the link target in a new line at the end of
152+
the docstring with ``[`text`]: <target>``, where `<target>` is
153+
described below.
154+
155+
Link targets to methods within the same type usually look like this:
150156

151157
```md
152158
[`serialize_struct`]: #method.serialize_struct
153159
```
154160

155-
Links to other types usually look like this:
161+
Link targets to other types usually look like this:
156162

157163
```md
158164
[`Deserialize`]: trait.Deserialize.html
159165
```
160166

161-
Links may also point to a parent or child module:
167+
Link targets may also point to a parent or child module:
162168

163169
```md
164170
[`Value`]: ../enum.Value.html

0 commit comments

Comments
 (0)