Skip to content
This repository was archived by the owner on Oct 9, 2018. It is now read-only.

Commit e7afba5

Browse files
committed
Merge pull request #25 from kballard/doc-comment-formatting
Update style documentation for doc comments
2 parents 121e90a + b46ba46 commit e7afba5

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

style/comments.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@ Instead of:
2323
Doc comments are prefixed by three slashes (`///`) and indicate
2424
documentation that you would like to be included in Rustdoc's output.
2525
They support
26-
[Markdown syntax](http://daringfireball.net/projects/markdown/)
26+
[Markdown syntax](https://en.wikipedia.org/wiki/Markdown)
2727
and are the main way of documenting your public APIs.
2828

29+
The supported markdown syntax includes all of the extensions listed in the
30+
[GitHub Flavored Markdown]
31+
(https://help.github.com/articles/github-flavored-markdown) documentation,
32+
plus superscripts.
33+
2934
### Summary line
3035

3136
The first line in any doc comment should be a single-line short sentence
@@ -39,18 +44,23 @@ All doc comments, including the summary line, should begin with a
3944
capital letter and end with a period, question mark, or exclamation
4045
point. Prefer full sentences to fragments.
4146

47+
The summary line should be written in
48+
[third person singular present indicative form]
49+
(http://en.wikipedia.org/wiki/English_verbs#Third_person_singular_present).
50+
Basically, this means write "Returns" instead of "Return".
51+
4252
For example:
4353

4454
``` rust
45-
/// Set up a default runtime configuration, given compiler-supplied arguments.
55+
/// Sets up a default runtime configuration, given compiler-supplied arguments.
4656
///
47-
/// This function will block until the entire pool of M:N schedulers have
57+
/// This function will block until the entire pool of M:N schedulers has
4858
/// exited. This function also requires a local task to be available.
4959
///
5060
/// # Arguments
5161
///
5262
/// * `argc` & `argv` - The argument vector. On Unix this information is used
53-
/// by os::args.
63+
/// by `os::args`.
5464
/// * `main` - The initial procedure to run inside of the M:N scheduling pool.
5565
/// Once this procedure exits, the scheduling pool will begin to shut
5666
/// down. The entire pool (and this function) will only return once

0 commit comments

Comments
 (0)