Skip to content

Commit

Permalink
Added "Provide hints to similar functions" (#23788)
Browse files Browse the repository at this point in the history
* Added "Provide hints to similar functions"

This PR proposes a standard wording for hints to similar functions.
Feel free to correct and change!

* added ms-list formatting, ref-links

* Removed short description style

* Added frederiks corrections

* whitespace

* Bold `See also`, add newline, wording suggestions

* Removed bold

* fix colon
  • Loading branch information
Christian Kurz authored and fredrikekre committed Sep 25, 2017
1 parent 0588ba4 commit ee7b0b8
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions doc/src/manual/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,15 @@ As in the example above, we recommend following some simple conventions when wri
...
"""
```
5. Include any code examples in an `# Examples` section.
5. Provide hints to related functions.

Sometimes there are functions of related functionality. To increase discoverability please provide
a short list of these in a `See also:` paragraph.

```
See also: [`bar!`](@ref), [`baz`](@ref), [`baaz`](@ref)
```
6. Include any code examples in an `# Examples` section.

Examples should, whenever possible, be written as *doctests*. A *doctest* is a fenced code block
(see [Code blocks](@ref)) starting with ````` ```jldoctest````` and contains any number of `julia>`
Expand Down Expand Up @@ -127,13 +135,13 @@ As in the example above, we recommend following some simple conventions when wri
!!! tip
Wherever possible examples should be **self-contained** and **runnable** so that readers are able
to try them out without having to include any dependencies.
6. Use backticks to identify code and equations.
7. Use backticks to identify code and equations.

Julia identifiers and code excerpts should always appear between backticks ``` ` ``` to enable
highlighting. Equations in the LaTeX syntax can be inserted between double backticks ``` `` ```.
Use Unicode characters rather than their LaTeX escape sequence, i.e. ``` ``α = 1`` ``` rather
than ``` ``\\alpha = 1`` ```.
7. Place the starting and ending `"""` characters on lines by themselves.
8. Place the starting and ending `"""` characters on lines by themselves.

That is, write:

Expand All @@ -156,7 +164,7 @@ As in the example above, we recommend following some simple conventions when wri
```

This makes it more clear where docstrings start and end.
8. Respect the line length limit used in the surrounding code.
9. Respect the line length limit used in the surrounding code.

Docstrings are edited using the same tools as code. Therefore, the same conventions should apply.
It it advised to add line breaks after 92 characters.
Expand Down

0 comments on commit ee7b0b8

Please sign in to comment.