about summary refs log tree commit diff
path: root/src/doc/rustdoc
diff options
context:
space:
mode:
authorQuietMisdreavus <grey@quietmisdreavus.net>2018-03-14 17:13:52 -0500
committerQuietMisdreavus <grey@quietmisdreavus.net>2018-03-14 17:13:52 -0500
commit067553d5a1d867c7f8404153ce37a4008489b82a (patch)
tree1f90d4c1be6bee2ee21f6d722037ef95a0b3c70e /src/doc/rustdoc
parent82bd146d60425c3cd0c99892742f1454f5eb8191 (diff)
downloadrust-067553d5a1d867c7f8404153ce37a4008489b82a.tar.gz
rust-067553d5a1d867c7f8404153ce37a4008489b82a.zip
talk about doc(include)
Diffstat (limited to 'src/doc/rustdoc')
-rw-r--r--src/doc/rustdoc/src/unstable-features.md22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md
index 9f0476d4eef..62112fbf293 100644
--- a/src/doc/rustdoc/src/unstable-features.md
+++ b/src/doc/rustdoc/src/unstable-features.md
@@ -162,9 +162,25 @@ To prevent internal types from being included in documentation, the standard lib
 attribute to their `extern crate` declarations: `#[doc(masked)]`. This causes Rustdoc to "mask out"
 types from these crates when building lists of trait implementations.
 
-The `#[doc(masked)]` attribute is intended to be used internally, and is governed by a feature gate.
-For more information, see [its chapter in the Unstable Book][unstable-masked] and [its tracking
-issue][issue-masked].
+The `#[doc(masked)]` attribute is intended to be used internally, and is controlled by a feature
+gate.  For more information, see [its chapter in the Unstable Book][unstable-masked] and [its
+tracking issue][issue-masked].
 
 [unstable-masked]: ../unstable-book/language-features/doc-masked.html
 [issue-masked]: https://github.com/rust-lang/rust/issues/44027
+
+## Include external files as API documentation
+
+As designed in [RFC 1990], Rustdoc can read an external file to use as a type's documentation. This
+is useful if certain documentation is so long that it would break the flow of reading the source.
+Instead of writing it all inline, writing `#[doc(include = "sometype.md")]` (where `sometype.md` is
+a file adjacent to the `lib.rs` for the crate) will ask Rustdoc to instead read that file and use it
+as if it were written inline.
+
+[RFC 1990]: https://github.com/rust-lang/rfcs/pull/1990
+
+`#[doc(include = "...")]` is currently controlled by a feature gate. For more information, see [its
+chapter in the Unstable Book][unstable-include] and [its tracking issue][issue-include].
+
+[unstable-include]: ../unstable-book/language-features/external-doc.html
+[issue-include]: https://github.com/rust-lang/rust/issues/44732