这是indexloc提供的服务,不要输入任何密码
Skip to content

Add links when referencing other chapters? #4535

@NeatNit

Description

@NeatNit
  • I have searched open and closed issues and pull requests for duplicates, using these search terms:
    • links to other chapters
    • (this is really hard to think of good keywords for)
  • I have checked the latest main branch to see if this has already been fixed, in this file:
    -/src/ch18-01-what-is-oo.md

In many occasions in the latter half of the book, previous listings are mentioned. This is one example:
https://doc.rust-lang.org/book/ch18-01-what-is-oo.html#inheritance-as-a-type-system-and-as-code-sharing

You can do this in a limited way in Rust code using default trait method implementations, which you saw in Listing 10-14 when we added a default implementation of the summarize method on the Summary trait.

(permalink)

If I want to see Listing 10-14 to reminds myself of its context, I would have to go looking for it. I know it's in Chapter 10, but which page? There are 3 (technically 4) where it could be.

Turns out it's in 10.2 Traits: Defining Shared Behavior.

Would it be too much work to add links to other chapters of the book when they are mentioned? Especially for listings, but not only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions