File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
5
5
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
- refs/heads/try2: 8dad7f579e029fd883d64848f4abb12630dcc3e6
8
+ refs/heads/try2: bd339ced3615c89d439b33f6d6ab7bd04c002f74
9
9
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -41,6 +41,27 @@ pub fn recalibrate() {
41
41
# }
42
42
~~~
43
43
44
+ Documentation can also be controlled via the ` doc ` attribute on items.
45
+
46
+ ~~~
47
+ #[doc = "
48
+ Calculates the factorial of a number.
49
+
50
+ Given the input integer `n`, this function will calculate `n!` and return it.
51
+ "]
52
+ pub fn factorial(n: int) -> int { if n < 2 {1} else {n * factorial(n)} }
53
+ ~~~
54
+
55
+ The ` doc ` attribute can also be used to control how rustdoc emits documentation
56
+ in some cases.
57
+
58
+ ```
59
+ // Rustdoc will inline documentation of a `pub use` into this crate when the
60
+ // `pub use` reaches across crates, but this behavior can also be disabled.
61
+ #[doc(no_inline)]
62
+ pub use std::option::Option;
63
+ ```
64
+
44
65
Doc comments are markdown, and are currently parsed with the
45
66
[ sundown] [ sundown ] library. rustdoc does not yet do any fanciness such as
46
67
referencing other items inline, like javadoc's ` @see ` . One exception to this
You can’t perform that action at this time.
0 commit comments