Skip to content
Open
Changes from all commits
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
33 changes: 19 additions & 14 deletions src/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,44 +63,49 @@ That said, there is no wrong way to read this book. Read it however you feel hel
Like all technical books, this book has certain conventions in how it displays information.
These conventions are documented here.

* Statements that define a term contain that term in *italics*.
Whenever that term is used outside of that chapter, it is usually a link to the section that has this definition.
* Statements that define a term write that term in italics:

An *example term* is an example of a term being defined.
> A *crab* is an animal with ten legs and a shell.

Whenever that term is used outside of that chapter, it is usually a link to the section that has this definition:

> Rust uses a pictogram of a [crab](#) as its logo.

* The main text describes the latest stable edition. Differences to previous editions are separated in edition blocks:

> [!EDITION-2018]
> Before the 2018 edition, the behavior was this. As of the 2018 edition, the behavior is that.

* Notes that contain useful information about the state of the book or point out useful, but mostly out of scope, information are in note blocks.
* Notes that contain useful information about the state of the book or point out useful, but mostly out of scope, information are in note blocks:

> [!NOTE]
> This is an example note.

* Example blocks show an example that demonstrates some rule or points out some interesting aspect. Some examples may have hidden lines which can be viewed by clicking the eye icon that appears when hovering or tapping the example.
* Example blocks show an example that demonstrates some rule or points out some interesting aspect. Some examples may have hidden lines which can be viewed by clicking the eye icon that appears when hovering or tapping the example:

> [!EXAMPLE]
> This is a code example.
> ```rust
> println!("hello world");
> ```

* Warnings that show unsound behavior in the language or possibly confusing interactions of language features are in a special warning box.
* Warnings that show unsound behavior in the language or possibly confusing interactions of language features are in a special warning box:

> [!WARNING]
> This is an example warning.

* Code snippets inline in the text are inside `<code>` tags.
* Code snippets inline in the text are inside `<code>` tags:

> To print to the console use the `println!` macro.

Longer code examples are in a syntax highlighted box that has controls for copying, executing, and showing hidden lines in the top right corner.
Longer code examples are in a syntax highlighted box that has controls for copying, executing, and showing hidden lines in the top right corner:

```rust
# // This is a hidden line.
fn main() {
println!("This is a code example");
}
```
> ```rust
> # // This is a hidden line.
> fn main() {
> println!("This is a code example");
> }
> ```

All examples are written for the latest edition unless otherwise stated.

Expand Down