@@ -80,6 +80,16 @@ it should also be possible to write a Rust path
80
80
and somewhere else in the document: ` [iter]: std::iter::Iterator `
81
81
3 . ` <std::iter::Iterator> `
82
82
83
+ All additions are already valid Markdown,
84
+ as defined by the orginal [ Markdown syntax definition] [ md ]
85
+ as well as the [ CommonMark] project.
86
+ Especially, Rust paths are valid CommonMark [ link destinations] ,
87
+ even with the suffixes described [ below] [ path-ambiguities ] .
88
+
89
+ [ md ] : https://daringfireball.net/projects/markdown/syntax
90
+ [ CommonMark ] : http://commonmark.org
91
+ [ link destinations ] : http://spec.commonmark.org/0.27/#link-destination
92
+
83
93
## How it will be rendered
84
94
85
95
The following:
@@ -146,6 +156,7 @@ mod amet {
146
156
```
147
157
148
158
## Path ambiguities
159
+ [ path-ambiguities ] : #path-ambiguities
149
160
150
161
Rust allows items to have the same name. A short evaluation revealed that
151
162
@@ -271,9 +282,29 @@ Maybe present an example use case of a module whose documentation links to sever
271
282
# Alternatives
272
283
[ alternatives ] : #alternatives
273
284
274
- ## Syntax alternatives
285
+ - Use reference-style links and automatically generate the references.
286
+ For example, the Markdown snippet
287
+
288
+ ``` md
289
+ This is of type [`String`].
290
+ ```
291
+
292
+ expects a link reference definition like
275
293
276
- Introduce special syntax for this:
294
+ ``` md
295
+ [`String`]: https://doc.rust-lang.org/nightly/std/string/struct.String.html
296
+ ```
297
+
298
+ to follow (or precede) it.
299
+ This link reference definition can be automatially generated by Rustdoc
300
+ with the (relative) URL to the page of the item.
301
+ This was suggested in [ the CommonMark forum]
302
+ as well as
303
+ by [ GuillaumeGomez] ( https://github.com/GuillaumeGomez ) .
304
+
305
+ We consider this equivalent to the ` <String> ` syntax this RFC proposes.
306
+
307
+ [ cm-forum ] : https://talk.commonmark.org/t/what-should-the-rust-community-do-for-linkage/2141
277
308
278
309
- [ javadoc] and [ jsdoc]
279
310
use ` {@link java.awt.Panel} `
@@ -282,6 +313,10 @@ Introduce special syntax for this:
282
313
[ javadoc ] : http://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html
283
314
[ jsdoc ] : http://usejsdoc.org/tags-inline-link.html
284
315
316
+ - [ @kennytm ] ( https://github.com/kennytm )
317
+ listed other syntax alternatives
318
+ [ here] ( https://github.com/rust-lang/rfcs/pull/1946#issuecomment-284718018 ) .
319
+
285
320
286
321
# Unresolved questions
287
322
[ unresolved ] : #unresolved-questions
0 commit comments