]> git.proxmox.com Git - rustc.git/blob - src/doc/book/README.md
New upstream version 1.43.0+dfsg1
[rustc.git] / src / doc / book / README.md
1 # The Rust Programming Language
2
3 [![Build Status](https://travis-ci.com/rust-lang/book.svg?branch=master)](https://travis-ci.com/rust-lang/book)
4
5 This repository contains the source of "The Rust Programming Language" book.
6
7 [The book is available in dead-tree form from No Starch Press][nostarch].
8
9 [nostarch]: https://nostarch.com/rust
10
11 You can also read the book for free online. Please see the book as shipped with
12 the latest [stable], [beta], or [nightly] Rust releases. Be aware that issues
13 in those versions may have been fixed in this repository already, as those
14 releases are updated less frequently.
15
16 [stable]: https://doc.rust-lang.org/stable/book/
17 [beta]: https://doc.rust-lang.org/beta/book/
18 [nightly]: https://doc.rust-lang.org/nightly/book/
19
20 See the [releases] to download just the code of all the code listings that appear in the book.
21
22 [releases]: https://github.com/rust-lang/book/releases
23
24 ## Requirements
25
26 Building the book requires [mdBook], ideally the same 0.3.x version that
27 rust-lang/rust uses in [this file][rust-mdbook]. To get it:
28
29 [mdBook]: https://github.com/rust-lang-nursery/mdBook
30 [rust-mdbook]: https://github.com/rust-lang/rust/blob/master/src/tools/rustbook/Cargo.toml
31
32 ```bash
33 $ cargo install mdbook --vers [version-num]
34 ```
35
36 ## Building
37
38 To build the book, type:
39
40 ```bash
41 $ mdbook build
42 ```
43
44 The output will be in the `book` subdirectory. To check it out, open it in
45 your web browser.
46
47 _Firefox:_
48 ```bash
49 $ firefox book/index.html # Linux
50 $ open -a "Firefox" book/index.html # OS X
51 $ Start-Process "firefox.exe" .\book\index.html # Windows (PowerShell)
52 $ start firefox.exe .\book\index.html # Windows (Cmd)
53 ```
54
55 _Chrome:_
56 ```bash
57 $ google-chrome book/index.html # Linux
58 $ open -a "Google Chrome" book/index.html # OS X
59 $ Start-Process "chrome.exe" .\book\index.html # Windows (PowerShell)
60 $ start chrome.exe .\book\index.html # Windows (Cmd)
61 ```
62
63 To run the tests:
64
65 ```bash
66 $ mdbook test
67 ```
68
69 ## Contributing
70
71 We'd love your help! Please see [CONTRIBUTING.md][contrib] to learn about the
72 kinds of contributions we're looking for.
73
74 [contrib]: https://github.com/rust-lang/book/blob/master/CONTRIBUTING.md
75
76 ### Translations
77
78 We'd love help translating the book! See the [Translations] label to join in
79 efforts that are currently in progress. Open a new issue to start working on
80 a new language! We're waiting on [mdbook support] for multiple languages
81 before we merge any in, but feel free to start!
82
83 [Translations]: https://github.com/rust-lang/book/issues?q=is%3Aopen+is%3Aissue+label%3ATranslations
84 [mdbook support]: https://github.com/rust-lang-nursery/mdBook/issues/5
85
86 ## Spellchecking
87
88 To scan source files for spelling errors, you can use the `spellcheck.sh`
89 script. It needs a dictionary of valid words, which is provided in
90 `dictionary.txt`. If the script produces a false positive (say, you used word
91 `BTreeMap` which the script considers invalid), you need to add this word to
92 `dictionary.txt` (keep the sorted order for consistency).