Skip to content

Commit fd24cb7

Browse files
rkbodennerthestinger
authored andcommitted
Usable instructions for generating docs from source
1 parent 769c2e5 commit fd24cb7

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

doc/README

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
1-
The markdown docs are only generated by make when node is installed (use
2-
`make doc`). If you don't have node installed you can generate them yourself.
3-
Unfortunately there's no real standard for markdown and all the tools work
4-
differently. pandoc is one that seems to work well.
1+
Pandoc, a universal document converter, is required to generate docs as HTML
2+
from Rust's source code. It's available for most platforms here:
3+
http://johnmacfarlane.net/pandoc/installing.html
54

6-
To generate an html version of a doc do something like:
7-
pandoc --from=markdown --to=html --number-sections -o build/doc/rust.html doc/rust.md && git web--browse build/doc/rust.html
5+
Node.js (http://nodejs.org/) is also required for generating HTML from
6+
the Markdown docs (reference manual, tutorials, etc.) distributed with
7+
this git repository.
8+
9+
To generate all the docs, run `make docs` from the root of the repository.
10+
This will convert the distributed Markdown docs to HTML and generate HTML doc
11+
for the 'std' and 'extra' libraries.
12+
13+
To generate HTML documentation from one source file/crate, do something like:
14+
15+
rustdoc --output-dir html-doc/ --output-format html ../src/libstd/path.rs
16+
17+
(This, of course, requires that you've built/installed the `rustdoc` tool.)
18+
19+
To generate an HTML version of a doc from Markdown, without having Node.js
20+
installed, do something like:
21+
22+
pandoc --from=markdown --to=html --number-sections -o rust.html rust.md
823

924
The syntax for pandoc flavored markdown can be found at:
1025
http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown

0 commit comments

Comments
 (0)