rust/doc
2014-02-02 01:44:50 +11:00
..
lib
po/ja Update extract-tests.py to use same test directives as rustdoc. 2014-01-28 14:52:36 -06:00
complement-bugreport.md Various READMEs and docs cleanup 2014-01-11 19:41:31 +01:00
complement-cheatsheet.md Update extract-tests.py to use same test directives as rustdoc. 2014-01-28 14:52:36 -06:00
complement-lang-faq.md Various READMEs and docs cleanup 2014-01-11 19:41:31 +01:00
complement-project-faq.md Various READMEs and docs cleanup 2014-01-11 19:41:31 +01:00
complement-usage-faq.md Various READMEs and docs cleanup 2014-01-11 19:41:31 +01:00
favicon.inc
full-toc.inc First phase of migrating the wiki to the internal docs #11078 2014-01-06 15:27:49 -06:00
guide-conditions.md Removing usage of the do keyword from documentation 2014-01-29 09:15:42 -05:00
guide-container.md Update extract-tests.py to use same test directives as rustdoc. 2014-01-28 14:52:36 -06:00
guide-ffi.md Update extract-tests.py to use same test directives as rustdoc. 2014-01-28 14:52:36 -06:00
guide-lifetimes.md Update extract-tests.py to use same test directives as rustdoc. 2014-01-28 14:52:36 -06:00
guide-macros.md doc: Title guides consistently 2014-01-07 17:01:06 -08:00
guide-pointers.md Removing usage of the do keyword from documentation 2014-01-29 09:15:42 -05:00
guide-runtime.md Removing usage of the do keyword from documentation 2014-01-29 09:15:42 -05:00
guide-rustpkg.md Remove re-exports of std::io::stdio::{print, println} in the prelude. 2014-01-11 10:46:00 +11:00
guide-tasks.md Removing usage of the do keyword from documentation 2014-01-29 09:15:42 -05:00
guide-testing.md Consistent formatting for args and attrs 2014-01-18 21:45:05 +01:00
index.md extra: move glob to libglob 2014-01-29 17:23:28 +11:00
po4a.conf Update doc/po4a.conf for recent changes. 2014-01-10 07:21:32 +09:00
prep.js
README.md Note that translation workflow is WIP now. 2014-01-14 21:30:15 +09:00
rust.css First phase of migrating the wiki to the internal docs #11078 2014-01-06 15:27:49 -06:00
rust.md doc: Remove references to @str from the documentation 2014-02-02 01:44:50 +11:00
rustdoc.md Unhide lines in rustdoc's doc -- Closes #11645 2014-01-26 13:39:39 +01:00
rustpkg.md Update Docs to use crateid 2013-12-29 15:25:43 -05:00
tutorial.md mark the minimum supported Linux kernel version 2014-01-31 21:43:08 -08:00
version_info.html.template

Dependencies

Pandoc, a universal document converter, is required to generate docs as HTML from Rust's source code.

Node.js is also required for generating HTML from the Markdown docs (reference manual, tutorials, etc.) distributed with this git repository.

po4a is required for generating translated docs from the master (English) docs.

GNU gettext is required for managing the translation data.

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 for the 'std' and 'extra' libraries.

To generate HTML documentation from one source file/crate, do something like:

rustdoc --output-dir html-doc/ --output-format html ../src/libstd/path.rs

(This, of course, requires a working build of the rustdoc tool.)

Additional notes

To generate an HTML version of a doc from Markdown without having Node.js installed, you can do something like:

pandoc --from=markdown --to=html5 --number-sections -o rust.html rust.md

(rust.md being the Rust Reference Manual.)

The syntax for pandoc flavored markdown can be found at: 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

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 generate .pot and .po files, do something like:

po4a --copyright-holder="The Rust Project Developers" \
    --package-name="Rust" \
    --package-version="0.10-pre" \
    -M UTF-8 -L UTF-8 \
    po4a.conf

(the version number must be changed if it is not 0.10-pre now.)

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.

When you want to make a commit, do the command below before staging your change:

for f in doc/po/**/*.po; do
    msgattrib --translated $f -o $f.strip
    if [ -e $f.strip ]; then
       mv $f.strip $f
    else
       rm $f
    fi
done

This removes untranslated entries from .po files to save disk space.