Skip to content

Commit 1176a6c

Browse files
Merge pull request #241 from Havvy/fix-spacing
Add parenthetical css class and use in paths.md
2 parents 66ed411 + 7a979df commit 1176a6c

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

src/paths.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Paths
22

33
A *path* is a sequence of one or more path components _logically_ separated by
4-
a namespace qualifier (`::`). If a path consists of only one component, it
5-
refers to either an [item] or a [variable] in a local control
6-
scope. If a path has multiple components, it always refers to an item.
4+
a namespace <span class="parenthetical">qualifier (`::`)</span>. If a path
5+
consists of only one component, it refers to either an [item] or a [variable] in
6+
a local control scope. If a path has multiple components, it always refers to an
7+
item.
78

89
Two examples of simple paths consisting of only identifier components:
910

@@ -15,8 +16,9 @@ x::y::z;
1516
Path components are usually [identifiers], but they may also include
1617
angle-bracket-enclosed lists of type arguments. In [expression] context, the
1718
type argument list is given after a `::` namespace qualifier in order to
18-
disambiguate it from a relational expression involving the less-than symbol
19-
(`<`). In type expression context, the final namespace qualifier is omitted.
19+
disambiguate it from a relational expression involving the less-than
20+
<span class="parenthetical">symbol (`<`)</span>. In type expression context, the
21+
final namespace qualifier is omitted.
2022

2123
Two examples of paths with type arguments:
2224

@@ -110,9 +112,10 @@ bound on a type parameter, do not have canonical paths.
110112

111113
The path prefix for modules is the canonical path to that module. For bare
112114
implementations, it is the canonical path of the item being implemented
113-
surrounded by angle (`<>`) brackets. For trait implementations, it is the
114-
canonical path of the item being implemented followed by `as` followed by the
115-
canonical path to the trait all surrounded in angle (`<>`) brackets.
115+
surrounded by <span class="parenthetical">angle (`<>`)</span> brackets. For
116+
trait implementations, it is the canonical path of the item being implemented
117+
followed by `as` followed by the canonical path to the trait all surrounded in
118+
<span class="parenthetical">angle (`<>`)</span> brackets.
116119

117120
The canonical path is only meaningful within a given crate. There is no global
118121
namespace across crates; an item's canonical path merely identifies it within

src/theme/reference.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,14 @@ p.warning a {
4747

4848
a .hljs {
4949
color: #4183c4;
50+
}
51+
52+
/*
53+
.parenthetical class used to keep e.g. "less-than symbol (<)" from wrapping
54+
the end parenthesis onto its own line. Use in a span between the last word and
55+
the parenthetical. So for this example, you'd use
56+
```less-than <span class="parenthetical">symbol (`<`)</span>```
57+
*/
58+
.parenthetical {
59+
white-space: nowrap;
5060
}

0 commit comments

Comments
 (0)