Go to file
Carol (Nichols || Goulding) 3ef02e197c
Update dictionary
2019-01-02 11:05:53 -05:00
2018-edition Consistent tree styling 2018-12-29 19:53:53 +01:00
ci Update dictionary 2019-01-02 11:05:53 -05:00
dot move the book to the top level 2018-11-20 13:45:05 -05:00
first-edition remove first edition content 2018-11-20 16:40:05 -05:00
nostarch Editing and shipping new text to nostarch 2019-01-01 19:25:30 -05:00
redirects Merge pull request #1644 from psincf/patch-2 2018-12-12 22:29:00 -05:00
second-edition Remove obsolete nostarch snapshot files 2018-12-29 20:20:07 -05:00
src Editing and shipping new text to nostarch 2019-01-01 19:25:30 -05:00
theme move the book to the top level 2018-11-20 13:45:05 -05:00
tools Add edition to Cargo.toml, use 2018 edition idoms 2018-12-16 22:56:38 -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 Rust 1.31 is stable nowww 2018-12-14 22:09:28 -05:00
CONTRIBUTING.md Fix up contribution instructions 2018-12-12 09:59:58 -05: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 Fix up contribution instructions 2018-12-12 09:59:58 -05:00
book.toml move the book to the top level 2018-11-20 13:45:05 -05:00
convert-quotes.sh 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
nostarch.sh move the book to the top level 2018-11-20 13:45:05 -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".

The book is available in dead-tree form from No Starch Press! Check the No Starch Page for the latest information on the release date and how to order.

You can 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 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!

No Starch

As the book is published by No Starch, we first iterate here, then ship the text off to No Starch. Then they do editing, and we fold it back in.

As such, theres a directory, nostarch, which corresponds to the text in No Starchs system.

When we've started working with No Starch in a word doc, we will also check those into the repo in the nostarch/odt directory. To extract the text from the word doc as markdown in order to backport changes to the online book:

  1. Open the doc file in LibreOffice
  2. Accept all tracked changes
  3. Save as Microsoft Word 2007-2013 XML (.docx) in the tmp directory
  4. Run ./doc-to-md.sh
  5. Inspect changes made to the markdown file in the nostarch directory and copy the changes to the src directory as appropriate.

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