Skip to content

Commit 759b60c

Browse files
committed
doc (book)[04/14]: "Getting Started"/"First Steps...": add intro blurb
In the "First Steps with Cargo" section, add a short introductory paragraph informing the reader what to expect from the page. This provides a transition for the reader who may not yet know what a package is. Rather than jump right into "To start a new package with Cargo, ...", we now set the context for the purpose of the page, and also provide hyperlinks into our Glossary for the terms 'package', 'manifest', and 'crate'.
1 parent 4da7c38 commit 759b60c

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/doc/src/getting-started/first-steps.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
## First Steps with Cargo
22

3+
This section provides a quick sense for the `cargo` command line tool. We
4+
demonstrate its ability to generate a new [***package***][def-package] for us,
5+
its ability to compile the [***crate***][def-crate] within the package, and
6+
its ability to run the resulting program.
7+
38
To start a new package with Cargo, use `cargo new`:
49

510
```console
611
$ cargo new hello_world
712
```
813

9-
Cargo defaults to `--bin` to make a binary program. To make a library, we'd
10-
pass `--lib`.
14+
Cargo defaults to `--bin` to make a binary program. To make a library, we
15+
would pass `--lib`, instead.
1116

1217
Let’s check out what Cargo has generated for us:
1318

@@ -34,8 +39,8 @@ edition = "2018"
3439
[dependencies]
3540
```
3641

37-
This is called a **manifest**, and it contains all of the metadata that Cargo
38-
needs to compile your package.
42+
This is called a [***manifest***][def-manifest], and it contains all of the
43+
metadata that Cargo needs to compile your package.
3944

4045
Here’s what’s in `src/main.rs`:
4146

@@ -45,7 +50,8 @@ fn main() {
4550
}
4651
```
4752

48-
Cargo generated a “hello world” for us. Let’s compile it:
53+
Cargo generated a “hello world” program for us, otherwise known as a
54+
[***binary crate***][def-crate]. Let’s compile it:
4955

5056
```console
5157
$ cargo build
@@ -71,3 +77,7 @@ Hello, world!
7177
### Going further
7278

7379
For more details on using Cargo, check out the [Cargo Guide](../guide/index.md)
80+
81+
[def-crate]: ../appendix/glossary.md#crate '"crate" (glossary entry)'
82+
[def-manifest]: ../appendix/glossary.md#manifest '"manifest" (glossary entry)'
83+
[def-package]: ../appendix/glossary.md#package '"package" (glossary entry)'

0 commit comments

Comments
 (0)