@@ -14,13 +14,53 @@ Use line comments instead:
14
14
pub fn spawn (f : proc (): Send ) { ... }
15
15
```
16
16
17
- ### Style doc comments like sentences.
17
+ ## Doc comments
18
18
19
- Doc comments should begin with capital letters and end in a period,
20
- even in the short summary description. Prefer full sentences to
21
- fragments.
19
+ Doc comments are prefixed by three slashes (` /// ` ) and indicate
20
+ documentation that you would like to be included in Rustdoc's output.
21
+ They support
22
+ [ Markdown syntax] ( http://daringfireball.net/projects/markdown/ )
23
+ and are the main way of documenting your public APIs.
22
24
23
- > ** [ FIXME] ** Example.
25
+ ### Summary line
26
+
27
+ The first line in any doc comment should be a single-line short sentence
28
+ providing a summary of the code. This line is used as a short summary
29
+ description throughout Rustdoc's output, so it's a good idea to keep it
30
+ short.
31
+
32
+ ### Sentence structure
33
+
34
+ All doc comments, including the summary line, should begin with a
35
+ capital letter and ending with a period, question mark, or exclamation
36
+ point. Prefer full sentences to fragments.
37
+
38
+ For example:
39
+
40
+ ``` rust
41
+ /// Set up a default runtime configuration, given compiler-supplied arguments.
42
+ ///
43
+ /// This function will block until the entire pool of M:N schedulers have
44
+ /// exited. This function also requires a local task to be available.
45
+ ///
46
+ /// # Arguments
47
+ ///
48
+ /// * `argc` & `argv` - The argument vector. On Unix this information is used
49
+ /// by os::args.
50
+ /// * `main` - The initial procedure to run inside of the M:N scheduling pool.
51
+ /// Once this procedure exits, the scheduling pool will begin to shut
52
+ /// down. The entire pool (and this function) will only return once
53
+ /// all child tasks have finished executing.
54
+ ///
55
+ /// # Return value
56
+ ///
57
+ /// The return value is used as the process return code. 0 on success, 101 on
58
+ /// error.
59
+ ```
60
+
61
+ ### Code snippets
62
+
63
+ > ** [ OPEN] **
24
64
25
65
### Avoid inner doc comments.
26
66
0 commit comments