diff options
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/README.md | 32 | ||||
| -rw-r--r-- | src/doc/guide-ffi.md | 2 | ||||
| -rw-r--r-- | src/doc/guide-strings.md | 2 | ||||
| -rw-r--r-- | src/doc/guide.md | 12 | ||||
| -rw-r--r-- | src/doc/reference.md | 18 | ||||
| -rw-r--r-- | src/doc/rust.css | 7 |
6 files changed, 32 insertions, 41 deletions
diff --git a/src/doc/README.md b/src/doc/README.md index cf1557e6604..50222973509 100644 --- a/src/doc/README.md +++ b/src/doc/README.md @@ -1,4 +1,6 @@ -# Dependencies +# Rust documentations + +## Dependencies [Pandoc](http://johnmacfarlane.net/pandoc/installing.html), a universal document converter, is required to generate docs as HTML from Rust's @@ -10,7 +12,7 @@ docs from the master (English) docs. [GNU gettext](http://www.gnu.org/software/gettext/) is required for managing the translation data. -# Building +## Building To generate all the docs, just run `make docs` from the root of the repository. This will convert the distributed Markdown docs to HTML and generate HTML doc @@ -24,7 +26,7 @@ rustdoc --output html-doc/ --output-format html ../src/libstd/path.rs (This, of course, requires a working build of the `rustdoc` tool.) -# Additional notes +## Additional notes To generate an HTML version of a doc from Markdown manually, you can do something like: @@ -33,37 +35,39 @@ something like: pandoc --from=markdown --to=html5 --number-sections -o reference.html reference.md ~~~~ -(reference.md being the Rust Reference Manual.) +(`reference.md` being the Rust Reference Manual.) The syntax for pandoc flavored markdown can be found at: -http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown + +- http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown A nice quick reference (for non-pandoc markdown) is at: -http://kramdown.rubyforge.org/quickref.html -# Notes for translators +- http://kramdown.gettalong.org/quickref.html + +## Notes for translators Notice: The procedure described below is a work in progress. We are working on translation system but the procedure contains some manual operations for now. -To start the translation for a new language, see po4a.conf at first. +To start the translation for a new language, see `po4a.conf` at first. -To generate .pot and .po files, do something like: +To generate `.pot` and `.po` files, do something like: ~~~~ po4a --copyright-holder="The Rust Project Developers" \ --package-name="Rust" \ - --package-version="0.11.0" \ + --package-version="0.13.0" \ -M UTF-8 -L UTF-8 \ src/doc/po4a.conf ~~~~ -(the version number must be changed if it is not 0.11.0 now.) +(the version number must be changed if it is not `0.13.0` now.) -Now you can translate documents with .po files, commonly used with gettext. If +Now you can translate documents with `.po` files, commonly used with gettext. If you are not familiar with gettext-based translation, please read the online manual linked from http://www.gnu.org/software/gettext/ . We use UTF-8 as the -file encoding of .po files. +file encoding of `.po` files. When you want to make a commit, do the command below before staging your change: @@ -79,4 +83,4 @@ for f in src/doc/po/**/*.po; do done ~~~~ -This removes untranslated entries from .po files to save disk space. +This removes untranslated entries from `.po` files to save disk space. diff --git a/src/doc/guide-ffi.md b/src/doc/guide-ffi.md index abd2cd7b33e..0b0a6b7b697 100644 --- a/src/doc/guide-ffi.md +++ b/src/doc/guide-ffi.md @@ -298,7 +298,7 @@ fn main() { C code: ~~~~c -typedef void (*rust_callback)(int32_t); +typedef void (*rust_callback)(void*, int32_t); void* cb_target; rust_callback cb; diff --git a/src/doc/guide-strings.md b/src/doc/guide-strings.md index a49132ec8be..afca75a76d4 100644 --- a/src/doc/guide-strings.md +++ b/src/doc/guide-strings.md @@ -206,5 +206,5 @@ Many more bytes than graphemes! # Other Documentation -* [the `&str` API documentation](/std/str/index.html) +* [the `&str` API documentation](std/str/index.html) * [the `String` API documentation](std/string/index.html) diff --git a/src/doc/guide.md b/src/doc/guide.md index 4e9966cb3db..5357a0fcafa 100644 --- a/src/doc/guide.md +++ b/src/doc/guide.md @@ -1746,8 +1746,7 @@ For our first project, we'll implement a classic beginner programming problem: the guessing game. Here's how it works: Our program will generate a random integer between one and a hundred. It will then prompt us to enter a guess. Upon entering our guess, it will tell us if we're too low or too high. Once we -guess correctly, it will congratulate us, and print the number of guesses we've -taken to the screen. Sound good? +guess correctly, it will congratulate us. Sound good? ## Set up @@ -3538,9 +3537,8 @@ restriction: 1. If the borrow is immutable, you may read the data the pointer points to. 2. If the borrow is mutable, you may read and write the data the pointer points to. -3. You may lend the pointer to someone else in an immutable fashion, **BUT** -4. When you do so, they must return it to you before you must give your own - borrow back. +3. You may lend the pointer to someone else, **BUT** +4. When you do so, they must return it before you can give your own borrow back. This last requirement can seem odd, but it also makes sense. If you have to return something, and you've lent it to someone, they need to give it back to @@ -5062,8 +5060,8 @@ println!("The value of x[0] is: {}", x[0]); // error: use of moved value: `x` ``` `x` is now owned by the proc, and so we can't use it anymore. Many other -languages would let us do this, but it's not safe to do so. Rust's type system -catches the error. +languages would let us do this, but it's not safe to do so. Rust's borrow +checker catches the error. If tasks were only able to capture these values, they wouldn't be very useful. Luckily, tasks can communicate with each other through **channel**s. Channels diff --git a/src/doc/reference.md b/src/doc/reference.md index 131637948c8..3c4b973002e 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -185,40 +185,24 @@ grammar as double-quoted strings. Other tokens have exact rules given. ### Keywords -The keywords are the following strings, organized by first letter: +<p id="keyword-table-marker">The keywords are the following strings, organized by first letter:</p> -<div id="keywords"> | | | | | |----------|--------|--------|-------| | as | | | | -|----------|--------|--------|-------| | box | break | | | -|----------|--------|--------|-------| | continue | crate | | | -|----------|--------|--------|-------| | else | enum | extern | | -|----------|--------|--------|-------| | false | fn | for | | -|----------|--------|--------|-------| | if | impl | in | | -|----------|--------|--------|-------| | let | loop | | | -|----------|--------|--------|-------| | match | mod | mut | | -|----------|--------|--------|-------| | priv | proc | pub | | -|----------|--------|--------|-------| | ref | return | | | -|----------|--------|--------|-------| | self | static | struct | super | -|----------|--------|--------|-------| | trait | true | type | | -|----------|--------|--------|-------| | unsafe | use | | | -|----------|--------|--------|-------| | while | | | | -|----------|--------|--------|-------| -</div> Each of these keywords has special meaning in its grammar, and all of them are excluded from the `ident` rule. diff --git a/src/doc/rust.css b/src/doc/rust.css index b615c392bd5..4bbb8098402 100644 --- a/src/doc/rust.css +++ b/src/doc/rust.css @@ -393,4 +393,9 @@ pre.rust { position: relative; } } } -#keywords table td { border: none; } +#keyword-table-marker + table thead { display: none; } +#keyword-table-marker + table td { border: none; } +#keyword-table-marker + table { + margin-left: 2em; + margin-bottom: 1em; +} |
