Skip to content

Commit d619310

Browse files
committed
Auto merge of #12595 - weihanglo:doc-headings, r=epage
doc: adjust all doc headings one level up
2 parents 774161b + b68ed8a commit d619310

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+491
-493
lines changed

src/doc/src/appendix/glossary.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
# Glossary
22

3-
### Artifact
3+
## Artifact
44

55
An *artifact* is the file or set of files created as a result of the
66
compilation process. This includes linkable libraries, executable binaries,
77
and generated documentation.
88

9-
### Cargo
9+
## Cargo
1010

1111
*Cargo* is the Rust [*package manager*](#package-manager), and the primary
1212
topic of this book.
1313

14-
### Cargo.lock
14+
## Cargo.lock
1515

1616
See [*lock file*](#lock-file).
1717

18-
### Cargo.toml
18+
## Cargo.toml
1919

2020
See [*manifest*](#manifest).
2121

22-
### Crate
22+
## Crate
2323

2424
A Rust *crate* is either a library or an executable program, referred to as
2525
either a *library crate* or a *binary crate*, respectively.
@@ -32,14 +32,14 @@ compressed package fetched from a [registry](#registry).
3232

3333
The source code for a given crate may be subdivided into [*modules*](#module).
3434

35-
### Edition
35+
## Edition
3636

3737
A *Rust edition* is a developmental landmark of the Rust language. The
3838
[edition of a package][edition-field] is specified in the `Cargo.toml`
3939
[manifest](#manifest), and individual targets can specify which edition they
4040
use. See the [Edition Guide] for more information.
4141

42-
### Feature
42+
## Feature
4343

4444
The meaning of *feature* depends on the context:
4545

@@ -58,32 +58,32 @@ The meaning of *feature* depends on the context:
5858
- CPU targets have [*target features*][target-feature] which specify
5959
capabilities of a CPU.
6060

61-
### Index
61+
## Index
6262

6363
The *index* is the searchable list of [*crates*](#crate) in a
6464
[*registry*](#registry).
6565

66-
### Lock file
66+
## Lock file
6767

6868
The `Cargo.lock` *lock file* is a file that captures the exact version of
6969
every dependency used in a [*workspace*](#workspace) or
7070
[*package*](#package). It is automatically generated by Cargo. See
7171
[Cargo.toml vs Cargo.lock].
7272

73-
### Manifest
73+
## Manifest
7474

7575
A [*manifest*][manifest] is a description of a [package](#package) or a
7676
[workspace](#workspace) in a file named `Cargo.toml`.
7777

7878
A [*virtual manifest*][virtual] is a `Cargo.toml` file that only describes a
7979
workspace, and does not include a package.
8080

81-
### Member
81+
## Member
8282

8383
A *member* is a [*package*](#package) that belongs to a
8484
[*workspace*](#workspace).
8585

86-
### Module
86+
## Module
8787

8888
Rust's module system is used to organize code into logical units called
8989
*modules*, which provide isolated namespaces within the code.
@@ -98,7 +98,7 @@ A [`Cargo.toml`](#manifest) file is primarily concerned with the
9898
which they depend. Nevertheless, you will see the term "module" often when
9999
working with Rust, so you should understand its relationship to a given crate.
100100

101-
### Package
101+
## Package
102102

103103
A *package* is a collection of source files and a `Cargo.toml`
104104
[*manifest*](#manifest) file which describes the package. A package has a name
@@ -123,7 +123,7 @@ Larger projects may involve multiple packages, in which case Cargo
123123
[*workspaces*](#workspace) can be used to manage common dependencies and other
124124
related metadata between the packages.
125125

126-
### Package manager
126+
## Package manager
127127

128128
Broadly speaking, a *package manager* is a program (or collection of related
129129
programs) in a software ecosystem that automates the process of obtaining,
@@ -139,15 +139,15 @@ downloads your Rust [package](#package)’s dependencies
139139
packages, makes distributable packages, and (optionally) uploads them to
140140
[crates.io][], the Rust community’s [*package registry*](#registry).
141141

142-
### Package registry
142+
## Package registry
143143

144144
See [*registry*](#registry).
145145

146-
### Project
146+
## Project
147147

148148
Another name for a [package](#package).
149149

150-
### Registry
150+
## Registry
151151

152152
A *registry* is a service that contains a collection of downloadable
153153
[*crates*](#crate) that can be installed or used as dependencies for a
@@ -156,7 +156,7 @@ A *registry* is a service that contains a collection of downloadable
156156
contains a list of all crates, and tells Cargo how to download the crates that
157157
are needed.
158158

159-
### Source
159+
## Source
160160

161161
A *source* is a provider that contains [*crates*](#crate) that may be included
162162
as dependencies for a [*package*](#package). There are several kinds of
@@ -174,11 +174,11 @@ sources:
174174

175175
See [Source Replacement] for more information.
176176

177-
### Spec
177+
## Spec
178178

179179
See [package ID specification](#package).
180180

181-
### Target
181+
## Target
182182

183183
The meaning of the term *target* depends on the context:
184184

@@ -216,7 +216,7 @@ The meaning of the term *target* depends on the context:
216216
Some parameters may be omitted. Run `rustc --print target-list` for a list of
217217
supported targets.
218218

219-
### Test Targets
219+
## Test Targets
220220

221221
Cargo *test targets* generate binaries which help verify proper operation and
222222
correctness of code. There are two types of test artifacts:
@@ -232,7 +232,7 @@ correctness of code. There are two types of test artifacts:
232232
`Cargo.toml` [*manifest*](#manifest). It is intended to only test the public
233233
API of a library, or execute a binary to verify its operation.
234234

235-
### Workspace
235+
## Workspace
236236

237237
A [*workspace*][workspace] is a collection of one or more
238238
[*packages*](#package) that share common dependency resolution (with a shared

src/doc/src/faq.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## Frequently Asked Questions
1+
# Frequently Asked Questions
22

3-
### Is the plan to use GitHub as a package repository?
3+
## Is the plan to use GitHub as a package repository?
44

55
No. The plan for Cargo is to use [crates.io], like npm or Rubygems do with
66
[npmjs.com][1] and [rubygems.org][3].
@@ -9,7 +9,7 @@ We plan to support git repositories as a source of packages forever,
99
because they can be used for early development and temporary patches,
1010
even when people use the registry as the primary source of packages.
1111

12-
### Why build crates.io rather than use GitHub as a registry?
12+
## Why build crates.io rather than use GitHub as a registry?
1313

1414
We think that it’s very important to support multiple ways to download
1515
packages, including downloading from GitHub and copying packages into
@@ -43,7 +43,7 @@ languages include:
4343
down fast. Also remember that not everybody has a high-speed,
4444
low-latency Internet connection.
4545

46-
### Will Cargo work with C code (or other languages)?
46+
## Will Cargo work with C code (or other languages)?
4747

4848
Yes!
4949

@@ -56,7 +56,7 @@ Our solution: Cargo allows a package to [specify a script](reference/build-scrip
5656
implement platform-specific configuration and refactor out common build
5757
functionality among packages.
5858

59-
### Can Cargo be used inside of `make` (or `ninja`, or ...)
59+
## Can Cargo be used inside of `make` (or `ninja`, or ...)
6060

6161
Indeed. While we intend Cargo to be useful as a standalone way to
6262
compile Rust packages at the top-level, we know that some people will
@@ -68,7 +68,7 @@ have some work to do on those fronts, but using Cargo in the context of
6868
conventional scripts is something we designed for from the beginning and
6969
will continue to prioritize.
7070

71-
### Does Cargo handle multi-platform packages or cross-compilation?
71+
## Does Cargo handle multi-platform packages or cross-compilation?
7272

7373
Rust itself provides facilities for configuring sections of code based
7474
on the platform. Cargo also supports [platform-specific
@@ -80,7 +80,7 @@ configuration in `Cargo.toml` in the future.
8080
In the longer-term, we’re looking at ways to conveniently cross-compile
8181
packages using Cargo.
8282

83-
### Does Cargo support environments, like `production` or `test`?
83+
## Does Cargo support environments, like `production` or `test`?
8484

8585
We support environments through the use of [profiles] to support:
8686

@@ -92,7 +92,7 @@ We support environments through the use of [profiles] to support:
9292
* environment-specific `#[cfg]`
9393
* a `cargo test` command
9494

95-
### Does Cargo work on Windows?
95+
## Does Cargo work on Windows?
9696

9797
Yes!
9898

@@ -102,7 +102,7 @@ issue][cargo-issues].
102102

103103
[cargo-issues]: https://github.com/rust-lang/cargo/issues
104104

105-
### Why have `Cargo.lock` in version control?
105+
## Why have `Cargo.lock` in version control?
106106

107107
While [`cargo new`] defaults to tracking `Cargo.lock` in version control,
108108
whether you do is dependent on the needs of your package.
@@ -144,7 +144,7 @@ see [Verifying Latest Dependencies](guide/continuous-integration.md#verifying-la
144144
[`cargo add`]: commands/cargo-add.md
145145
[`cargo install`]: commands/cargo-install.md
146146

147-
### Can libraries use `*` as a version for their dependencies?
147+
## Can libraries use `*` as a version for their dependencies?
148148

149149
**As of January 22nd, 2016, [crates.io] rejects all packages (not just libraries)
150150
with wildcard dependency constraints.**
@@ -154,7 +154,7 @@ of `*` says “This will work with every version ever”, which is never going
154154
to be true. Libraries should always specify the range that they do work with,
155155
even if it’s something as general as “every 1.x.y version”.
156156

157-
### Why `Cargo.toml`?
157+
## Why `Cargo.toml`?
158158

159159
As one of the most frequent interactions with Cargo, the question of why the
160160
configuration file is named `Cargo.toml` arises from time to time. The leading
@@ -172,7 +172,7 @@ but others were accidentally forgotten.
172172

173173
[crates.io]: https://crates.io/
174174

175-
### How can Cargo work offline?
175+
## How can Cargo work offline?
176176

177177
Cargo is often used in situations with limited or no network access such as
178178
airplanes, CI environments, or embedded in large production deployments. Users
@@ -216,7 +216,7 @@ replacement][replace].
216216
[`cargo fetch`]: commands/cargo-fetch.md
217217
[offline config]: reference/config.md#netoffline
218218

219-
### Why is Cargo rebuilding my code?
219+
## Why is Cargo rebuilding my code?
220220

221221
Cargo is responsible for incrementally compiling crates in your project. This
222222
means that if you type `cargo build` twice the second one shouldn't rebuild your
@@ -274,7 +274,7 @@ If after trying to debug your issue, however, you're still running into problems
274274
then feel free to [open an
275275
issue](https://github.com/rust-lang/cargo/issues/new)!
276276

277-
### What does "version conflict" mean and how to resolve it?
277+
## What does "version conflict" mean and how to resolve it?
278278

279279
> failed to select a version for `x` which could resolve this conflict
280280

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## First Steps with Cargo
1+
# First Steps with Cargo
22

33
This section provides a quick sense for the `cargo` command line tool. We
44
demonstrate its ability to generate a new [***package***][def-package] for us,
@@ -73,7 +73,7 @@ $ cargo run
7373
Hello, world!
7474
```
7575

76-
### Going further
76+
## Going further
7777

7878
For more details on using Cargo, check out the [Cargo Guide](../guide/index.md)
7979

src/doc/src/getting-started/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Getting Started
1+
# Getting Started
22

33
To get started with Cargo, install Cargo (and Rust) and set up your first
44
[*crate*][def-crate].

src/doc/src/getting-started/installation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## Installation
1+
# Installation
22

3-
### Install Rust and Cargo
3+
## Install Rust and Cargo
44

55
The easiest way to get Cargo is to install the current stable release of [Rust]
66
by using [rustup]. Installing Rust using `rustup` will also install `cargo`.
@@ -27,7 +27,7 @@ channels for Rust and Cargo.
2727
For other installation options and information, visit the
2828
[install][install-rust] page of the Rust website.
2929

30-
### Build and Install Cargo from Source
30+
## Build and Install Cargo from Source
3131

3232
Alternatively, you can [build Cargo from source][compiling-from-source].
3333

src/doc/src/guide/build-cache.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Build cache
1+
# Build cache
22

33
Cargo stores the output of a build into the "target" directory. By default,
44
this is the directory named `target` in the root of your
@@ -63,7 +63,7 @@ Directory | Description
6363
<code style="white-space: nowrap">target/debug/incremental/</code> | `rustc` [incremental output], a cache used to speed up subsequent builds.
6464
<code style="white-space: nowrap">target/debug/build/</code> | Output from [build scripts].
6565

66-
### Dep-info files
66+
## Dep-info files
6767

6868
Next to each compiled artifact is a file called a "dep info" file with a `.d`
6969
suffix. This file is a Makefile-like syntax that indicates all of the file
@@ -77,7 +77,7 @@ re-executed. The paths in the file are absolute by default. See the
7777
/path/to/myproj/target/debug/foo: /path/to/myproj/src/lib.rs /path/to/myproj/src/main.rs
7878
```
7979

80-
### Shared cache
80+
## Shared cache
8181

8282
A third party tool, [sccache], can be used to share built dependencies across
8383
different workspaces.

src/doc/src/guide/cargo-home.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Cargo Home
1+
# Cargo Home
22

33
The "Cargo home" functions as a download and source cache.
44
When building a [crate][def-crate], Cargo stores downloaded build dependencies in the Cargo home.

src/doc/src/guide/cargo-toml-vs-cargo-lock.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Cargo.toml vs Cargo.lock
1+
# Cargo.toml vs Cargo.lock
22

33
`Cargo.toml` and `Cargo.lock` serve two different purposes. Before we talk
44
about them, here’s a summary:

src/doc/src/guide/continuous-integration.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
## Continuous Integration
1+
# Continuous Integration
22

3-
### Getting Started
3+
## Getting Started
44

55
A basic CI will build and test your projects:
66

7-
### GitHub Actions
7+
## GitHub Actions
88

99
To test your package on GitHub Actions, here is a sample `.github/workflows/ci.yml` file:
1010

@@ -38,7 +38,7 @@ jobs:
3838

3939
This will test all three release channels (note a failure in any toolchain version will fail the entire job). You can also click `"Actions" > "new workflow"` in the GitHub UI and select Rust to add the [default configuration](https://github.com/actions/starter-workflows/blob/main/ci/rust.yml) to your repo. See [GitHub Actions documentation](https://docs.github.com/en/actions) for more information.
4040

41-
### GitLab CI
41+
## GitLab CI
4242

4343
To test your package on GitLab CI, here is a sample `.gitlab-ci.yml` file:
4444

@@ -67,7 +67,7 @@ breakage in nightly will not fail your overall build. Please see the
6767
[GitLab CI documentation](https://docs.gitlab.com/ce/ci/yaml/index.html) for more
6868
information.
6969
70-
### builds.sr.ht
70+
## builds.sr.ht
7171
7272
To test your package on sr.ht, here is a sample `.build.yml` file.
7373
Be sure to change `<your repo>` and `<your project>` to the repo to clone and
@@ -105,7 +105,7 @@ channel, but any breakage in nightly will not fail your overall build. Please
105105
see the [builds.sr.ht documentation](https://man.sr.ht/builds.sr.ht/) for more
106106
information.
107107

108-
### Verifying Latest Dependencies
108+
## Verifying Latest Dependencies
109109

110110
When [specifying dependencies](../reference/specifying-dependencies.md) in
111111
`Cargo.toml`, they generally match a range of versions.

0 commit comments

Comments
 (0)