Go to file
Paul Emmerich 38ceba56a8 ci: validate that all used references are defined
this will catch issues like https://github.com/rust-lang/book/issues/2010
2019-07-14 22:25:04 +02:00
2018-edition point 2018 book redirects to existing pages instead of index 2019-04-14 04:23:30 +03:00
ci ci: validate that all used references are defined 2019-07-14 22:25:04 +02: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
nostarch Remove snapshot files that have been checked with layout 2019-06-09 21:30:40 -04:00
redirects Remove Advanced Lifetimes section completely 2019-04-11 11:51:14 -04:00
second-edition Remove Advanced Lifetimes section completely 2019-04-11 11:51:14 -04:00
src reexport to re-export 2019-06-27 09:50:36 -04:00
theme move the book to the top level 2018-11-20 13:45:05 -05:00
tools Add a script to help diff rendered books 2019-06-16 21:27:26 -04: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 the version of mdbook we use in-tree to match rust-lang/rust 2019-04-12 09:05:21 -04: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 move the book to the top level 2018-11-20 13:45:05 -05:00
Cargo.toml Add edition to Cargo.toml, use 2018 edition idoms 2018-12-16 22:56:38 -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 Update mdbook links 2019-06-16 13:03:44 +08:00
book.toml move the book to the top level 2018-11-20 13:45:05 -05:00
convert-quotes.sh Removed copyright notices & made cosmetic improvements. 2019-01-13 03:29:45 +00:00
doc-to-md.sh Move my script up 2019-01-29 10:03:40 -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
nostarch.sh Removed copyright notices & made cosmetic improvements. 2019-01-13 03:29:45 +00: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.

Requirements

Building the book requires mdBook, ideally the same 0.2.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!

Graphviz dot

We're using Graphviz for some of the diagrams in the book. The source for those files live in the dot directory. To turn a dot file, for example, dot/trpl04-01.dot into an svg, run:

$ dot dot/trpl04-01.dot -Tsvg > src/img/trpl04-01.svg

In the generated SVG, remove the width and the height attributes from the svg element and set the viewBox attribute to 0.00 0.00 1000.00 1000.00 or other values that don't cut off the image.

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).