Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix references links #33759

Merged
merged 2 commits into from
May 25, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/doc/book/primitive-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,10 @@ and a length.
## Slicing syntax

You can use a combo of `&` and `[]` to create a slice from various things. The
`&` indicates that slices are similar to [references], which we will cover in
`&` indicates that slices are similar to [references][references], which we will cover in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should actually be identical in Markdown, and I prefer this style. Can you revert these two changes, and just leave the deletion on 178? Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the [references] style cannot be convert to PDF/LaTex correctly with Pandoc. And the converted result is still [references] in the LaTex source instead of references with a link reference.

If it's [references][references] or references][] as defined in the Markdown Syntax, the Pandoc tools can convert it to LaTex or PDF correctly.

Copy link
Contributor Author

@aaranxu aaranxu May 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found that it was the trpl-ebook that could not tell the [references] style. If I use Pandoc to convert the articles to PDF or Tex format directly, it will get the right result regardless of [references], [references][] or [references][references].

Copy link
Member

@nagisa nagisa May 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CommonMark, which pandoc is supposed to implement explicitly allows this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@steveklabnik I have reverted these two changes. Thanks so much!

detail later in this section. The `[]`s, with a range, let you define the
length of the slice:

[references]: references-and-borrowing.html

```rust
let a = [0, 1, 2, 3, 4];
let complete = &a[..]; // A slice containing all of the elements in a
Expand All @@ -198,7 +196,7 @@ documentation][slice].
Rust’s `str` type is the most primitive string type. As an [unsized type][dst],
it’s not very useful by itself, but becomes useful when placed behind a
reference, like `&str`. We'll elaborate further when we cover
[Strings][strings] and [references].
[Strings][strings] and [references][references].

[dst]: unsized-types.html
[strings]: strings.html
Expand Down