Skip to content

Commit

Permalink
add trait@, union@, value@, macro@
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Jan 19, 2018
1 parent 8f5be35 commit 46204f1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion text/1946-intra-rustdoc-links.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,16 +300,28 @@ Our proposal is this:
e.g., `See [type@foo]`.
- Links to modules can be prefixed with `mod@`,
e.g., `See [mod@foo]`.
- Links to traits can be prefixed with `trait@`,
e.g., `See [trait@foo]`.
- Links to unions can be prefixed with `union@`,
e.g., `See [union@foo]`.
- It does not actually matter which disambiguator you use, so you can also
just use `type@foo` for all type-namespace objects
(structs, enums, types, mods, traits, unions)
- In links to macros,
the link label _must_ end with a `!`,
e.g., `Look at the [FOO!] macro`.
e.g., `Look at the [FOO!] macro`. You can alternatively use a `foo@` prefix,
e.g. `[macro@foo]`
- For disambiguating links to values, we differentiate three cases:
- Links to any kind of value can be prefixed with `value@`,
e.g., `See [value@foo]`.
- Links to functions can be written with a `()` suffix,
e.g., `Also see the [foo()] function`.
- Links to constants are prefixed with `const@`,
e.g., `As defined in [const@FOO].`
- Links to statics are prefixed with `static@`,
e.g., `See [static@FOO]`.
- Again, it does not matter which disambiguator gets used, provided it
is in the value namespace (const, static, functions)

For disambiguation markers using an `@`, in implied shortcut links
you can use a space instead of the `@`. In other words, `[struct Foo]`
Expand Down

0 comments on commit 46204f1

Please sign in to comment.