Go to file
Carol (Nichols || Goulding) dec27eead0
Add rustfmt to the update-rustc script
With a mechanism to ignore particular listings for various reasons
2020-01-25 21:20:41 -05:00
.cargo Set cargo new config vars to placeholders for example projects 2020-01-20 15:39:50 -05:00
2018-edition Remove duplicate copies of tools, licenses, Cargo.tomls 2020-01-10 16:18:54 -05:00
ci Extract code listings to separate files 2020-01-25 21:20:38 -05:00
dot move the book to the top level 2018-11-20 13:45:05 -05:00
first-edition More link fixes 2019-02-25 01:33:17 +00:00
listings Add rustfmt to the update-rustc script 2020-01-25 21:20:41 -05:00
redirects Remove Advanced Lifetimes section completely 2019-04-11 11:51:14 -04:00
second-edition Remove duplicate copies of tools, licenses, Cargo.tomls 2020-01-10 16:18:54 -05:00
src Extract code listings to separate files 2020-01-25 21:20:38 -05:00
theme move the book to the top level 2018-11-20 13:45:05 -05:00
tools Add rustfmt to the update-rustc script 2020-01-25 21:20:41 -05:00
.gitattributes Mark png as binary 2017-03-31 15:30:48 -04:00
.gitignore Add a script that hooks the nostarch build commands together 2016-08-18 10:54:22 -04:00
.travis.yml Update version of mdbook used to what rust-lang/rust uses 2020-01-10 15:04:32 -05:00
ADMIN_TASKS.md Add rustfmt to the update-rustc script 2020-01-25 21:20:41 -05:00
CONTRIBUTING.md Update mdbook links 2019-06-16 13:03:44 +08:00
COPYRIGHT COPYRIGHT: hoedown is no longer used 2017-04-06 21:56:44 +08:00
Cargo.lock Script to generate release artifact of just the listings 2020-01-20 15:40:14 -05:00
Cargo.toml Include code without hidden lines for nostarch files 2020-01-20 15:40:15 -05:00
LICENSE-APACHE Work towards getting tidy clean 2017-03-13 13:51:36 -04:00
LICENSE-MIT Work towards getting tidy clean 2017-03-13 13:51:36 -04:00
README.md Document administrative tasks that are now scripted 2020-01-24 09:09:16 -05:00
book.toml move the book to the top level 2018-11-20 13:45:05 -05:00
ferris.css move the book to the top level 2018-11-20 13:45:05 -05:00
ferris.js move the book to the top level 2018-11-20 13:45:05 -05:00
rust-toolchain Specify the rustc version we're using in a rust-toolchain file 2019-09-30 20:13:33 -04:00
rustfmt.toml Add rustfmt to the update-rustc script 2020-01-25 21:20:41 -05:00
style-guide.md move the book to the top level 2018-11-20 13:45:05 -05:00

README.md

The Rust Programming Language

Build Status

This repository contains the source of "The Rust Programming Language" book.

The book is available in dead-tree form from No Starch Press.

You can also read the book for free online. Please see the book as shipped with the latest stable, beta, or nightly Rust releases. Be aware that issues in those versions may have been fixed in this repository already, as those releases are updated less frequently.

See the releases to download just the code of all the code listings that appear in the book.

Requirements

Building the book requires mdBook, ideally the same 0.3.x version that rust-lang/rust uses in this file. To get it:

$ cargo install mdbook --vers [version-num]

Building

To build the book, type:

$ mdbook build

The output will be in the book subdirectory. To check it out, open it in your web browser.

Firefox:

$ firefox book/index.html                       # Linux
$ open -a "Firefox" book/index.html             # OS X
$ Start-Process "firefox.exe" .\book\index.html # Windows (PowerShell)
$ start firefox.exe .\book\index.html           # Windows (Cmd)

Chrome:

$ google-chrome book/index.html                 # Linux
$ open -a "Google Chrome" book/index.html       # OS X
$ Start-Process "chrome.exe" .\book\index.html  # Windows (PowerShell)
$ start chrome.exe .\book\index.html            # Windows (Cmd)

To run the tests:

$ mdbook test

Contributing

We'd love your help! Please see CONTRIBUTING.md to learn about the kinds of contributions we're looking for.

Translations

We'd love help translating the book! See the Translations label to join in efforts that are currently in progress. Open a new issue to start working on a new language! We're waiting on mdbook support for multiple languages before we merge any in, but feel free to start!

Spellchecking

To scan source files for spelling errors, you can use the spellcheck.sh script. It needs a dictionary of valid words, which is provided in dictionary.txt. If the script produces a false positive (say, you used word BTreeMap which the script considers invalid), you need to add this word to dictionary.txt (keep the sorted order for consistency).