From 0e41903686fa805c2e0216d54913109fa79e1383 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Wed, 29 Apr 2020 12:49:43 -0400 Subject: [PATCH] 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. --- src/documentation.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/documentation.md b/src/documentation.md index 4060ecd..127454d 100644 --- a/src/documentation.md +++ b/src/documentation.md @@ -146,19 +146,25 @@ The unsafe [`std::ptr::read`] requires the following of the caller. ## Prose contains hyperlinks to relevant things (C-LINK) -Links to methods within the same type usually look like this: +Regular links can be added inline with the usual markdown syntax of +`[text](url)`. Links to other types can be added by marking them with +``[`text`]``, then adding the link target in a new line at the end of +the docstring with ``[`text`]: ``, where `` is +described below. + +Link targets to methods within the same type usually look like this: ```md [`serialize_struct`]: #method.serialize_struct ``` -Links to other types usually look like this: +Link targets to other types usually look like this: ```md [`Deserialize`]: trait.Deserialize.html ``` -Links may also point to a parent or child module: +Link targets may also point to a parent or child module: ```md [`Value`]: ../enum.Value.html