about summary refs log tree commit diff
path: root/src/doc/rustdoc/src/the-doc-attribute.md
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc/rustdoc/src/the-doc-attribute.md')
-rw-r--r--src/doc/rustdoc/src/the-doc-attribute.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/doc/rustdoc/src/the-doc-attribute.md b/src/doc/rustdoc/src/the-doc-attribute.md
index 52f2a3728fa..d192f7d5ce9 100644
--- a/src/doc/rustdoc/src/the-doc-attribute.md
+++ b/src/doc/rustdoc/src/the-doc-attribute.md
@@ -35,6 +35,13 @@ Which can feel more flexible. Note that this would generate this:
 
 but given that docs are rendered via Markdown, it will remove these newlines.
 
+Another use case is for including external files as documentation:
+
+```rust,no_run
+#[doc = include_str!("../README.md")]
+# fn f() {}
+```
+
 The `doc` attribute has more options though! These don't involve the text of
 the output, but instead, various aspects of the presentation of the output.
 We've split them into two kinds below: attributes that are useful at the