diff options
| author | bors <bors@rust-lang.org> | 2014-06-30 07:31:29 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-06-30 07:31:29 +0000 |
| commit | 2735c7bb104d0938bccd261c5ea0d083f05ceba5 (patch) | |
| tree | b17bfa5031a983fc6fcb2cd4f6548d728773261e /src/doc | |
| parent | e1683f50c00297e9908ae028fa1d41b9a52a6f6f (diff) | |
| parent | 63afc082629044755df0c416ecf4c20ef0375254 (diff) | |
| download | rust-2735c7bb104d0938bccd261c5ea0d083f05ceba5.tar.gz rust-2735c7bb104d0938bccd261c5ea0d083f05ceba5.zip | |
auto merge of #15237 : zzmp/rust/feat/markdown-in-crate-documentation, r=huonw
This makes the `in-header`, `markdown-before-content`, and `markdown-after-content` options available to `rustdoc` when generating documentation for any crate. Before, these options were only available when creating documentation *from* markdown. Now, they are available when generating documentation from source. This also updates the `rustdoc -h` output to reflect these changes. It does not update the `man rustdoc` page, nor does it update the documentation in [the `rustdoc` manual](http://doc.rust-lang.org/rustdoc.html).
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/rustdoc.md | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/doc/rustdoc.md b/src/doc/rustdoc.md index 2287bcabff7..8199eaea82c 100644 --- a/src/doc/rustdoc.md +++ b/src/doc/rustdoc.md @@ -103,6 +103,17 @@ rustdoc can also generate JSON, for consumption by other tools, with `rustdoc --output-format json`, and also consume already-generated JSON with `rustdoc --input-format json`. +rustdoc also supports personalizing the output from crates' documentation, +similar to markdown options. + +- `--html-in-header FILE`: includes the contents of `FILE` at the + end of the `<head>...</head>` section. +- `--html-before-content FILE`: includes the contents of `FILE` + directly after `<body>`, before the rendered content (including the + search bar). +- `--html-after-content FILE`: includes the contents of `FILE` + after all the rendered content. + # Using the Documentation The web pages generated by rustdoc present the same logical hierarchy that one @@ -238,16 +249,16 @@ detected by a `.md` or `.markdown` extension. There are 4 options to modify the output that Rustdoc creates. - `--markdown-css PATH`: adds a `<link rel="stylesheet">` tag pointing to `PATH`. -- `--markdown-in-header FILE`: includes the contents of `FILE` at the +- `--html-in-header FILE`: includes the contents of `FILE` at the end of the `<head>...</head>` section. -- `--markdown-before-content FILE`: includes the contents of `FILE` +- `--html-before-content FILE`: includes the contents of `FILE` directly after `<body>`, before the rendered content (including the title). -- `--markdown-after-content FILE`: includes the contents of `FILE` +- `--html-after-content FILE`: includes the contents of `FILE` directly before `</body>`, after all the rendered content. All of these can be specified multiple times, and they are output in -the order in which they are specified. The first line of the file must +the order in which they are specified. The first line of the file being rendered must be the title, prefixed with `%` (e.g. this page has `% Rust Documentation` on the first line). |
